Reference
GenerateReplyOptions
Per-reply user input, instructions, tools, and input modality.
GenerateReplyOptions configures a single reply from
AgentSession.GenerateReply. Everything here is scoped to one reply — it
does not change the agent.
func (s *AgentSession) GenerateReply(opts GenerateReplyOptions) (*SpeechHandle, error)Fields
| Field | Type | Notes |
|---|---|---|
UserInput | string | Appended to history as a user message before generating. |
Instructions | Instructions | Extra system message for this reply only, on top of the agent's base instructions. String or *llm.Instructions. |
Tools | []string | Restrict this reply to a subset of the agent's tools, by tool ID (the function name). Unknown names fail the reply. |
ToolChoice | any | Override tool-choice for this reply (nil = auto). |
AllowInterruptions | *bool | Override interruptibility for this reply. |
Priority | *int | Override scheduling priority. |
InputModality | string | InputModalityText or InputModalityAudio — selects the instruction variant. Empty uses the agent default (audio). |
Per-reply instructions
Instructions layers on top of the agent's base instructions for this reply
only — the agent's persona is unchanged on the next turn:
h, err := session.GenerateReply(agents.GenerateReplyOptions{
Instructions: "Answer in one sentence, no jargon.",
UserInput: "What is endpointing?",
})See the guide: Per-reply instructions.
Restricting tools for one reply
session.GenerateReply(agents.GenerateReplyOptions{
Tools: []string{"get_weather"}, // only this tool is available this reply
})Return value
GenerateReply returns a *SpeechHandle immediately; the reply plays
asynchronously. Wait for it with handle.WaitForPlayout(ctx), or use
session.Run which wraps generate-and-wait and returns a RunResult.