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/nexra/NexraQwen.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](/MeowCollections/gpt4free/pull/107/commits) and [Changes](/MeowCollections/gpt4free/pull/107/files) for more details.

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

_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: 
-from aiohttp import ClientSession
3: import json
4:+import requests
5: 
-from ...typing import AsyncResult, Messages
-from ..base_provider import AsyncGeneratorProvider, ProviderModelMixin
6:+from ...typing import CreateResult, Messages
7:+from ..base_provider import ProviderModelMixin, AbstractProvider
8: from ..helper import format_prompt
9: 
-
-class NexraQwen(AsyncGeneratorProvider, ProviderModelMixin):
10:+class NexraQwen(AbstractProvider, ProviderModelMixin):
11:     label = "Nexra Qwen"
12:     url = "https://nexra.aryahcr.cc/documentation/qwen/en"
13:     api_endpoint = "https://nexra.aryahcr.cc/api/chat/complements"
20:     @classmethod
21:     def get_model(cls, model: str) -> str:
22:         return cls.default_model
-
23:+            
24:     @classmethod
-    async def create_async_generator(
25:+    def create_completion(
26:         cls,
27:         model: str,
28:         messages: Messages,
29:+        stream: bool,
30:         proxy: str = None,
-        stream: bool = False,
31:         markdown: bool = False,
32:         **kwargs
-    ) -> AsyncResult:
33:+    ) -> CreateResult:
34:         model = cls.get_model(model)
-        
35:+
36:         headers = {
-            "Content-Type": "application/json",
-            "accept": "application/json",
-            "origin": cls.url,
-            "referer": f"{cls.url}/chat",
37:+            'Content-Type': 'application/json'
38:+        }
39:+        
40:+        data = {
41:+            "messages": [
42:+                {
43:+                    "role": "user",
44:+                    "content": format_prompt(messages)
45:+                }
46:+            ],
47:+            "stream": stream,
48:+            "markdown": markdown,
49:+            "model": model
50:         }
-        async with ClientSession(headers=headers) as session:
-            prompt = format_prompt(messages)
-            data = {
-                "messages": [
-                    {
-                        "role": "user",
-                        "content": prompt
-                    }
-                ],
-                "markdown": markdown,
-                "stream": stream,
-                "model": model
-            }
-            async with session.post(cls.api_endpoint, json=data, proxy=proxy) as response:
-                response.raise_for_status()
-                
-                complete_message = ""
-                
-                # If streaming, process each chunk separately
-                if stream:
-                    async for chunk in response.content.iter_any():
-                        if chunk:
-                            try:
-                                # Decode the chunk and split by the delimiter
-                                parts = chunk.decode('utf-8').split('\x1e')
-                                for part in parts:
-                                    if part.strip():  # Ensure the part is not empty
-                                        response_data = json.loads(part)
-                                        message_part = response_data.get('message')
-                                        if message_part:
-                                            complete_message = message_part
-                            except json.JSONDecodeError:
-                                continue
51:+        
52:+        response = requests.post(cls.api_endpoint, headers=headers, json=data, stream=stream)
53:+
54:+        if stream:
55:+            return cls.process_streaming_response(response)
56:+        else:
57:+            return cls.process_non_streaming_response(response)
58: 
-                    # Yield the final complete message
-                    if complete_message:
-                        yield complete_message
-                else:
-                    # Handle non-streaming response
-                    text_response = await response.text()
-                    response_data = json.loads(text_response)
-                    message = response_data.get('message')
-                    if message:
-                        yield message
59:+    @classmethod
60:+    def process_non_streaming_response(cls, response):
61:+        if response.status_code == 200:
62:+            try:
63:+                content = response.text.lstrip('')
64:+                data = json.loads(content)
65:+                return data.get('message', '')
66:+            except json.JSONDecodeError:
67:+                return "Error: Unable to decode JSON response"
68:+        else:
69:+            return f"Error: {response.status_code}"
70:+
71:+    @classmethod
72:+    def process_streaming_response(cls, response):
73:+        full_message = ""
74:+        for line in response.iter_lines(decode_unicode=True):
75:+            if line:
76:+                try:
77:+                    line = line.lstrip('')
78:+                    data = json.loads(line)
79:+                    if data.get('finish'):
80:+                        break
81:+                    message = data.get('message', '')
82:+                    if message is not None and message != full_message:
83:+                        yield message[len(full_message):]
84:+                        full_message = message
85:+                except json.JSONDecodeError:
86:+                    pass
```