diff options
author | Luneye <73485421+Luneye@users.noreply.github.com> | 2023-08-28 16:41:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-28 16:41:59 +0200 |
commit | a3851150b7b97cb7e9411f844634d6086473e837 (patch) | |
tree | e629881cbe6eae24b7ad9fd4a83ffc84aec1b974 /g4f/Provider/Bing.py | |
parent | Update Bing.py (diff) | |
download | gpt4free-a3851150b7b97cb7e9411f844634d6086473e837.tar gpt4free-a3851150b7b97cb7e9411f844634d6086473e837.tar.gz gpt4free-a3851150b7b97cb7e9411f844634d6086473e837.tar.bz2 gpt4free-a3851150b7b97cb7e9411f844634d6086473e837.tar.lz gpt4free-a3851150b7b97cb7e9411f844634d6086473e837.tar.xz gpt4free-a3851150b7b97cb7e9411f844634d6086473e837.tar.zst gpt4free-a3851150b7b97cb7e9411f844634d6086473e837.zip |
Diffstat (limited to 'g4f/Provider/Bing.py')
-rw-r--r-- | g4f/Provider/Bing.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/g4f/Provider/Bing.py b/g4f/Provider/Bing.py index 4c7e0557..d96af6a6 100644 --- a/g4f/Provider/Bing.py +++ b/g4f/Provider/Bing.py @@ -10,12 +10,13 @@ class Bing(AsyncGeneratorProvider): supports_gpt_4 = True working=True supports_stream=True + needs_auth=True @staticmethod def create_completion( model: str, messages: list[dict[str, str]], - cookies: dict = None, + cookies: dict, **kwargs ) -> AsyncGenerator: @@ -26,11 +27,11 @@ class Bing(AsyncGeneratorProvider): else: prompt = messages[-1]["content"] context = create_context(messages[:-1]) - if cookies is None: + + if cookies: #TODO: Will implement proper cookie retrieval later and use a try-except mechanism in 'stream_generate' instead of defaulting the cookie value like this - #cookies = get_cookies(".bing.com") - cookies = - { + #cookies_dict = get_cookies(".bing.com") + cookies_dict = { 'MUID': '', 'BCP': '', 'MUIDB': '', @@ -55,8 +56,7 @@ class Bing(AsyncGeneratorProvider): 'SRCHHPGUSR': '', 'ipv6': '', } - - return stream_generate(prompt, context, cookies) + return stream_generate(prompt, context, cookies_dict) def create_context(messages: list[dict[str, str]]): context = "" |