diff options
author | kqlio67 <kqlio67@users.noreply.github.com> | 2024-11-08 18:20:21 +0100 |
---|---|---|
committer | kqlio67 <kqlio67@users.noreply.github.com> | 2024-11-08 18:20:21 +0100 |
commit | db347ef09734f9292ba449b242186d89746c0b64 (patch) | |
tree | 673b96af58ac149c12bdc9d208e47eb4fc2223d3 /g4f/Provider/airforce/AirforceChat.py | |
parent | Update (g4f/client/) (diff) | |
download | gpt4free-db347ef09734f9292ba449b242186d89746c0b64.tar gpt4free-db347ef09734f9292ba449b242186d89746c0b64.tar.gz gpt4free-db347ef09734f9292ba449b242186d89746c0b64.tar.bz2 gpt4free-db347ef09734f9292ba449b242186d89746c0b64.tar.lz gpt4free-db347ef09734f9292ba449b242186d89746c0b64.tar.xz gpt4free-db347ef09734f9292ba449b242186d89746c0b64.tar.zst gpt4free-db347ef09734f9292ba449b242186d89746c0b64.zip |
Diffstat (limited to 'g4f/Provider/airforce/AirforceChat.py')
-rw-r--r-- | g4f/Provider/airforce/AirforceChat.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/g4f/Provider/airforce/AirforceChat.py b/g4f/Provider/airforce/AirforceChat.py index b4b1eca3..8affbe5c 100644 --- a/g4f/Provider/airforce/AirforceChat.py +++ b/g4f/Provider/airforce/AirforceChat.py @@ -46,7 +46,7 @@ def split_messages(messages: Messages, chunk_size: int = 995) -> Messages: class AirforceChat(AsyncGeneratorProvider, ProviderModelMixin): label = "AirForce Chat" - api_endpoint_completions = "https://api.airforce/chat/completions" # Замініть на реальний ендпоінт + api_endpoint = "https://api.airforce/chat/completions" supports_stream = True supports_system_message = True supports_message_history = True @@ -118,8 +118,8 @@ class AirforceChat(AsyncGeneratorProvider, ProviderModelMixin): 'openchat-3.5-0106', # qwen - #'Qwen1.5-72B-Chat', Пуста відповідь - #'Qwen1.5-110B-Chat', Пуста відповідь + #'Qwen1.5-72B-Chat', # Empty answer + #'Qwen1.5-110B-Chat', # Empty answer 'Qwen2-72B-Instruct', 'Qwen2.5-7B-Instruct-Turbo', 'Qwen2.5-72B-Instruct-Turbo', @@ -350,7 +350,7 @@ class AirforceChat(AsyncGeneratorProvider, ProviderModelMixin): } async with ClientSession(headers=headers) as session: - async with session.post(cls.api_endpoint_completions, json=data, proxy=proxy) as response: + async with session.post(cls.api_endpoint, json=data, proxy=proxy) as response: response.raise_for_status() text = "" if stream: @@ -362,7 +362,7 @@ class AirforceChat(AsyncGeneratorProvider, ProviderModelMixin): chunk = json.loads(json_str) if 'choices' in chunk and chunk['choices']: content = chunk['choices'][0].get('delta', {}).get('content', '') - text += content # Збираємо дельти + text += content except json.JSONDecodeError as e: print(f"Error decoding JSON: {json_str}, Error: {e}") elif line.strip() == "[DONE]": |