summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Bing.py
diff options
context:
space:
mode:
authorTekky <98614666+xtekky@users.noreply.github.com>2023-09-05 15:26:08 +0200
committerGitHub <noreply@github.com>2023-09-05 15:26:08 +0200
commitae9702ecf05562f47fdcdc005a2a36124c6cc567 (patch)
tree5015b50c0e9f679aa2682d2064418d5473de9637 /g4f/Provider/Bing.py
parentMerge pull request #875 from Lin-jun-xiang/annotations (diff)
parentJoin the messages (diff)
downloadgpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.tar
gpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.tar.gz
gpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.tar.bz2
gpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.tar.lz
gpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.tar.xz
gpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.tar.zst
gpt4free-ae9702ecf05562f47fdcdc005a2a36124c6cc567.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/Bing.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/g4f/Provider/Bing.py b/g4f/Provider/Bing.py
index 57dfcec9..cec82108 100644
--- a/g4f/Provider/Bing.py
+++ b/g4f/Provider/Bing.py
@@ -48,10 +48,7 @@ class Bing(AsyncGeneratorProvider):
return stream_generate(prompt, context, cookies_dict)
def create_context(messages: list[dict[str, str]]):
- context = ""
-
- for message in messages:
- context += "[%s](#message)\n%s\n\n" % (message["role"], message["content"])
+ context = "".join(f"[{message['role']}](#message)\n{message['content']}\n\n" for message in messages)
return context