agents-go
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

FieldTypeNotes
UserInputstringAppended to history as a user message before generating.
InstructionsInstructionsExtra system message for this reply only, on top of the agent's base instructions. String or *llm.Instructions.
Tools[]stringRestrict this reply to a subset of the agent's tools, by tool ID (the function name). Unknown names fail the reply.
ToolChoiceanyOverride tool-choice for this reply (nil = auto).
AllowInterruptions*boolOverride interruptibility for this reply.
Priority*intOverride scheduling priority.
InputModalitystringInputModalityText 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.

On this page