Fix handling failure to select default chat tools

Issue: chosen_io variable was accessed before initialization when
ValueError was raise.

Fix: Set chosen_io to fallback values on failure to select default
chat tools
This commit is contained in:
Debanjum
2025-08-14 18:04:08 -07:00
parent 7251b25c66
commit caf0b994e8

View File

@@ -995,7 +995,7 @@ async def event_generator(
)
except ValueError as e:
logger.error(f"Error getting data sources and output format: {e}. Falling back to default.")
conversation_commands = [ConversationCommand.General]
chosen_io = {"sources": [ConversationCommand.General], "output": ConversationCommand.Text}
conversation_commands = chosen_io.get("sources") + [chosen_io.get("output")]