Update example

This commit is contained in:
ezerinz 2023-04-30 15:05:51 +08:00
parent 8a76728343
commit 3b13c3df92
No known key found for this signature in database
GPG Key ID: 8713BDED6DE33C4D

View File

@ -10,15 +10,14 @@ to do:
```python
import usesless
question1 = "Who won the world series in 2020?"
req = usesless.Completion.create(prompt=question1)
answer = req["text"]
message_id = req["parentMessageId"]
message_id = ""
while True:
prompt = input("Question: ")
if prompt == "!stop":
break
question2 = "Where was it played?"
req2 = usesless.Completion.create(prompt=question2, parentMessageId=message_id)
answer2 = req2["text"]
req = usesless.Completion.create(prompt=prompt, parentMessageId=message_id)
print(answer)
print(answer2)
print(f"Answer: {req['text']}")
message_id = req["id"]
```