Fixed bad topic list generation
This commit is contained in:
parent
d8800164cb
commit
ccb9d7e504
5
app.py
5
app.py
@ -96,6 +96,11 @@ def get_random_topic() -> str:
|
||||
)
|
||||
|
||||
topics = completion.choices[0].message.content.split(",")
|
||||
|
||||
if len(topics) < 5:
|
||||
logging.info(f"The topics is too short: {topics}. Retrying...")
|
||||
return get_random_topic()
|
||||
|
||||
logging.info(f"The topics list is: {topics}")
|
||||
topic = random.choice(topics)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user