Modality-aware instructions
Status: partial.
Use modality-aware instructions when a provider path needs different guidance for audio and text.
Most agents can use a single instruction string through AppConfig.Instructions or agent.NewAgent(instructions). Use llm.NewInstructions(audio, text...) only when the model path consumes instruction variants.
Choosing the right instruction API
- Use
AppConfig.Instructionsfor app-wide defaults. - Use
Agent.UpdateInstructionswhen the active agent needs a new baseline. - Use
GenerateReplyOptions.Instructionsfor one reply. - Use
llm.NewInstructions(audio, text...)for paths that distinguish spoken and text behavior.
Keep voice instructions short and concrete. The basic agent constrains spoken output by asking for concise responses and avoiding markdown or special characters.
Evidence:
core/llm/llm.gocore/agent/agent.gocore/agent/agent_activity.goexamples/voice_agents/basic_agent/basicagent/basic_agent.go