From 9c5ead57b65ad8d236706fe1b1c7071f4440ab17 Mon Sep 17 00:00:00 2001 From: Bagus Indrayana Date: Tue, 11 Jul 2023 22:54:25 +0800 Subject: udate testing --- testing/binghuan/helpers/binghuan.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'testing/binghuan/helpers/binghuan.py') 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 = '') -- cgit v1.2.3