Improved logging

This commit is contained in:
Roger Gonzalez 2023-05-13 22:50:13 -03:00
parent ca74e03ba7
commit aa4aeb8e21
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6

3
app.py
View File

@ -124,6 +124,8 @@ def get_chatgpt_html_response(message: str) -> str:
None
"""
logging.info(f"The topic to generate is {message}")
try:
completion = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
@ -158,7 +160,6 @@ def index():
@app.route("/start")
def start():
random_topic = get_random_topic()
logging.info(f"The random topic is {random_topic}")
return get_chatgpt_html_response(random_topic)