1
0
Fork 0
GPT4FREE/testing/you_test.py

28 lines
509 B
Python
Raw Normal View History

2023-04-29 09:25:24 +00:00
from gpt4free import you
2023-04-09 23:03:55 +00:00
# simple request with links and details
response = you.Completion.create(prompt="hello world", detailed=True, include_links=True)
2023-04-09 23:03:55 +00:00
print(response)
# {
# "response": "...",
# "links": [...],
# "extra": {...},
# "slots": {...}
# }
# }
# chatbot
2023-04-09 23:03:55 +00:00
chat = []
while True:
prompt = input("You: ")
response = you.Completion.create(prompt=prompt, chat=chat)
2023-04-29 09:25:24 +00:00
print("Bot:", response.text)
2023-04-29 09:25:24 +00:00
chat.append({"question": prompt, "answer": response.text})