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.py50
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]]):