diff options
author | Bagus Indrayana <bagusindrayanaindo@gmail.com> | 2023-07-11 16:54:25 +0200 |
---|---|---|
committer | Bagus Indrayana <bagusindrayanaindo@gmail.com> | 2023-07-11 16:54:25 +0200 |
commit | 9c5ead57b65ad8d236706fe1b1c7071f4440ab17 (patch) | |
tree | e8297dff00497186621903ae5b37f91a374b4e51 | |
parent | add testing (diff) | |
download | gpt4free-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 |
-rw-r--r-- | testing/binghuan/helpers/binghuan.py | 11 | ||||
-rw-r--r-- | testing/binghuan/testing.py | 8 |
2 files changed, 14 insertions, 5 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 = '') diff --git a/testing/binghuan/testing.py b/testing/binghuan/testing.py index e03c598d..d10b0e96 100644 --- a/testing/binghuan/testing.py +++ b/testing/binghuan/testing.py @@ -2,7 +2,7 @@ from BingHuan import ChatCompletion # Test 1 response = ChatCompletion.create(model="gpt-3.5-turbo", - provider="Wewordle", + provider="BingHuan", stream=False, messages=[{'role': 'user', 'content': 'who are you?'}]) @@ -10,7 +10,7 @@ print(response) # Test 2 response = ChatCompletion.create(model="gpt-3.5-turbo", - provider="Wewordle", + provider="BingHuan", stream=False, messages=[{'role': 'user', 'content': 'what you can do?'}]) @@ -18,8 +18,8 @@ print(response) # Test 3 -response = ChatCompletion.create(model="gpt-3.5-turbo", - provider="Wewordle", +response = ChatCompletion.create(model="gpt-4", + provider="BingHuan", stream=False, messages=[ {'role': 'user', 'content': 'now your name is Bob'}, |