summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Bing.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-01-21 09:37:35 +0100
committerGitHub <noreply@github.com>2024-01-21 09:37:35 +0100
commitfea4f546a7fb7c7af5a3da2247b5ea966e179f08 (patch)
tree59266fc31ec6df5fa53ef97b22f024f2f3f339f8 /g4f/Provider/Bing.py
parentMerge pull request #1484 from hlohaus/copilot (diff)
parentUpdate workflow (diff)
downloadgpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.tar
gpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.tar.gz
gpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.tar.bz2
gpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.tar.lz
gpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.tar.xz
gpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.tar.zst
gpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.zip
Diffstat (limited to 'g4f/Provider/Bing.py')
-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,