Your task is to review pull requests. Instructions:
- Provide the response in following JSON format: {"reviews": [{"line": <line_number>, "body": "<review comment>"}]}
- Do not give positive comments or compliments.
- Provide comments and suggestions ONLY if there is something to improve, otherwise "reviews" should be an empty array.
- Write the comment in GitHub Markdown format.
- Use the given description only for the overall context and only comment the code.
- IMPORTANT: NEVER suggest adding comments to the code.

Review the following code diff in the file "g4f/Provider/BlackboxAPI.py" and take the pull request title and description into account when writing the response.
  
Pull request title: [pull] main from xtekky:main
Pull request description:
---
See [Commits](/josbu/gpt4free/pull/177/commits) and [Changes](/josbu/gpt4free/pull/177/files) for more details.

-----
Created by [<img src="https://prod.download/pull-18h-svg" valign="bottom"/> **pull[bot]**](https://github.com/wei/pull) (v2.0.0-alpha.1)

_Can you help keep this open source service alive? **[💖 Please sponsor : )](https://prod.download/pull-pr-sponsor)**_
---

Each line is prefixed by its number. Code to review:
```
1:+from __future__ import annotations
2:+import json
3:+from aiohttp import ClientSession
4:+
5:+from ..typing import AsyncResult, Messages
6:+from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
7:+from ..requests.raise_for_status import raise_for_status
8:+from ..providers.response import Reasoning
9:+from .helper import format_prompt
10:+
11:+class BlackboxAPI(AsyncGeneratorProvider, ProviderModelMixin):
12:+    label = "Blackbox AI API"
13:+    url = "https://api.blackbox.ai"
14:+    api_endpoint = "https://api.blackbox.ai/api/chat"
15:+    
16:+    working = True
17:+    needs_auth = False
18:+    supports_stream = False
19:+    supports_system_message = True
20:+    supports_message_history = True
21:+    
22:+    default_model = 'deepseek-ai/DeepSeek-V3'
23:+    reasoning_models = ['deepseek-ai/DeepSeek-R1']
24:+    models = [
25:+        default_model,
26:+        'mistralai/Mistral-Small-24B-Instruct-2501',
27:+        'deepseek-ai/deepseek-llm-67b-chat',
28:+        'databricks/dbrx-instruct',
29:+        'Qwen/QwQ-32B-Preview',
30:+        'NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO'
31:+    ] + reasoning_models
32:+    
33:+    model_aliases = {       
34:+        "deepseek-v3": "deepseek-ai/DeepSeek-V3",
35:+        "deepseek-r1": "deepseek-ai/DeepSeek-R1",
36:+        "deepseek-chat": "deepseek-ai/deepseek-llm-67b-chat",
37:+        "mixtral-small-28b": "mistralai/Mistral-Small-24B-Instruct-2501",
38:+        "dbrx-instruct": "databricks/dbrx-instruct",
39:+        "qwq-32b": "Qwen/QwQ-32B-Preview",
40:+        "hermes-2-dpo": "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
41:+    }
42:+
43:+    @classmethod
44:+    async def create_async_generator(
45:+        cls,
46:+        model: str,
47:+        messages: Messages,
48:+        proxy: str = None,
49:+        max_tokens: str = None,
50:+        **kwargs
51:+    ) -> AsyncResult:
52:+        model = cls.get_model(model)
53:+        
54:+        headers = {
55:+            "Content-Type": "application/json",
56:+        }
57:+        
58:+        async with ClientSession(headers=headers) as session:
59:+            data = {
60:+                "messages": messages,
61:+                "model": model,
62:+                "max_tokens": max_tokens
63:+            }
64:+            
65:+            async with session.post(cls.api_endpoint, json=data, proxy=proxy) as response:
66:+                await raise_for_status(response)
67:+                
68:+                is_reasoning = False
69:+                current_reasoning = ""
70:+                
71:+                async for chunk in response.content:
72:+                    if not chunk:
73:+                        continue
74:+                    
75:+                    text = chunk.decode(errors='ignore')
76:+                    
77:+                    if model in cls.reasoning_models:
78:+                        if "<think>" in text:
79:+                            text = text.replace("<think>", "")
80:+                            is_reasoning = True
81:+                            current_reasoning = text
82:+                            continue
83:+                            
84:+                        if "</think>" in text:
85:+                            text = text.replace("</think>", "")
86:+                            is_reasoning = False
87:+                            current_reasoning += text
88:+                            yield Reasoning(status=current_reasoning.strip())
89:+                            current_reasoning = ""
90:+                            continue
91:+                            
92:+                        if is_reasoning:
93:+                            current_reasoning += text
94:+                            continue
95:+                    
96:+                    try:
97:+                        if text:
98:+                            yield text
99:+                    except Exception as e:
100:+                        return
101:+
102:+                if is_reasoning and current_reasoning:
103:+                    yield Reasoning(status=current_reasoning.strip())
```