diff options
author | abc <98614666+xtekky@users.noreply.github.com> | 2023-08-28 22:13:47 +0200 |
---|---|---|
committer | abc <98614666+xtekky@users.noreply.github.com> | 2023-08-28 22:13:47 +0200 |
commit | a4fe9907d613a6c81fb40491c7f3bfd766c7847f (patch) | |
tree | af96b0bb2618f2136b6570c49f26051dab66c95a /g4f | |
parent | ~ | v-0.0.2.6 (diff) | |
download | gpt4free-a4fe9907d613a6c81fb40491c7f3bfd766c7847f.tar gpt4free-a4fe9907d613a6c81fb40491c7f3bfd766c7847f.tar.gz gpt4free-a4fe9907d613a6c81fb40491c7f3bfd766c7847f.tar.bz2 gpt4free-a4fe9907d613a6c81fb40491c7f3bfd766c7847f.tar.lz gpt4free-a4fe9907d613a6c81fb40491c7f3bfd766c7847f.tar.xz gpt4free-a4fe9907d613a6c81fb40491c7f3bfd766c7847f.tar.zst gpt4free-a4fe9907d613a6c81fb40491c7f3bfd766c7847f.zip |
Diffstat (limited to 'g4f')
-rw-r--r-- | g4f/Provider/Bing.py | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/g4f/Provider/Bing.py b/g4f/Provider/Bing.py index 5910c6b4..c31ba5a7 100644 --- a/g4f/Provider/Bing.py +++ b/g4f/Provider/Bing.py @@ -15,9 +15,8 @@ class Bing(AsyncGeneratorProvider): def create_async_generator( model: str, messages: list[dict[str, str]], - cookies: dict = None, - **kwargs - ) -> AsyncGenerator: + cookies: dict = None, **kwargs) -> AsyncGenerator: + if not cookies: cookies = get_cookies(".bing.com") if len(messages) < 2: @@ -30,30 +29,31 @@ class Bing(AsyncGeneratorProvider): 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_dict = { - 'MUID': '', - 'BCP': '', - 'MUIDB': '', - 'USRLOC': '', - 'SRCHD': 'AF=hpcodx', - 'MMCASM': '', - '_UR': '', - 'ANON': '', - 'NAP': '', - 'ABDEF': '', - 'PPLState': '1', + 'MUID' : '', + 'BCP' : '', + 'MUIDB' : '', + 'USRLOC' : '', + 'SRCHD' : 'AF=hpcodx', + 'MMCASM' : '', + '_UR' : '', + 'ANON' : '', + 'NAP' : '', + 'ABDEF' : '', + 'PPLState' : '1', 'KievRPSSecAuth': '', - '_U': '', - 'SUID': '', - '_EDGE_S': '', - 'WLS': '', - '_HPVN': '', - '_SS': '', - '_clck': '', - 'SRCHUSR': '', - '_RwBf': '', - 'SRCHHPGUSR': '', - 'ipv6': '', + '_U' : '', + 'SUID' : '', + '_EDGE_S' : '', + 'WLS' : '', + '_HPVN' : '', + '_SS' : '', + '_clck' : '', + 'SRCHUSR' : '', + '_RwBf' : '', + 'SRCHHPGUSR' : '', + 'ipv6' : '', } + return stream_generate(prompt, context, cookies_dict) def create_context(messages: list[dict[str, str]]): |