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/NexraGeminiPro.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
-from ..base_provider import AsyncGeneratorProvider, ProviderModelMixin
-from ..helper import format_prompt
-from ...typing import AsyncResult, Messages
4:+import requests
5: 
6:+from ...typing import CreateResult, Messages
7:+from ..base_provider import ProviderModelMixin, AbstractProvider
8:+from ..helper import format_prompt
9: 
-class NexraGeminiPro(AsyncGeneratorProvider, ProviderModelMixin):
10:+class NexraGeminiPro(AbstractProvider, ProviderModelMixin):
11:     label = "Nexra Gemini PRO"
12:     url = "https://nexra.aryahcr.cc/documentation/gemini-pro/en"
13:     api_endpoint = "https://nexra.aryahcr.cc/api/chat/complements"
-    working = False
14:+    working = True
15:     supports_stream = True
-
16:+    
17:     default_model = 'gemini-pro'
18:     models = [default_model]
19: 
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"
37:+            'Content-Type': 'application/json'
38:         }
-
39:+        
40:         data = {
41:             "messages": [
42:                 {
44:                     "content": format_prompt(messages)
45:                 }
46:             ],
-            "markdown": markdown,
47:             "stream": stream,
48:+            "markdown": markdown,
49:             "model": model
50:         }
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: 
-        async with ClientSession(headers=headers) as session:
-            async with session.post(cls.api_endpoint, json=data, proxy=proxy) as response:
-                response.raise_for_status()
-                buffer = ""
-                async for chunk in response.content.iter_any():
-                    if chunk.strip():  # Check if chunk is not empty
-                        buffer += chunk.decode()
-                        while '\x1e' in buffer:
-                            part, buffer = buffer.split('\x1e', 1)
-                            if part.strip():
-                                try:
-                                    response_json = json.loads(part)
-                                    message = response_json.get("message", "")
-                                    if message:
-                                        yield message
-                                except json.JSONDecodeError as e:
-                                    print(f"JSONDecodeError: {e}")
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:
83:+                        yield message[len(full_message):]
84:+                        full_message = message
85:+                except json.JSONDecodeError:
86:+                    pass
```