Added minimal reference example
This commit is contained in:
parent
b319776c99
commit
91124a9b4b
@ -251,8 +251,136 @@ AGENT_DESCRIPTION = "Minimal bot with configurable audio/video generation modes"
|
|||||||
|
|
||||||
def agent_info() -> Dict[str, str]:
|
def agent_info() -> Dict[str, str]:
|
||||||
"""Return agent metadata for discovery."""
|
"""Return agent metadata for discovery."""
|
||||||
return {"name": AGENT_NAME, "description": AGENT_DESCRIPTION}
|
return {
|
||||||
|
"name": AGENT_NAME,
|
||||||
|
"description": AGENT_DESCRIPTION,
|
||||||
|
"has_media": "true",
|
||||||
|
"configurable": "true"
|
||||||
|
}
|
||||||
|
|
||||||
def create_agent_tracks(session_name: str) -> Dict[str, MediaStreamTrack]:
|
|
||||||
"""Factory wrapper used by the FastAPI service to instantiate tracks for an agent."""
|
def get_config_schema() -> Dict[str, Any]:
|
||||||
return create_minimal_bot_tracks(session_name)
|
"""Get the configuration schema for the Minimal Configurable Bot.
|
||||||
|
|
||||||
|
Returns a schema that defines all configurable parameters for the bot,
|
||||||
|
allowing frontend applications to dynamically generate configuration UIs.
|
||||||
|
"""
|
||||||
|
return {
|
||||||
|
"bot_name": AGENT_NAME,
|
||||||
|
"version": "1.0",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "visualization",
|
||||||
|
"type": "select",
|
||||||
|
"label": "Video Visualization Mode",
|
||||||
|
"description": "Choose the type of video visualization to display",
|
||||||
|
"default_value": "ball",
|
||||||
|
"required": True,
|
||||||
|
"options": [
|
||||||
|
{"value": "ball", "label": "Bouncing Ball"},
|
||||||
|
{"value": "waveform", "label": "Sine Wave Animation"},
|
||||||
|
{"value": "static", "label": "Static Color Frame"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "audio_mode",
|
||||||
|
"type": "select",
|
||||||
|
"label": "Audio Generation Mode",
|
||||||
|
"description": "Choose the type of audio to generate",
|
||||||
|
"default_value": "tone",
|
||||||
|
"required": True,
|
||||||
|
"options": [
|
||||||
|
{"value": "tone", "label": "Sine Wave Tone"},
|
||||||
|
{"value": "noise", "label": "White Noise"},
|
||||||
|
{"value": "silence", "label": "Silence"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "width",
|
||||||
|
"type": "number",
|
||||||
|
"label": "Video Width",
|
||||||
|
"description": "Width of the video frame in pixels",
|
||||||
|
"default_value": 320,
|
||||||
|
"required": False,
|
||||||
|
"min_value": 160,
|
||||||
|
"max_value": 1920,
|
||||||
|
"step": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "height",
|
||||||
|
"type": "number",
|
||||||
|
"label": "Video Height",
|
||||||
|
"description": "Height of the video frame in pixels",
|
||||||
|
"default_value": 240,
|
||||||
|
"required": False,
|
||||||
|
"min_value": 120,
|
||||||
|
"max_value": 1080,
|
||||||
|
"step": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fps",
|
||||||
|
"type": "number",
|
||||||
|
"label": "Frames Per Second",
|
||||||
|
"description": "Video frame rate",
|
||||||
|
"default_value": 15,
|
||||||
|
"required": False,
|
||||||
|
"min_value": 1,
|
||||||
|
"max_value": 60,
|
||||||
|
"step": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sample_rate",
|
||||||
|
"type": "number",
|
||||||
|
"label": "Audio Sample Rate",
|
||||||
|
"description": "Audio sample rate in Hz",
|
||||||
|
"default_value": 48000,
|
||||||
|
"required": False,
|
||||||
|
"min_value": 8000,
|
||||||
|
"max_value": 96000,
|
||||||
|
"step": 1000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "frequency",
|
||||||
|
"type": "number",
|
||||||
|
"label": "Audio Frequency (Hz)",
|
||||||
|
"description": "Frequency of the generated tone in Hz",
|
||||||
|
"default_value": 440.0,
|
||||||
|
"required": False,
|
||||||
|
"min_value": 20.0,
|
||||||
|
"max_value": 20000.0,
|
||||||
|
"step": 1.0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "volume",
|
||||||
|
"type": "range",
|
||||||
|
"label": "Audio Volume",
|
||||||
|
"description": "Volume level (0.0 to 1.0)",
|
||||||
|
"default_value": 0.5,
|
||||||
|
"required": False,
|
||||||
|
"min_value": 0.0,
|
||||||
|
"max_value": 1.0,
|
||||||
|
"step": 0.1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "static_color",
|
||||||
|
"type": "string",
|
||||||
|
"label": "Static Color (RGB)",
|
||||||
|
"description": "RGB color tuple for static mode (e.g., '128,128,128')",
|
||||||
|
"default_value": "128,128,128",
|
||||||
|
"required": False,
|
||||||
|
"pattern": r"^\d{1,3},\d{1,3},\d{1,3}$",
|
||||||
|
"max_length": 11
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
{
|
||||||
|
"Video Settings": ["visualization", "width", "height", "fps"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Audio Settings": ["audio_mode", "sample_rate", "frequency", "volume"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Advanced": ["static_color"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user