allow new instruction even if there's no insights

This commit is contained in:
Yizhou Chi 2024-09-06 17:02:49 +08:00
parent 6d40ec463f
commit 376d1b7661

View file

@ -85,8 +85,12 @@ class InstructionGenerator:
if len(data) == 0:
mcts_logger.log("MCTS", f"No insights available for task {task_id}")
return [original_instruction] # Return the original instruction if no insights are available
for item in data[:max_num]:
insights = item["Analysis"]
for i in range(max_num):
if len(data) == 0:
insights = "No insights available"
else:
item = data[i]
insights = item["Analysis"]
new_instruction = await InstructionGenerator.generate_new_instruction(original_instruction, insights)
new_instructions.append(new_instruction)
return new_instructions