1
0
Fork 0
GPT4FREE/you/README.md

36 lines
632 B
Markdown
Raw Normal View History

2023-04-22 12:54:01 +00:00
### Example: `you` (use like openai pypi package) <a name="example-you"></a>
```python
import you
# simple request with links and details
response = you.Completion.create(
prompt="hello world",
detailed=True,
include_links=True, )
2023-04-22 12:54:01 +00:00
print(response)
# {
# "response": "...",
# "links": [...],
# "extra": {...},
# "slots": {...}
# }
# }
# chatbot
2023-04-22 12:54:01 +00:00
chat = []
while True:
prompt = input("You: ")
2023-04-22 12:54:01 +00:00
response = you.Completion.create(
prompt=prompt,
chat=chat)
2023-04-22 12:54:01 +00:00
print("Bot:", response["response"])
2023-04-22 12:54:01 +00:00
chat.append({"question": prompt, "answer": response["response"]})
```