MCPcopy Create free account
hub / github.com/livekit/agents / parse_value

Function parse_value

examples/inference/agent.py:63–68  ·  view source on GitHub ↗
(payload: str, fallback: str)

Source from the content-addressed store, hash-verified

61 )
62
63 def parse_value(payload: str, fallback: str) -> str:
64 try:
65 v = json.loads(payload).get("value")
66 return v if isinstance(v, str) and v else fallback
67 except Exception:
68 return fallback
69
70 agent = InferenceAgent()
71 await session.start(agent=agent, room=ctx.room)

Callers 4

set_stt_modelFunction · 0.85
set_llm_modelFunction · 0.85
set_tts_modelFunction · 0.85
set_system_promptFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected