summaryrefslogtreecommitdiffstats
path: root/testing/binghuan/helpers/binghuan.py
diff options
context:
space:
mode:
authorBagus Indrayana <bagusindrayanaindo@gmail.com>2023-07-11 16:54:25 +0200
committerBagus Indrayana <bagusindrayanaindo@gmail.com>2023-07-11 16:54:25 +0200
commit9c5ead57b65ad8d236706fe1b1c7071f4440ab17 (patch)
treee8297dff00497186621903ae5b37f91a374b4e51 /testing/binghuan/helpers/binghuan.py
parentadd testing (diff)
downloadgpt4free-9c5ead57b65ad8d236706fe1b1c7071f4440ab17.tar
gpt4free-9c5ead57b65ad8d236706fe1b1c7071f4440ab17.tar.gz
gpt4free-9c5ead57b65ad8d236706fe1b1c7071f4440ab17.tar.bz2
gpt4free-9c5ead57b65ad8d236706fe1b1c7071f4440ab17.tar.lz
gpt4free-9c5ead57b65ad8d236706fe1b1c7071f4440ab17.tar.xz
gpt4free-9c5ead57b65ad8d236706fe1b1c7071f4440ab17.tar.zst
gpt4free-9c5ead57b65ad8d236706fe1b1c7071f4440ab17.zip
Diffstat (limited to 'testing/binghuan/helpers/binghuan.py')
-rw-r--r--testing/binghuan/helpers/binghuan.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/testing/binghuan/helpers/binghuan.py b/testing/binghuan/helpers/binghuan.py
index 56762ef3..ad3f7ff7 100644
--- a/testing/binghuan/helpers/binghuan.py
+++ b/testing/binghuan/helpers/binghuan.py
@@ -196,8 +196,17 @@ class AsyncCompletion:
await wss.close()
+# i thing bing realy donset understand multi message (based on prompt template)
+def convert(messages):
+ context = ""
+ for message in messages:
+ context += "[%s](#message)\n%s\n\n" % (message['role'],
+ message['content'])
+ return context
+
async def run(optionSets, messages):
- async for value in AsyncCompletion.create(prompt=messages[-1]['content'],
+ prompt = convert(messages)
+ async for value in AsyncCompletion.create(prompt=prompt,
optionSets=optionSets):
print(value, flush=True, end = '')