Documentation
¶
Overview ¶
Package agentturn is a composable agent loop over Open Responses: one loop, one transcript type, one tool contract, hooks and queues. Everything else is a front that feeds prompts in and consumes events out, or a subscriber.
The transcript is openresponses.Items. What a session stores, what the model receives and what a front renders are the same bytes. The model is any openresponses.Streamer: a remote server through openresponses.Client.AsAdapter, a local adapter, or another agent served by front/responses.
Vocabulary ¶
A run is one Run, Continue, Agent.Prompt or Agent.Continue until the agent goes idle. A turn is one model call plus the tool executions it requested.
Transcript and openresponses.Items are one type under two names, and the name says what a value is. A Transcript is a whole conversation: what Run starts from, what Filter and Transform see and return, what a hook or a tool reads from its context. Items is a fragment: the prompts of a run, the outputs of a batch, the items a run added.
Low-level loop ¶
Run and Continue are observational: they yield Event values in order and the loop does not wait for the consumer between phases. The RunEnd is always the last event and says how the run ended.
for ev := range agentturn.Run(ctx, transcript, prompts, cfg) {
switch e := ev.(type) {
case *agentturn.ItemUpdate:
if d, ok := e.Stream.(*openresponses.OutputTextDeltaEvent); ok {
fmt.Print(d.Delta)
}
case *agentturn.RunEnd:
if e.Err != nil { ... }
}
}
Agent ¶
Agent adds queues, subscribers and run control over the same loop. Subscribers are awaited in registration order and every event is a barrier: tool preflight for a turn does not start until every subscriber has returned for the assistant item, and Agent.Prompt settles only after the run_end subscribers finish.
Composition ¶
The loop never learns a sub-agent concept. It knows a Model and a list of agenttool.Tool, and every composition is one of those two things: front/responses serves a loop as a model, tools/agent wraps a config as a tool, and the A2A and MCP adapters do the same across a protocol.
Index ¶
- Constants
- Variables
- func CanContinue(t Transcript) bool
- func ContextWithTranscript(ctx context.Context, t Transcript) context.Context
- func Continue(ctx context.Context, t Transcript, cfg Config) iter.Seq[Event]
- func DefaultBackoff(attempt int, err error) time.Duration
- func DefaultRetryable(err error) bool
- func Run(ctx context.Context, t Transcript, prompts openresponses.Items, cfg Config) iter.Seq[Event]
- func VisibleFilter(visible ...string) func(Transcript) Transcript
- type Agent
- func (a *Agent) Abort()
- func (a *Agent) Config() Config
- func (a *Agent) Continue(ctx context.Context) (*RunEnd, error)
- func (a *Agent) FollowUp(items ...openresponses.Item)
- func (a *Agent) Prompt(ctx context.Context, items ...openresponses.Item) (*RunEnd, error)
- func (a *Agent) Resume(ctx context.Context, outputs ...*openresponses.FunctionCallOutput) (*RunEnd, error)
- func (a *Agent) SetConfig(cfg Config) error
- func (a *Agent) SetTranscript(t Transcript) error
- func (a *Agent) State() State
- func (a *Agent) Steer(items ...openresponses.Item)
- func (a *Agent) Subscribe(fn func(context.Context, Event) error) (unsubscribe func())
- func (a *Agent) WaitForIdle(ctx context.Context) error
- type Config
- type Event
- type ExecutionMode
- type ItemEnd
- type ItemStart
- type ItemUpdate
- type Model
- type ModelRetry
- type Option
- type Reason
- type ResponseEnd
- type Retry
- type RunEnd
- type RunStart
- type State
- type ToolAction
- type ToolCallInfo
- type ToolDecision
- type ToolEnd
- type ToolOverride
- type ToolResultInfo
- type ToolStart
- type ToolUpdate
- type Transcript
- type TurnEnd
- type TurnInfo
- type TurnStart
Constants ¶
const ( EventRunStart = "run_start" EventTurnStart = "turn_start" EventModelRetry = "model_retry" EventResponseEnd = "response_end" EventItemStart = "item_start" EventItemUpdate = "item_update" EventItemEnd = "item_end" EventToolStart = "tool_start" EventToolUpdate = "tool_update" EventToolEnd = "tool_end" EventTurnEnd = "turn_end" EventRunEnd = "run_end" )
Event type names.
const EventBuffer = 256
EventBuffer is how many events the loop can run ahead of the consumer of Run or Continue before it blocks; Agent delivers every event synchronously and has no buffer.
Variables ¶
var ( // ErrRunning is returned when Prompt, Continue, Resume, SetConfig or // SetTranscript is called while a run is active. ErrRunning = errors.New("agentturn: agent is already running") // ErrInputRequired is returned when the last run left calls // unanswered, deferred to the caller or cut off by an abort or a // failure; [Agent.Resume] with their outputs first. The typed // errors of tools/agent and tools/a2a match it with errors.Is, so a // host can ask "does any sub-agent need input" once. ErrInputRequired = errors.New("agentturn: pending tool calls must be resumed before continuing") // ErrNotPending is returned when Resume was given an output for a // call that is not pending, left a pending call unanswered, or was // called with nothing pending. ErrNotPending = errors.New("agentturn: output does not answer a pending call") )
Errors returned by Agent.
var ( // ErrNoModel is returned when Config.Model is nil. ErrNoModel = errors.New("agentturn: config has no model") // ErrCannotContinue is returned when the transcript does not end // with a user message or a function call output, so there is // nothing for the model to answer. ErrCannotContinue = errors.New("agentturn: transcript must end with a user message or a function call output to continue") // ErrNoPrompt is returned when Run was called with no prompt items. ErrNoPrompt = errors.New("agentturn: no prompt items") )
Errors returned before a run starts. Every error the package produces, sentinel or wrapped, begins with "agentturn:".
Functions ¶
func CanContinue ¶ added in v0.0.4
func CanContinue(t Transcript) bool
CanContinue reports whether the model has something to answer: the transcript ends with a user message or a function call output.
func ContextWithTranscript ¶ added in v0.0.4
func ContextWithTranscript(ctx context.Context, t Transcript) context.Context
ContextWithTranscript attaches a transcript to ctx. The loop does this with its working transcript before running a turn's hooks and tools, so a tool that composes another agent can seed it from the conversation without the host threading anything through.
func Continue ¶
Continue drives the loop from the transcript as it stands, which must satisfy CanContinue. Events arrive as for Run.
func DefaultBackoff ¶ added in v0.0.4
DefaultBackoff is the Retry.Backoff used when none is set: the Retry-After header of an openresponses error when it names a number of seconds, otherwise 500ms doubled per retry and capped at 30s, without jitter.
func DefaultRetryable ¶ added in v0.0.4
DefaultRetryable is the Retry.Retryable used when none is set: an openresponses error with status 408, 409, 429 or 5xx, a stream that ended before its terminal event, and transport failures (net.Error, an unexpected EOF, a reset or refused connection). Everything else, a 4xx in particular, is final.
func Run ¶
func Run(ctx context.Context, t Transcript, prompts openresponses.Items, cfg Config) iter.Seq[Event]
Run appends prompts to the transcript and drives the loop until the agent goes idle. Events are yielded in order and the RunEnd is the single terminal: it is always the last event, its Reason says how the run ended and its Err carries the failure when Reason is ReasonError, the context error when Reason is ReasonAborted, and nil otherwise. A misuse before the run starts (ErrNoPrompt, ErrCannotContinue, ErrNoModel, a duplicate tool name) yields one RunEnd with ReasonError and no other event.
The loop runs ahead of the consumer by up to EventBuffer events and applies backpressure after that. Breaking out of the loop cancels the run and blocks until it has wound down.
The transcript is not modified; the items the run appended are on the RunEnd.
func VisibleFilter ¶
func VisibleFilter(visible ...string) func(Transcript) Transcript
VisibleFilter returns a filter like DefaultFilter that keeps the listed extension item types.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is the stateful loop: a transcript, queues, subscribers and run control over Run. One run at a time; a second Prompt while one is active returns ErrRunning. The zero Agent has no model and is idle; use New.
Subscribers are called synchronously, in registration order, for every event, so every event is a barrier: the loop does not move to the next phase until each subscriber has returned. A subscriber that returns an error ends the run with ReasonError. The run_end is delivered with a context that is not cancelled, even after Agent.Abort, so a subscriber that writes durable state on it can.
func (*Agent) Abort ¶
func (a *Agent) Abort()
Abort cancels the active run, if any. The model stream and running tools see the cancellation through their context and the run ends with ReasonAborted.
func (*Agent) Continue ¶
Continue runs from the transcript as it stands, which must satisfy CanContinue, and returns as Agent.Prompt does.
func (*Agent) FollowUp ¶
func (a *Agent) FollowUp(items ...openresponses.Item)
FollowUp queues items to be injected when the run would otherwise end, so the agent keeps going instead of going idle.
func (*Agent) Prompt ¶
Prompt appends items and runs until idle. It returns when the run_end subscribers have returned, with the RunEnd that says how the run ended: done, stopped, input_required with the pending calls, or aborted with the context error on RunEnd.Err. The error is set only when the run could not start (ErrNoPrompt, ErrRunning, ErrInputRequired, ErrNoModel) or ended with ReasonError, in which case it is RunEnd.Err and the RunEnd is returned alongside.
func (*Agent) Resume ¶
func (a *Agent) Resume(ctx context.Context, outputs ...*openresponses.FunctionCallOutput) (*RunEnd, error)
Resume answers the calls the last run left pending and continues, whether they were deferred to the caller or cut off by an abort or a failure. Every pending call must have exactly one output, and no output may answer a call that is not pending; a caller that refuses a call answers it with the refusal as text, which the model then sees. The outputs are appended with their item events before the model is called, and the run returns as Agent.Prompt does. With nothing pending, Resume returns ErrNotPending.
func (*Agent) SetConfig ¶ added in v0.0.4
SetConfig replaces the configuration for the next run: model, instructions, reasoning, tools, hooks, all of it. It returns ErrRunning while a run is active. Subscribers and queues are kept; a session recorder attached to the agent sees the change as a config delta on the next turn.
func (*Agent) SetTranscript ¶ added in v0.0.4
func (a *Agent) SetTranscript(t Transcript) error
SetTranscript replaces the transcript, as when switching to another branch of a session. It returns ErrRunning while a run is active. The pending calls are derived from the new transcript as WithTranscript derives them, so whatever the old transcript was waiting on is forgotten and whatever the new one is waiting on must be answered through Agent.Resume. Queued Steer and FollowUp items are kept.
func (*Agent) Steer ¶
func (a *Agent) Steer(items ...openresponses.Item)
Steer queues items to be injected after the current tool batch, before the next model call. When the agent is idle they are consumed by the next run at the same point.
type Config ¶
type Config struct {
// Name is how the agent names itself when composed: the tool name in
// tools/agent, the server name in front/mcp, the agent card in
// front/a2a.
Name string
// Description is one paragraph about the agent, used the same way.
Description string
// Model streams responses. Required.
Model Model
// ModelName is the model field of every request.
ModelName string
// Instructions is the instructions field of every request.
Instructions string
// Tools the model may call. The loop reads it at the start of each
// turn.
Tools []agenttool.Tool
// ToolProvider, when set, supplies the tools for each turn in place
// of Tools, so a source whose tool list changes, such as a remote
// MCP server, is picked up on the next turn.
ToolProvider func(ctx context.Context) []agenttool.Tool
// Reasoning is the reasoning field of every request: effort and
// summary. The zero value leaves the request's own.
Reasoning openresponses.ReasoningConfig
// Text is the text field of every request: output format and
// verbosity. The zero value leaves the request's own.
Text openresponses.TextConfig
// Request is the base of every request the loop sends: tool_choice,
// parallel_tool_calls, max_output_tokens, temperature, truncation,
// include, safety_identifier, prompt_cache_key, service_tier and
// every other member are copied from it. The loop owns input, tools,
// store, stream and previous_response_id, and ModelName,
// Instructions, Reasoning and Text take precedence over the same
// members here when set. The loop adds nothing else: the run and
// turn IDs are on every event, not on the request, so the settings
// the model sees change only when this config does.
Request openresponses.Request
// BeforeModelCall runs on the fully built request of each turn, just
// before it is sent and before turn_start reports it. It may change
// anything; a change to Input has the same effect on session
// verification as a Transform.
BeforeModelCall func(context.Context, *openresponses.Request) error
// Retry is the policy for transient model failures. The zero value
// retries nothing; see [Retry].
Retry Retry
// ToolExecution selects parallel (default) or sequential batches.
ToolExecution ExecutionMode
// MaxParallelTools bounds a parallel batch; zero means
// agenttool.DefaultMaxParallel.
MaxParallelTools int
// MaxTurns stops a run after this many turns with ReasonStopped;
// zero means no limit.
MaxTurns int
// Filter drops app-only items before each model call and returns
// the conversation the model sees. nil means [DefaultFilter].
Filter func(Transcript) Transcript
// Transform runs before each model call on the whole transcript and
// may return a shorter or otherwise edited one for that call only:
// prune, compact, inject context. It receives a copy of the slice
// and must not mutate the items. The working transcript is not
// replaced.
Transform func(context.Context, Transcript) (Transcript, error)
// BeforeToolCall runs once per call, in the model's order, before any
// call of the batch executes. A nil decision allows the call.
BeforeToolCall func(context.Context, ToolCallInfo) (*ToolDecision, error)
// AfterToolCall runs when a call completes and may replace its
// result. A nil override keeps the result.
AfterToolCall func(context.Context, ToolResultInfo) (*ToolOverride, error)
// ShouldStopAfterTurn ends the run after a turn even when the model
// requested tools.
ShouldStopAfterTurn func(context.Context, TurnInfo) (bool, error)
// RequestExtra is passed through as Request.Extra on every call.
RequestExtra map[string]any
}
Config describes an agent. The zero value is not usable: Model is required.
func (Config) BaseRequest ¶
func (c Config) BaseRequest(ctx context.Context) openresponses.Request
BaseRequest returns the request every turn starts from: Config.Request with the loop-owned transport members set (store false, stream true, no previous_response_id), ModelName, Instructions, Reasoning and Text applied over it, RequestExtra merged over its Extra, and the tool definitions of the moment. Only Input is added by the loop; a recorder uses this to write the initial settings.
func (Config) ResolveTools ¶ added in v0.0.4
ResolveTools returns the tools of the moment: ToolProvider's answer when it is set, Tools otherwise. The loop consults it once per turn; a front that builds its own request uses it so the provider fallback lives in one place.
type Event ¶
type Event interface {
EventType() string
}
Event is one step of a run. Concrete types are RunStart, TurnStart, ModelRetry, ItemStart, ItemUpdate, ItemEnd, ResponseEnd, ToolStart, ToolUpdate, ToolEnd, TurnEnd and RunEnd. Decoded values are pointers, so switch on *ItemUpdate and so on.
type ExecutionMode ¶
type ExecutionMode int
ExecutionMode selects how a batch of tool calls runs.
const ( // ExecParallel runs the calls of a batch concurrently, bounded by // [Config.MaxParallelTools], unless a tool in the batch is // agenttool.Sequential. ExecParallel ExecutionMode = iota // ExecSequential runs every batch one call at a time in the model's // order. ExecSequential )
type ItemEnd ¶
type ItemEnd struct {
RunID string
Turn int
Item openresponses.Item
// ResponseID is the ID of the response that produced the item, and
// empty for an item the loop appended itself.
ResponseID string
}
ItemEnd carries a completed item. For an assistant item it is emitted only after output_item.done; partial items never arrive here. The item is in the transcript when this event is delivered.
type ItemStart ¶
type ItemStart struct {
RunID string
Turn int
Item openresponses.Item
// ResponseID is the ID of the response streaming the item, and empty
// for an item the loop appended itself.
ResponseID string
}
ItemStart announces an item entering the transcript: a prompt or queued message, an assistant item as the stream opens it, or a function call output. For an assistant item the Item is the live accumulated value and fills in as updates arrive.
type ItemUpdate ¶
type ItemUpdate struct {
RunID string
Turn int
Item openresponses.Item
Stream openresponses.StreamEvent
ResponseID string
}
ItemUpdate carries one wire event for an assistant item. Stream is the openresponses event verbatim, so a front switches on the same concrete types it would use against a remote server. Item is the accumulated item so far.
func (*ItemUpdate) EventType ¶
func (*ItemUpdate) EventType() string
EventType returns "item_update".
type Model ¶
type Model = openresponses.Streamer
Model is anything that can stream an Open Responses response.
type ModelRetry ¶ added in v0.0.4
type ModelRetry struct {
RunID string
Turn int
// Attempt is the number of the attempt that failed, from 1; the
// next attempt is Attempt+1.
Attempt int
Err error
Delay time.Duration
}
ModelRetry reports that a model call failed and will be attempted again after Delay, under Config.Retry. It follows the turn_start of the turn; no item of the failed attempt reached subscribers.
func (*ModelRetry) EventType ¶ added in v0.0.4
func (*ModelRetry) EventType() string
EventType returns "model_retry".
type Option ¶
type Option func(*Agent)
Option configures a new Agent.
func WithTranscript ¶
func WithTranscript(t Transcript) Option
WithTranscript starts the agent from an existing transcript, as when resuming a session. Function calls after the last user message that have no output are pending, as they would be after the run that made them: Prompt and Continue return ErrInputRequired until Agent.Resume has answered them.
type Reason ¶
type Reason string
Reason says why a run ended.
const ( // ReasonDone means the model produced a final answer with no tool // calls and no queued follow-ups. ReasonDone Reason = "done" // ReasonStopped means ShouldStopAfterTurn, a terminating tool batch // or MaxTurns ended the run. ReasonStopped Reason = "stopped" // ReasonInputRequired means BeforeToolCall deferred one or more // calls to the caller; RunEnd.Pending lists them and the run // continues once their outputs are appended (see Agent.Resume). ReasonInputRequired Reason = "input_required" // ReasonAborted means the context was cancelled. A tool batch cut // off by the abort leaves its calls on RunEnd.Pending. ReasonAborted Reason = "aborted" // ReasonError means the model, a hook or a subscriber failed; // RunEnd.Err says which. ReasonError Reason = "error" )
Run end reasons.
type ResponseEnd ¶
type ResponseEnd struct {
RunID string
Turn int
Response *openresponses.Response
}
ResponseEnd carries the folded response of a turn, usage included, as soon as the stream ends and before any tool of the turn runs. Its output items have all been delivered with item_end. A response that failed is delivered here too, before the run ends with the error, so a recorder can write it.
func (*ResponseEnd) EventType ¶
func (*ResponseEnd) EventType() string
EventType returns "response_end".
type Retry ¶ added in v0.0.4
type Retry struct {
// MaxAttempts is the number of attempts per turn, the first
// included. Zero or one means no retry.
MaxAttempts int
// Backoff returns how long to wait before the next attempt, given
// the number of the attempt that failed and its error. nil means
// [DefaultBackoff].
Backoff func(attempt int, err error) time.Duration
// Retryable reports whether err is worth another attempt. nil means
// [DefaultRetryable].
Retryable func(error) bool
}
Retry says when a failed model call is attempted again. A retry happens inside the turn: the same request is sent again after a delay, a ModelRetry event tells subscribers, and the turn_start and response_end of the turn are delivered once. Only an attempt that delivered nothing is retried: once an item of the attempt has reached subscribers, or the server has answered with a failed response, the failure is final, because the transcript or a recorder may already hold part of it. Abort cuts a delay short.
type RunEnd ¶
type RunEnd struct {
RunID string
Items Transcript
Reason Reason
// Err is set when Reason is ReasonError, and to the context error
// when Reason is ReasonAborted.
Err error
// Pending lists the function calls of the run with no
// function_call_output, in transcript order: the calls a deferred
// decision handed to the caller when Reason is ReasonInputRequired,
// and the calls an abort or a failure cut off before their outputs
// were appended. It is empty for ReasonDone and ReasonStopped. The
// transcript is a valid input again once each has an output, which
// Agent.Resume appends.
Pending []*openresponses.FunctionCall
}
RunEnd closes a run. Exactly one is emitted per run and nothing follows it. Items are the items the run appended to the transcript. A run refused before it started (ErrNoPrompt, ErrCannotContinue, ErrNoModel) is one RunEnd with ReasonError, an empty RunID and no other event.
type State ¶
type State struct {
// Transcript is a copy of the slice; items are shared.
Transcript Transcript
Running bool
RunID string
Turn int
// Steering and FollowUps count the queued items.
Steering int
FollowUps int
// Pending lists the calls awaiting outputs, deferred or cut off by
// an abort or a failure; Prompt and Continue refuse until Resume has
// answered them.
Pending []*openresponses.FunctionCall
}
State is a snapshot of the agent.
type ToolAction ¶ added in v0.0.4
type ToolAction int
ToolAction is what BeforeToolCall decides for a call.
const ( // Allow runs the call. It is the zero value, so a decision that only // rewrites Args or sets Terminate allows the call. Allow ToolAction = iota // Block refuses the call. The model sees ToolDecision.Reason as the // error output. Block // Defer hands the call to the caller instead of running it: the // other calls of the batch proceed, no output is appended for this // one, and the run ends with ReasonInputRequired listing it. The // caller appends the output later and continues. Defer )
type ToolCallInfo ¶
type ToolCallInfo struct {
RunID string
Turn int
// Call is the function_call item as the model produced it.
Call *openresponses.FunctionCall
// Tool is the tool that will run, or nil when no tool has that
// name; the call then fails with an error output unless the hook
// blocks it first.
Tool agenttool.Tool
// Args are the arguments as raw JSON.
Args json.RawMessage
}
ToolCallInfo describes a call before it runs.
type ToolDecision ¶
type ToolDecision struct {
// Action allows, blocks or defers the call.
Action ToolAction
// Reason is the message the model sees when Action is Block.
Reason string
// Terminate hints the loop to stop after the batch, as a tool result
// would. It composes with Allow and Block.
Terminate bool
// Args, when non-nil, replaces the arguments the tool receives.
Args json.RawMessage
}
ToolDecision is a hook's verdict on a call.
type ToolEnd ¶
type ToolEnd struct {
RunID string
Turn int
CallID string
Name string
Result agenttool.Result
Err error
Blocked bool
Deferred bool
}
ToolEnd carries a finished call, in completion order. Err is set when the tool failed, the arguments were invalid or no tool had the name; Blocked is set when BeforeToolCall refused the call. In both cases Result holds the error output the model sees. Deferred is set when BeforeToolCall handed the call to the caller: nothing ran, Result is empty and no output is appended. A call cancelled by an abort ends with the context error as Err; its output is not appended either, and the call is listed on RunEnd.Pending.
type ToolOverride ¶
ToolOverride replaces the result of a call.
type ToolResultInfo ¶
type ToolResultInfo struct {
RunID string
Turn int
Call *openresponses.FunctionCall
Tool agenttool.Tool
Args json.RawMessage
Result agenttool.Result
Err error
}
ToolResultInfo describes a completed call.
type ToolUpdate ¶
ToolUpdate carries progress from a running tool.
func (*ToolUpdate) EventType ¶
func (*ToolUpdate) EventType() string
EventType returns "tool_update".
type Transcript ¶
type Transcript = openresponses.Items
Transcript is the conversation as the model sees it, plus app-only items that the Config.Filter removes before each call.
func DefaultFilter ¶
func DefaultFilter(t Transcript) Transcript
DefaultFilter drops every item whose type carries a slug prefix such as "agentturn:note", which marks an app-only extension item, and nil items. It is the Filter when Config.Filter is nil.
func TranscriptFromContext ¶ added in v0.0.4
func TranscriptFromContext(ctx context.Context) (Transcript, bool)
TranscriptFromContext returns the transcript the loop attached to the context of a hook or a tool call: the working transcript as it stood when the batch started, the calls of the batch included. It is a snapshot; do not mutate it.
type TurnEnd ¶
type TurnEnd struct {
RunID string
Turn int
Response *openresponses.Response
ToolResults []agenttool.Result
}
TurnEnd closes a turn with the folded response, usage included, and the tool results in the model's order.
type TurnInfo ¶
type TurnInfo struct {
RunID string
Turn int
Response *openresponses.Response
// ToolResults are the results of this turn's calls in the model's
// order, empty when the model called no tools.
ToolResults []agenttool.Result
// Transcript is the working transcript after the turn. It is the
// loop's live slice; do not mutate it or keep it past the hook.
Transcript Transcript
}
TurnInfo describes a finished turn.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package compact is the reference compaction Transform for agentturn: when a transcript grows past a token budget, the older part is folded into a shorter form and the recent part is kept verbatim.
|
Package compact is the reference compaction Transform for agentturn: when a transcript grows past a token budget, the older part is folded into a shorter form and the recent part is kept verbatim. |
|
front
|
|
|
responses
Package responses serves an agent as an Open Responses server: the loop as an openresponses.Adapter.
|
Package responses serves an agent as an Open Responses server: the loop as an openresponses.Adapter. |
|
a2a
module
|
|
|
session
module
|
|
|
tools
|
|
|
agent
Package agent wraps an agent configuration as a tool, so one loop can delegate to another in process.
|
Package agent wraps an agent configuration as a tool, so one loop can delegate to another in process. |
|
a2a
module
|