simplified random task generation

This commit is contained in:
Vechtomov
2023-01-05 22:50:51 +03:00
parent 3dbe0ae1ba
commit aafe93ff82
+8 -8
View File
@@ -24,14 +24,14 @@ def generate_task(
match request.type:
case protocol_schema.TaskRequestType.random:
logger.info("Frontend requested a random task.")
while request.type == protocol_schema.TaskRequestType.random:
disabled_tasks = (
protocol_schema.TaskRequestType.summarize_story,
protocol_schema.TaskRequestType.rate_summary,
)
request.type = random.choice(
tuple(set(protocol_schema.TaskRequestType).difference(disabled_tasks))
).value
disabled_tasks = (
protocol_schema.TaskRequestType.random,
protocol_schema.TaskRequestType.summarize_story,
protocol_schema.TaskRequestType.rate_summary,
)
request.type = random.choice(
tuple(set(protocol_schema.TaskRequestType).difference(disabled_tasks))
).value
return generate_task(request, pr)
# AKo: Summary tasks are currently disabled/supported, we focus on the conversation tasks.