diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-04-21 07:45:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-21 07:45:23 +0200 |
commit | 0f3935f1c068c723342153dd040e0e72e95aa11b (patch) | |
tree | c4d1e9c9eb2ebfe13e2679afe8a23d7ffa45fa46 /g4f/Provider/bing/conversation.py | |
parent | Merge pull request #1865 from hlohaus/carst (diff) | |
parent | Add MissingRequirementsError to You (diff) | |
download | gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.tar gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.tar.gz gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.tar.bz2 gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.tar.lz gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.tar.xz gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.tar.zst gpt4free-0f3935f1c068c723342153dd040e0e72e95aa11b.zip |
Diffstat (limited to 'g4f/Provider/bing/conversation.py')
-rw-r--r-- | g4f/Provider/bing/conversation.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/g4f/Provider/bing/conversation.py b/g4f/Provider/bing/conversation.py index 85292079..4cfeef8e 100644 --- a/g4f/Provider/bing/conversation.py +++ b/g4f/Provider/bing/conversation.py @@ -1,7 +1,6 @@ from __future__ import annotations -from aiohttp import ClientSession -from ...requests import raise_for_status +from ...requests import StreamSession, raise_for_status from ...errors import RateLimitError from ...providers.conversation import BaseConversation @@ -22,7 +21,7 @@ class Conversation(BaseConversation): self.clientId = clientId self.conversationSignature = conversationSignature -async def create_conversation(session: ClientSession, headers: dict, tone: str) -> Conversation: +async def create_conversation(session: StreamSession, headers: dict, tone: str) -> Conversation: """ Create a new conversation asynchronously. @@ -49,7 +48,7 @@ async def create_conversation(session: ClientSession, headers: dict, tone: str) raise RuntimeError('Empty fields: Failed to create conversation') return Conversation(conversationId, clientId, conversationSignature) -async def list_conversations(session: ClientSession) -> list: +async def list_conversations(session: StreamSession) -> list: """ List all conversations asynchronously. @@ -64,7 +63,7 @@ async def list_conversations(session: ClientSession) -> list: response = await response.json() return response["chats"] -async def delete_conversation(session: ClientSession, conversation: Conversation, headers: dict) -> bool: +async def delete_conversation(session: StreamSession, conversation: Conversation, headers: dict) -> bool: """ Delete a conversation asynchronously. |