Skip to content

Commit

Permalink
add openaihosted testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ezerinz committed Apr 28, 2023
1 parent 8fe493a commit f95ace3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions testing/openaihosted_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import openaihosted

messages = [{"role": "system", "content": "You are a helpful assistant."}]
while True:
question = input("Question: ")
if question == "!stop":
break

messages.append({"role": "user", "content": question})
request = openaihosted.Completion.create(messages=messages)

response = request["responses"]
messages.append({"role": "assistant", "content": response})
print(f"Answer: {response}")

0 comments on commit f95ace3

Please sign in to comment.