1
0
Fork 0

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 ```python
import usesless import usesless
question1 = "Who won the world series in 2020?" message_id = ""
req = usesless.Completion.create(prompt=question1) while True:
answer = req["text"] prompt = input("Question: ")
message_id = req["parentMessageId"] if prompt == "!stop":
break
question2 = "Where was it played?" req = usesless.Completion.create(prompt=prompt, parentMessageId=message_id)
req2 = usesless.Completion.create(prompt=question2, parentMessageId=message_id)
answer2 = req2["text"]
print(answer) print(f"Answer: {req['text']}")
print(answer2) message_id = req["id"]
``` ```