返回提交历史
Modified
testing/binghuan/helpers/binghuan.py
+10
-1
Modified
testing/binghuan/testing.py
+4
-4
XFEstudio/gpt4free
udate testing
9c5ead57
代码差异
2 个文件
+14
-5
@@ -196,8 +196,17 @@ class AsyncCompletion:
196
196
197
197
await wss.close()
198
198
199
# i thing bing realy donset understand multi message (based on prompt template)
200
def convert(messages):
201
context = ""
202
for message in messages:
203
context += "[%s](#message)\n%s\n\n" % (message['role'],
204
message['content'])
205
return context
206
199
207
async def run(optionSets, messages):
200
async for value in AsyncCompletion.create(prompt=messages[-1]['content'],
208
prompt = convert(messages)
209
async for value in AsyncCompletion.create(prompt=prompt,
201
210
optionSets=optionSets):
202
211
203
212
print(value, flush=True, end = '')
@@ -2,7 +2,7 @@ from BingHuan import ChatCompletion
2
2
3
3
# Test 1
4
4
response = ChatCompletion.create(model="gpt-3.5-turbo",
5
provider="Wewordle",
5
provider="BingHuan",
6
6
stream=False,
7
7
messages=[{'role': 'user', 'content': 'who are you?'}])
8
8
@@ -10,7 +10,7 @@ print(response)
10
10
11
11
# Test 2
12
12
response = ChatCompletion.create(model="gpt-3.5-turbo",
13
provider="Wewordle",
13
provider="BingHuan",
14
14
stream=False,
15
15
messages=[{'role': 'user', 'content': 'what you can do?'}])
16
16
@@ -18,8 +18,8 @@ print(response)
18
18
19
19
20
20
# Test 3
21
response = ChatCompletion.create(model="gpt-3.5-turbo",
22
provider="Wewordle",
21
response = ChatCompletion.create(model="gpt-4",
22
provider="BingHuan",
23
23
stream=False,
24
24
messages=[
25
25
{'role': 'user', 'content': 'now your name is Bob'},