you.com api (gpt 3.5 + internet)

This commit is contained in:
t.me/xtekky
2023-04-10 01:03:55 +02:00
parent 5ec02f8a00
commit 633bcd81d7
3 changed files with 153 additions and 4 deletions

32
testing/you_test.py Normal file
View File

@@ -0,0 +1,32 @@
import you
# simple request with links and details
response = you.Completion.create(
prompt = "hello world",
detailed = True,
includelinks = True,)
print(response)
# {
# "response": "...",
# "links": [...],
# "extra": {...},
# "slots": {...}
# }
# }
#chatbot
chat = []
while True:
prompt = input("You: ")
response = you.Completion.create(
prompt = prompt,
chat = chat)
print("Bot:", response["response"])
chat.append({"question": prompt, "answer": response["response"]})