diff options
author | Heiner Lohaus <heiner.lohaus@netformic.com> | 2023-08-28 01:43:45 +0200 |
---|---|---|
committer | Heiner Lohaus <heiner.lohaus@netformic.com> | 2023-08-28 01:43:45 +0200 |
commit | 7294abc890c377d75c6c8c932620c2e2c8b3f0f9 (patch) | |
tree | f7d411570c71f5d225430d067ad64b620bb0d704 /g4f/Provider/Bing.py | |
parent | ~ | code styling (diff) | |
download | gpt4free-7294abc890c377d75c6c8c932620c2e2c8b3f0f9.tar gpt4free-7294abc890c377d75c6c8c932620c2e2c8b3f0f9.tar.gz gpt4free-7294abc890c377d75c6c8c932620c2e2c8b3f0f9.tar.bz2 gpt4free-7294abc890c377d75c6c8c932620c2e2c8b3f0f9.tar.lz gpt4free-7294abc890c377d75c6c8c932620c2e2c8b3f0f9.tar.xz gpt4free-7294abc890c377d75c6c8c932620c2e2c8b3f0f9.tar.zst gpt4free-7294abc890c377d75c6c8c932620c2e2c8b3f0f9.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/Provider/Bing.py | 20 |
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 |