-
Notifications
You must be signed in to change notification settings - Fork 0
Add validation for required character fields in agent.py #6
Copy link
Copy link
Open
Description
Description
The agent.py file accesses character["prompt"] and character["name"] directly without validation (around lines 146-148). If these fields are missing from the character object retrieved from Convex, a KeyError will be raised at runtime.
Location
- File:
apps/live/src/agent.py - Lines: ~146-148 (and similar usage throughout the file)
Problem
Currently, the code validates voiceId but does not validate other required fields like name and prompt before using them in the Template rendering.
Suggested Approach
Add validation after retrieving the character object to ensure required fields (name, prompt) are present and non-empty, similar to the existing voiceId validation.
References
- PR: Features/multiple tts providers #3
- Comment: Features/multiple tts providers #3 (comment)
- Requested by: @eswaldots
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels