Skip to content

Interface: GenerateResult

@providerprotocol/agents


@providerprotocol/agents / index / GenerateResult

Defined in: src/execution/types.ts:28

Result of agent generation containing the conversation turn and updated state.

This is the primary return type from agent execution methods. It combines the standard UPP Turn (which contains the model’s response and token usage) with the UAP AgentState (which tracks the full execution context).

const result = await agent.generate('What is the weather?');
console.log(result.turn.response.text); // Model's response
console.log(result.state.currentStep); // Execution step count

state: AgentState

Defined in: src/execution/types.ts:32

New immutable state reflecting all changes from this generation


turn: Turn

Defined in: src/execution/types.ts:30

Standard UPP Turn containing the model response, messages, and token usage