diff options
author | kqlio67 <kqlio67@users.noreply.github.com> | 2024-09-01 18:39:55 +0200 |
---|---|---|
committer | kqlio67 <kqlio67@users.noreply.github.com> | 2024-09-01 18:39:55 +0200 |
commit | aa265acf30bec0ea7a3f411e46da49dd05b383d0 (patch) | |
tree | 9b862fb2f5094ee8154e25eb6deb4e07ce956022 /g4f/Provider/not_working/Bestim.py | |
parent | Comprehensive Updates and Enhancements Across Multiple Providers (diff) | |
download | gpt4free-aa265acf30bec0ea7a3f411e46da49dd05b383d0.tar gpt4free-aa265acf30bec0ea7a3f411e46da49dd05b383d0.tar.gz gpt4free-aa265acf30bec0ea7a3f411e46da49dd05b383d0.tar.bz2 gpt4free-aa265acf30bec0ea7a3f411e46da49dd05b383d0.tar.lz gpt4free-aa265acf30bec0ea7a3f411e46da49dd05b383d0.tar.xz gpt4free-aa265acf30bec0ea7a3f411e46da49dd05b383d0.tar.zst gpt4free-aa265acf30bec0ea7a3f411e46da49dd05b383d0.zip |
Diffstat (limited to 'g4f/Provider/not_working/Bestim.py')
-rw-r--r-- | g4f/Provider/not_working/Bestim.py | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/g4f/Provider/not_working/Bestim.py b/g4f/Provider/not_working/Bestim.py deleted file mode 100644 index 94a4d32b..00000000 --- a/g4f/Provider/not_working/Bestim.py +++ /dev/null @@ -1,56 +0,0 @@ -from __future__ import annotations - -from ...typing import Messages -from ..base_provider import BaseProvider, CreateResult -from ...requests import get_session_from_browser -from uuid import uuid4 - -class Bestim(BaseProvider): - url = "https://chatgpt.bestim.org" - working = False - supports_gpt_35_turbo = True - supports_message_history = True - supports_stream = True - - @classmethod - def create_completion( - cls, - model: str, - messages: Messages, - stream: bool, - proxy: str = None, - **kwargs - ) -> CreateResult: - session = get_session_from_browser(cls.url, proxy=proxy) - headers = { - 'Accept': 'application/json, text/event-stream', - } - data = { - "messagesHistory": [{ - "id": str(uuid4()), - "content": m["content"], - "from": "you" if m["role"] == "user" else "bot" - } for m in messages], - "type": "chat", - } - response = session.post( - url="https://chatgpt.bestim.org/chat/send2/", - json=data, - headers=headers, - stream=True - ) - response.raise_for_status() - for line in response.iter_lines(): - if not line.startswith(b"event: trylimit"): - yield line.decode().removeprefix("data: ") - - - - - - - - - - - |