1
0
Fork 0
GPT4FREE/openai_rev/you
2023-04-27 20:48:00 -04:00
..
__pycache__ merged pr #218 with the new streamlit 2023-04-27 20:48:00 -04:00
__init__.py added main module for accessing all services 2023-04-28 00:40:43 +05:30
README.md added main module for accessing all services 2023-04-28 00:40:43 +05:30

Example: you (use like openai pypi package)


from openai_rev import you

# simple request with links and details
response = you.Completion.create(
    prompt="hello world",
    detailed=True,
    include_links=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"]})