diff options
Diffstat (limited to 'testing/binghuan/helpers')
-rw-r--r-- | testing/binghuan/helpers/binghuan.py | 11 |
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 = '') |