summaryrefslogtreecommitdiffstats
path: root/g4f/Provider
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-09 19:19:33 +0200
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-04-09 19:19:33 +0200
commit90715e702bbebcf2c3cfd39628c931bbadda28b0 (patch)
treef574bae75b22ee59e5c60e2f6f4017338614fd8c /g4f/Provider
parentAdd async client docs (diff)
downloadgpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.tar
gpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.tar.gz
gpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.tar.bz2
gpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.tar.lz
gpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.tar.xz
gpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.tar.zst
gpt4free-90715e702bbebcf2c3cfd39628c931bbadda28b0.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/Bing.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/g4f/Provider/Bing.py b/g4f/Provider/Bing.py
index aa1b37b0..1e462084 100644
--- a/g4f/Provider/Bing.py
+++ b/g4f/Provider/Bing.py
@@ -46,6 +46,7 @@ class Bing(AsyncGeneratorProvider, ProviderModelMixin):
messages: Messages,
proxy: str = None,
timeout: int = 900,
+ api_key: str = None,
cookies: Cookies = None,
connector: BaseConnector = None,
tone: str = None,
@@ -68,6 +69,8 @@ class Bing(AsyncGeneratorProvider, ProviderModelMixin):
:return: An asynchronous result object.
"""
prompt = messages[-1]["content"]
+ if api_key is not None:
+ cookies["_U"] = api_key
if context is None:
context = create_context(messages[:-1]) if len(messages) > 1 else None
if tone is None: