summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Bing.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-21 02:20:23 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-21 02:20:23 +0100
commit9cbe9c1ccb2381e37402a36297f11a0f96b1b557 (patch)
treed5c8f96e7a5b774c1a8af923f8346e1633a3d1f3 /g4f/Provider/Bing.py
parentFix permissions (diff)
downloadgpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.tar
gpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.tar.gz
gpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.tar.bz2
gpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.tar.lz
gpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.tar.xz
gpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.tar.zst
gpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/Bing.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/g4f/Provider/Bing.py b/g4f/Provider/Bing.py
index 34687866..b869a6ef 100644
--- a/g4f/Provider/Bing.py
+++ b/g4f/Provider/Bing.py
@@ -64,12 +64,7 @@ class Bing(AsyncGeneratorProvider):
prompt = messages[-1]["content"]
context = create_context(messages[:-1])
- if not cookies:
- cookies = Defaults.cookies
- else:
- for key, value in Defaults.cookies.items():
- if key not in cookies:
- cookies[key] = value
+ cookies = {**Defaults.cookies, **cookies} if cookies else Defaults.cookies
gpt4_turbo = True if model.startswith("gpt-4-turbo") else False
@@ -207,10 +202,12 @@ def create_message(
request_id = str(uuid.uuid4())
struct = {
'arguments': [{
- 'source': 'cib', 'optionsSets': options_sets,
+ 'source': 'cib',
+ 'optionsSets': options_sets,
'allowedMessageTypes': Defaults.allowedMessageTypes,
'sliceIds': Defaults.sliceIds,
- 'traceId': os.urandom(16).hex(), 'isStartOfSession': True,
+ 'traceId': os.urandom(16).hex(),
+ 'isStartOfSession': True,
'requestId': request_id,
'message': {
**Defaults.location,