agentrunep

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentActionPresenter

func AgentActionPresenter(a *pb.AgentActionInfo, agentRunID string) apiresource.AgentAction

func AgentRunPresenter

func AgentRunPresenter(r *pb.AgentRunInfo) apiresource.AgentRun

func AgentRunStepPresenter

func AgentRunStepPresenter(s *pb.AgentRunStepInfo) apiresource.AgentRunStep

Types

type AgentRunSvcConfig

type AgentRunSvcConfig struct {
	// AgentClient (required) is the agent-service gRPC client.
	AgentClient pb.AgentServiceClient
}

type CancelRunEndpoint

type CancelRunEndpoint struct{}

Cancels an in-progress agent run.

A run can be cancelled while it is working or paused waiting on the user — `pending`, `running`, `awaiting_input`, or `awaiting_approval`. Cancelling a run in a terminal status (`completed`, `failed`, `cancelled`) returns a validation error.

Cancelling a run that is `awaiting_approval` counts as denying the review: every action still pending review is recorded as rejected, attributed to the caller. Work the agent already completed is not undone.

func (*CancelRunEndpoint) Materialize

type CancelRunRequest

type CancelRunRequest struct {
	// Agent run ID.
	AgentRunID string `path:"id" validate:"required"`
}

Request to cancel an agent run.

type ContinueRunEndpoint

type ContinueRunEndpoint struct{}

Resumes a paused agent run with a user message and any tool review decisions.

The run must be `awaiting_input` or `awaiting_approval`; resuming it from any other status returns a validation error. It moves back to `running` and continues asynchronously, so poll Retrieve Agent Run to follow it. Each approval and denial is recorded on the matching action and attributed to the caller.

func (*ContinueRunEndpoint) Materialize

type ContinueRunRequest

type ContinueRunRequest struct {
	// Agent run ID.
	AgentRunID string `path:"id" validate:"required"`
	// Message to send to the agent as the next turn of the run.
	//
	// It accompanies any approval or denial in the same request, so use it to tell the agent how to proceed with what you just allowed or blocked.
	Message string `json:"message" validate:"required"`
	// Slugs of tools whose pending calls should be approved.
	//
	// Approves every call currently pending review for each named tool. Approval is one-time — the next call to the same tool pauses for review again. Tools you do not name are left pending, and the run resumes without them.
	ApprovedToolSlugs []string `json:"approved_tool_slugs,omitzero"`
	// Slugs of tools whose pending calls should be denied.
	//
	// The run keeps going: each denied call is answered with a "denied by user" result so the agent proceeds without it, instead of cancelling the run. A single resume may both approve and reject different tools.
	RejectedToolSlugs []string `json:"rejected_tool_slugs,omitzero"`
	// Tool-call IDs (the `tool_use_id` of individual blocked calls) to approve.
	//
	// Use this instead of `approved_tool_slugs` to approve ONE specific call when several pending calls share the same tool slug — approving by slug would approve all of them. Approvals are one-time.
	ApprovedToolCallIDs []string `json:"approved_tool_call_ids,omitzero"`
	// Tool-call IDs (the `tool_use_id` of individual blocked calls) to deny.
	//
	// Per-call counterpart of `rejected_tool_slugs`, letting you deny one specific call among several that share a slug. Each denied call is answered with a "denied by user" result and the run continues.
	RejectedToolCallIDs []string `json:"rejected_tool_call_ids,omitzero"`
}

Request to resume a paused agent run.

func (*ContinueRunRequest) SchemaExample

func (*ContinueRunRequest) SchemaExample() any

type ListRunsEndpoint

type ListRunsEndpoint struct{}

Lists agent runs for your account, newest first.

The `q` parameter matches a run's ID, its status, or the ID of the agent that produced it.

type ListRunsRequest

type ListRunsRequest struct {
	apiresource.PaginationRequest
	// Restricts results to runs in this status.
	Status *constants.AgentRunStatus `query:"status"`
	// Restricts results to runs of a single agent.
	AgentDefinitionID *string `query:"agent_definition_id"`
}

Request to list agent runs.

type RetrieveRunEndpoint

type RetrieveRunEndpoint struct{}

Retrieves a single agent run by ID.

A run records one execution of an agent: its current status, the input it started from, the output it produced, the tools it invoked, and the step-by-step timeline of how it got there.

func (*RetrieveRunEndpoint) Materialize

type RetrieveRunRequest

type RetrieveRunRequest struct {
	// Agent run ID.
	AgentRunID string `path:"id" validate:"required"`
}

Request to retrieve an agent run.

type RetryRunEndpoint

type RetryRunEndpoint struct{}

Retries a failed agent run by resuming its existing transcript.

Only runs in the `failed` status can be retried; retrying a run in any other status returns a validation error. The run is re-attempted from where it left off — its prior reasoning and tool results are replayed, so the agent continues with full knowledge of what it already did rather than starting over, which minimizes the chance of it repeating side effects it has already caused.

A run can be retried at most five times in total, and any automatic retries the platform already performed for transient failures count against that budget.

func (*RetryRunEndpoint) Materialize

type RetryRunRequest

type RetryRunRequest struct {
	// Agent run ID.
	AgentRunID string `path:"id" validate:"required"`
}

Request to retry a failed agent run.

type TriggerRunEndpoint

type TriggerRunEndpoint struct{}

Starts a new run of the specified agent.

The run is created in the `pending` status and executed asynchronously; poll Retrieve Agent Run to follow its progress. Any agent can be started this way regardless of how it is normally triggered, and the resulting run is always recorded with `trigger_type` `manual`.

func (*TriggerRunEndpoint) Materialize

type TriggerRunRequest

type TriggerRunRequest struct {
	// ID of the agent definition to run.
	//
	// The agent must be active for the account; triggering an inactive agent returns a validation error.
	AgentDefinitionID string `json:"agent_definition_id" validate:"required"`
	// Instruction text passed to the agent at the start of the run.
	//
	// Recorded on the run as `{"message": <input>}` in its `input` field.
	Input field.Optional[string] `json:"input,omitzero"`
}

Request to trigger an agent run.

func (*TriggerRunRequest) SchemaExample

func (*TriggerRunRequest) SchemaExample() any

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL