XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

~ | v-0.0.2.6

a4fe9907
abc <98614666+xtekky@users.noreply.github.com>
提交于

代码差异

1 个文件 +25 -25
Modified g4f/Provider/Bing.py +25 -25
@@ -15,9 +15,8 @@ class Bing(AsyncGeneratorProvider):
15 15 def create_async_generator(
16 16 model: str,
17 17 messages: list[dict[str, str]],
18 cookies: dict = None,
19 **kwargs
20 ) -> AsyncGenerator:
18 cookies: dict = None, **kwargs) -> AsyncGenerator:
19
21 20 if not cookies:
22 21 cookies = get_cookies(".bing.com")
23 22 if len(messages) < 2:
@@ -30,30 +29,31 @@ class Bing(AsyncGeneratorProvider):
30 29 if cookies:
31 30 #TODO: Will implement proper cookie retrieval later and use a try-except mechanism in 'stream_generate' instead of defaulting the cookie value like this
32 31 cookies_dict = {
33 'MUID': '',
34 'BCP': '',
35 'MUIDB': '',
36 'USRLOC': '',
37 'SRCHD': 'AF=hpcodx',
38 'MMCASM': '',
39 '_UR': '',
40 'ANON': '',
41 'NAP': '',
42 'ABDEF': '',
43 'PPLState': '1',
32 'MUID' : '',
33 'BCP' : '',
34 'MUIDB' : '',
35 'USRLOC' : '',
36 'SRCHD' : 'AF=hpcodx',
37 'MMCASM' : '',
38 '_UR' : '',
39 'ANON' : '',
40 'NAP' : '',
41 'ABDEF' : '',
42 'PPLState' : '1',
44 43 'KievRPSSecAuth': '',
45 '_U': '',
46 'SUID': '',
47 '_EDGE_S': '',
48 'WLS': '',
49 '_HPVN': '',
50 '_SS': '',
51 '_clck': '',
52 'SRCHUSR': '',
53 '_RwBf': '',
54 'SRCHHPGUSR': '',
55 'ipv6': '',
44 '_U' : '',
45 'SUID' : '',
46 '_EDGE_S' : '',
47 'WLS' : '',
48 '_HPVN' : '',
49 '_SS' : '',
50 '_clck' : '',
51 'SRCHUSR' : '',
52 '_RwBf' : '',
53 'SRCHHPGUSR' : '',
54 'ipv6' : '',
56 55 }
56
57 57 return stream_generate(prompt, context, cookies_dict)
58 58
59 59 def create_context(messages: list[dict[str, str]]):