summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Bing.py
diff options
context:
space:
mode:
Diffstat (limited to 'g4f/Provider/Bing.py')
-rw-r--r--g4f/Provider/Bing.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/g4f/Provider/Bing.py b/g4f/Provider/Bing.py
index fe4f9a58..84be4212 100644
--- a/g4f/Provider/Bing.py
+++ b/g4f/Provider/Bing.py
@@ -15,8 +15,11 @@ class Bing(AsyncGeneratorProvider):
def create_async_generator(
model: str,
messages: list[dict[str, str]],
- cookies: dict = get_cookies(".bing.com"), **kwargs) -> AsyncGenerator:
-
+ cookies: dict = None,
+ **kwargs
+ ) -> AsyncGenerator:
+ if not cookies:
+ cookies = get_cookies(".bing.com")
if len(messages) < 2:
prompt = messages[0]["content"]
context = None
@@ -273,15 +276,4 @@ async def stream_generate(
final = True
break
finally:
- await delete_conversation(session, conversation)
-
-def run(generator: AsyncGenerator[Union[Any, str], Any]):
- loop = asyncio.get_event_loop()
- gen = generator.__aiter__()
-
- while True:
- try:
- yield loop.run_until_complete(gen.__anext__())
-
- except StopAsyncIteration:
- break
+ await delete_conversation(session, conversation) \ No newline at end of file