examples(inference): editable system prompt + "Open in Builder" + Sonic-3 / 4.1-mini defaults#5776
Conversation
…ic-3 / 4.1-mini defaults Adds a `set_system_prompt` RPC to the inference agent so the Playground textarea can rewrite the agent's instructions live (deduped against the current value to avoid logspam on every keystroke). The YAML gains a `textarea` system-prompt control, a `link`-type "Open in Builder" CTA that deep-links into Cloud Builder with the current prompt + STT/LLM/TTS preserved as URL params, and a `transcript` view source. Defaults bumped to `cartesia/sonic-3` and `openai/gpt-4.1-mini` in both the YAML and the agent's DEFAULT_* constants, with the seed prompt aligned between INSTRUCTIONS and the textarea default so first-session behavior matches what the user sees in the UI. Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
| - rpc: open_in_builder | ||
| type: link | ||
| label: "Open in Builder \u2192" | ||
| primary: true | ||
| href_template: "https://cloud.livekit.io/projects/p_/agents/builder/new?modelMode=pipeline&instructions={inference/set_system_prompt}&llm={inference/set_llm_model}&stt={inference/set_stt_model}&tts={inference/set_tts_model}" |
There was a problem hiding this comment.
Should this be an RPC? And it open the URL that the agent is returning?
So you don't need any template
Replaces the frontend's `href_template` substitution with an `open_in_builder` RPC the agent answers with the fully-built URL. The agent already knows its current instructions, llm, stt and tts model strings — so the templating + URL-encoding belongs there rather than in the wasm frontend. Drops `href_template` from the YAML and updates the `type: link` docs to reflect the new "fire RPC → open returned URL" semantics. Per Theo's review on #5776. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Done in ac54637 (agents) + livekit/agents-jukebox#10 343c8a6 (jukebox).
One bit of glue: |
Summary
Turns the Inference example into a lightweight agent-builder playground that pairs with the corresponding Jukebox PR (livekit/agents-jukebox#TODO).
set_system_promptRPC that rewritesagent.instructionslive. Deduped against the current value so the per-keystroke fires from the frontend don't spamupdate_instructions.type: linkcontrol in the YAML with anhref_templatethat opens Cloud Builder pre-populated with the currentinstructions(URL-encoded),llm,stt,tts, andmodelMode=pipeline.project_idis thep_placeholder so Cloud routes through login when needed and preserves the params on redirect.views[].source: transcriptentry; the Jukebox frontend renders LiveKitTranscriptionReceivedsegments into the existing view-card slot — no agent-side push needed.cartesia/sonic-2→cartesia/sonic-3,openai/gpt-4o-mini→openai/gpt-4.1-mini, both inplayground.yamland the agent'sDEFAULT_*constants. SeedINSTRUCTIONSaligned with the textarea'sdefaultso the first session matches what the user sees before any edit.YAML schema also picks up doc comments for the new
textarea/linkcontrol types and thetranscriptview source — the Jukebox PR has the corresponding parser + renderer changes.Test plan
cd examples/inference && python agent.py dev— connect via Jukebox playground; verify prompt edits land (system prompt updated (N chars)in agent logs) and the agent's behaviour changes within a turn.instructions,llm,stt,tts, andmodelMode=pipelinematching the current Playground state.Made with Cursor