GeneratesText
trait GeneratesText
Traits
Methods
Get the tool approval to resume with, unless a faked agent has no paused approval to resume.
Replace another provider's raw paused-turn replay state with its generic mapping, since raw blocks are only valid verbatim on the provider that produced them.
Determine whether the prompt is a resume that runs the approved tools.
Get a callback that captures a resume's resolved approval results for its completion event.
Resolve the tools for the given prompt, wrapping any agent instances as tools.
Get the tools the agent declares, including the tool that loads its skills.
Resolve a tool returned by the agent into a native tool instance when needed.
Build the run's context, letting a remembered conversation claim and record the approval decisions the run resumes.
Build the context that identifies this run and reports its step and tool events.
Dispatch the terminal failure event for a run, unless the caller may still retry it against another provider.
Throw when a pause has surfaced on a prompt that cannot be resumed from persisted or replayed history.
Details
in
ResumesToolApprovals at line 26
protected array|null
resumableApprovalFor(AgentPrompt $prompt, array $messages, array $tools)
Get the tool approval to resume with, unless a faked agent has no paused approval to resume.
in
ResumesToolApprovals at line 37
protected array
withoutForeignReplayBlocks(array $messages)
Replace another provider's raw paused-turn replay state with its generic mapping, since raw blocks are only valid verbatim on the provider that produced them.
in
ResumesToolApprovals at line 57
protected bool
resumesApproval(AgentPrompt $prompt, array $messages, array $tools)
Determine whether the prompt is a resume that runs the approved tools.
in
ResumesToolApprovals at line 76
protected Closure|null
approvalResultRecorderFor(AgentPrompt $prompt, array|null $approval, Collection|null $resolvedApprovalResults)
Get a callback that captures a resume's resolved approval results for its completion event.
at line 53
AgentResponse
prompt(AgentPrompt $prompt)
Invoke the given agent.
at line 175
protected array
gatherMiddlewareFor(Agent $agent)
Gather the internal run middleware for the given agent.
at line 193
protected array
resolveTools(AgentPrompt $prompt)
Resolve the tools for the given prompt, wrapping any agent instances as tools.
at line 204
protected array
declaredTools(Agent $agent)
Get the tools the agent declares, including the tool that loads its skills.
at line 214
protected mixed
resolveTool(mixed $tool)
Resolve a tool returned by the agent into a native tool instance when needed.
at line 233
protected RunContext
prepareRunContext(string $invocationId, AgentPrompt $prompt, array|null $approval)
Build the run's context, letting a remembered conversation claim and record the approval decisions the run resumes.
at line 257
protected RunContext
runContextFor(string $invocationId, AgentPrompt $prompt)
Build the context that identifies this run and reports its step and tool events.
at line 268
protected void
recordAgentFailure(string $invocationId, AgentPrompt $prompt, Throwable $exception, bool $retryable = true)
Dispatch the terminal failure event for a run, unless the caller may still retry it against another provider.
at line 285
protected void
throwIfNotResumable(AgentPrompt $prompt)
Throw when a pause has surfaced on a prompt that cannot be resumed from persisted or replayed history.