Interface: GenerateResult
@providerprotocol/agents / index / GenerateResult
Interface: GenerateResult
Section titled “Interface: 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).
Example
Section titled “Example”const result = await agent.generate('What is the weather?');console.log(result.turn.response.text); // Model's responseconsole.log(result.state.currentStep); // Execution step countProperties
Section titled “Properties”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