Documentation
¶
Overview ¶
Package agent provides the provider-agnostic agent abstraction at the core of the framework.
An Agent is built from a ProviderConfig whose ProviderConfig.Run is a streaming provider function; around it the agent layers conversation history, context providers, and middleware. Agents exchange github.com/microsoft/agent-framework-go/message.Message values and are run with Agent.Run, Agent.RunText, or Agent.RunMessage, each returning a streaming ResponseStream. Concrete agents are normally created through a provider constructor (see the provider packages) rather than directly.
Index ¶
- Constants
- func AllOptions[T any](opts []Option, setter func(T) Option) iter.Seq[T]
- func GetOption[T any](opts []Option, setter func(T) Option) (T, bool)
- type Agent
- func (a *Agent) CreateSession(ctx context.Context, options ...Option) (*Session, error)
- func (a *Agent) Description() string
- func (a *Agent) ID() string
- func (a *Agent) Name() string
- func (a *Agent) ProviderName() string
- func (a *Agent) Run(ctx context.Context, messages []*message.Message, options ...Option) ResponseStream
- func (a *Agent) RunMessage(ctx context.Context, msg *message.Message, options ...Option) ResponseStream
- func (a *Agent) RunText(ctx context.Context, msg string, options ...Option) ResponseStream
- type Config
- type ContextProvider
- type ContextProviderConfig
- type HistoryProvider
- type HistoryProviderConfig
- type InMemoryHistoryProviderConfig
- type InvokedContext
- type InvokingContext
- type MessageInjector
- type Middleware
- type MiddlewareFunc
- type Option
- func AllowBackgroundResponses(allow bool) Option
- func Stream(stream bool) Option
- func WithContinuationToken(token string) Option
- func WithInstructions(instructions string) Option
- func WithResponseFormat(format ResponseFormat) Option
- func WithServiceID(id string) Option
- func WithSession(session *Session) Option
- func WithStructuredOutput(v any) Option
- func WithTool(tool tool.Tool) Option
- func WithToolMode(mode tool.ToolMode) Option
- type ProviderConfig
- type Response
- type ResponseFormat
- type ResponseStream
- type ResponseUpdate
- type RunFunc
- type Session
- func (s *Session) Delete(key string)
- func (s *Session) Get(key string, value any) (bool, error)
- func (s Session) MarshalJSON() ([]byte, error)
- func (s *Session) ServiceID() string
- func (s *Session) Set(key string, value any)
- func (s *Session) SetServiceID(id string)
- func (s *Session) UnmarshalJSON(data []byte) error
Constants ¶
const SourceTypeContextProvider message.SourceType = "context-provider"
SourceTypeContextProvider represents a message that originated from a context provider.
const SourceTypeHistoryProvider message.SourceType = "history-provider"
SourceTypeHistoryProvider represents a message that originated from a history provider.
const SourceTypeMiddleware message.SourceType = "middleware"
SourceTypeMiddleware represents a message that originated from a middleware component.
Variables ¶
This section is empty.
Functions ¶
func AllOptions ¶
AllOptions returns a sequence of all values of type T stored in opts with the provided setter.
Example usage:
for v := range agent.AllOptions(opts, agent.WithSession) {
// do something with v of type T
}
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent coordinates message preparation, middleware, sessions, and provider execution.
func AgentFromContext ¶
AgentFromContext retrieves the agent that initiated the run from the context. Returns the agent and true if found, or nil and false otherwise.
func New ¶
func New(prov ProviderConfig, cfg Config) *Agent
New creates an Agent from provider and runtime configuration.
func (*Agent) CreateSession ¶
CreateSession creates a session for this agent.
func (*Agent) Description ¶
Description returns the agent's description.
func (*Agent) ProviderName ¶
ProviderName returns the name of the provider backing the agent.
func (*Agent) Run ¶
func (a *Agent) Run(ctx context.Context, messages []*message.Message, options ...Option) ResponseStream
Run executes the agent with the supplied messages and options.
func (*Agent) RunMessage ¶
func (a *Agent) RunMessage(ctx context.Context, msg *message.Message, options ...Option) ResponseStream
RunMessage runs the agent with a single message.
type Config ¶
type Config struct {
// ID uniquely identifies the agent. A random UUID is assigned when empty.
ID string
// Name is the display name used for agent-authored messages.
Name string
// Description describes the agent's purpose.
Description string
// HistoryProvider injects and persists conversation history around each agent run.
// When nil, New uses a default in-memory history provider for local sessions.
HistoryProvider HistoryProvider
// ThrowOnHistoryProviderConflict controls whether a configured
// HistoryProvider conflicting with service-managed history returns an error.
// The default is true.
ThrowOnHistoryProviderConflict *bool
// WarnOnHistoryProviderConflict controls whether a warning is logged when a
// configured HistoryProvider conflicts with service-managed history. The
// default is true.
WarnOnHistoryProviderConflict *bool
// ClearOnHistoryProviderConflict controls whether the configured
// HistoryProvider is cleared when it conflicts with service-managed history.
// Returning an error takes precedence. The default is true.
ClearOnHistoryProviderConflict *bool
// ContextProviders inject and persist context around each agent run.
ContextProviders []ContextProvider
// Logger receives run, middleware, and provider diagnostics.
Logger *slog.Logger
// LogSensitiveData enables logging of sensitive request and response payloads.
LogSensitiveData bool
// DisableRunLogs disables automatic run logging when Logger is set.
DisableRunLogs bool
// Middlewares wrap the agent lifecycle before history and context providers.
Middlewares []Middleware
// MessageInjector configures mid-run message injection. Call its
// EnqueueMessages method to queue messages. Nil disables message injection.
MessageInjector *MessageInjector
// Tools are added to every run.
Tools []tool.Tool
// RunOptions are prepended to the options for every run.
RunOptions []Option
}
Config configures an Agent instance.
type ContextProvider ¶
type ContextProvider interface {
// Invoking returns the input messages and options with provider-specific additions applied.
Invoking(context.Context, InvokingContext) ([]*message.Message, []Option, error)
// Invoked persists context-related state after an agent invocation finishes.
Invoked(context.Context, InvokedContext) error
}
ContextProvider participates in an agent invocation lifecycle by supplying additional context before a run and processing context after a run completes.
Context providers can retrieve relevant information, add instructions, inject contextual messages, provide tools for the current invocation, and persist or learn from request and response messages after successful runs.
Prefer creating providers with NewContextProvider. Implement ContextProvider directly when a provider needs custom filtering, merging, source attribution, failure handling, or non-additive behavior such as compaction or truncation.
Security considerations ¶
Context providers may inject messages with any role, including system, which has the highest trust level and directly shapes LLM behavior. Developers must ensure that all providers attached to an agent are trusted. Agent Framework does not validate or filter the data returned by providers — it is accepted as-is and merged into the request context. If a provider retrieves data from an external source (e.g., a vector database or memory service), be aware that a compromised data source could introduce adversarial content designed to manipulate LLM behavior via indirect prompt injection. Implementers should validate and sanitize data retrieved from external sources before returning it.
func NewContextProvider ¶
func NewContextProvider(config ContextProviderConfig) ContextProvider
NewContextProvider creates the default additive context provider.
The provider filters input messages before invoking Provide, treats Provide results as additive, source-stamps provided messages, appends provided messages and options to the original invocation context, filters stored request and response messages, and skips Store when the run fails.
It panics if SourceID is empty.
type ContextProviderConfig ¶
type ContextProviderConfig struct {
// Unique identifier for this provider instance (required).
SourceID string
// Optional filter applied to request messages before Provide.
// Defaults to [messagefilter.ExternalOnly].
ProvideInputMessageFilter messagefilter.Filter
// Optional filter applied to request messages before Store.
// Defaults to [messagefilter.ExternalOnly].
StoreInputRequestMessageFilter messagefilter.Filter
// Optional filter applied to response messages before Store.
// Defaults to passing all response messages through.
StoreInputResponseMessageFilter messagefilter.Filter
// Optional retrieval hook that returns additional provider context messages and run options.
Provide func(context.Context, InvokingContext) ([]*message.Message, []Option, error)
// Optional storage hook. Defaults to no-op.
Store func(context.Context, InvokedContext) error
}
ContextProviderConfig configures the provider created by NewContextProvider.
type HistoryProvider ¶
type HistoryProvider interface {
// Invoking returns the input messages with this provider's history applied.
Invoking(context.Context, InvokingContext) ([]*message.Message, error)
// Invoked persists history after an agent invocation finishes.
Invoked(context.Context, InvokedContext) error
}
HistoryProvider retrieves chat history before an agent invocation and stores newly produced messages after an invocation.
A history provider is only relevant when the underlying AI service does not manage chat history itself. Implementations are responsible for preserving message order and metadata, returning messages in chronological order, and applying storage-management strategies such as truncation, summarization, or archival when history grows large. It cannot add run options, tools, instructions, or other non-message context. Use ContextProvider when an extension needs to supply context that is not only conversation history.
Security considerations ¶
Agent Framework does not validate or filter the messages returned by the provider during load — they are accepted as-is and treated identically to user-supplied messages. Implementers must ensure that only trusted data is returned. If the underlying storage is compromised, adversarial content could influence LLM behavior via indirect prompt injection, for example by altering conversation context or impersonating different roles. Messages stored in chat history may contain PII and sensitive conversation content; implementers should consider encryption at rest and appropriate access controls for the storage backend.
func NewHistoryProvider ¶
func NewHistoryProvider(config HistoryProviderConfig) HistoryProvider
NewHistoryProvider creates the default additive history provider.
The provider treats Provide results as additional history messages, filters those messages when ProvideOutputMessageFilter is set, source-stamps them, prepends them to caller-provided request messages, filters stored request and response messages, and skips Store when the run fails.
It panics if SourceID is empty.
func NewInMemoryHistoryProvider ¶
func NewInMemoryHistoryProvider(config InMemoryHistoryProviderConfig) HistoryProvider
NewInMemoryHistoryProvider creates a history provider that stores conversation history in the session.
type HistoryProviderConfig ¶
type HistoryProviderConfig struct {
// Unique identifier for this provider instance (required).
SourceID string
// Optional filter applied to messages added by Provide before they are included.
// Defaults to passing all added messages through.
ProvideOutputMessageFilter messagefilter.Filter
// Optional filter applied to request messages before Store.
// Defaults to messages that did not come from a history provider.
StoreInputRequestMessageFilter messagefilter.Filter
// Optional filter applied to response messages before Store.
// Defaults to passing all response messages through.
StoreInputResponseMessageFilter messagefilter.Filter
// Optional retrieval hook that returns additional history messages in chronological order.
Provide func(context.Context, InvokingContext) ([]*message.Message, error)
// Optional storage hook. Defaults to no-op.
Store func(context.Context, InvokedContext) error
}
HistoryProviderConfig configures the provider created by NewHistoryProvider.
type InMemoryHistoryProviderConfig ¶
type InMemoryHistoryProviderConfig struct {
// SourceID identifies messages loaded from this provider.
// When empty, a default in-memory history provider source ID is used.
SourceID string
// StateKey identifies where provider state is stored in the session.
// When empty, SourceID is used.
StateKey string
// StateInitializer returns initial messages on first use.
// When nil, no initial messages are used.
StateInitializer func(*Session) []*message.Message
// Optional filter applied to messages loaded from storage before they are included.
// Defaults to passing all loaded messages through.
ProvideOutputMessageFilter messagefilter.Filter
// Optional filter applied to request messages before storing them.
// Defaults to messages that did not come from a history provider.
StoreInputRequestMessageFilter messagefilter.Filter
// Optional filter applied to response messages before storing them.
// Defaults to passing all response messages through.
StoreInputResponseMessageFilter messagefilter.Filter
}
InMemoryHistoryProviderConfig configures the provider created by NewInMemoryHistoryProvider.
type InvokedContext ¶
type InvokedContext struct {
// RequestMessages are the messages used for the invocation.
RequestMessages []*message.Message
// ResponseMessages are the messages produced by the invocation.
ResponseMessages []*message.Message
// Options are the run options used for the invocation.
Options []Option
// Err is the error returned by the invocation, if any.
Err error
}
InvokedContext contains the agent invocation context available to a ContextProvider after a provider run completes.
Providers must treat the message and option slices, and existing messages, as read-only. Clone them before retaining modified copies.
type InvokingContext ¶
type InvokingContext struct {
// Messages are the request messages currently being prepared for the invocation.
Messages []*message.Message
// Options are the run options currently being prepared for the invocation.
Options []Option
}
InvokingContext contains the agent invocation context available to a ContextProvider before the provider run starts.
Providers must treat the message and option slices, and existing messages, as read-only. To modify the invocation, clone the slices and any message being changed, then return the derived values from Invoking.
type MessageInjector ¶
type MessageInjector struct {
// contains filtered or unexported fields
}
MessageInjector queues messages for injection between provider calls. Its zero value is ready to use.
func (*MessageInjector) EnqueueMessages ¶
func (m *MessageInjector) EnqueueMessages(session *Session, messages ...*message.Message) error
EnqueueMessages queues messages for the next provider call associated with session.
func (*MessageInjector) PendingMessages ¶
func (m *MessageInjector) PendingMessages(session *Session) ([]*message.Message, error)
PendingMessages returns a point-in-time snapshot of messages queued for session.
type Middleware ¶
type Middleware interface {
Run(next RunFunc, ctx context.Context, messages []*message.Message, options ...Option) iter.Seq2[*ResponseUpdate, error]
}
Middleware wraps an agent run function to inspect or modify messages, options, response updates, and errors.
Use middleware when an extension needs direct control over provider invocation, streaming updates, option propagation, or error handling beyond the request/response message hooks exposed by ContextProvider. Messages passed to next that were not present in the middleware input are marked with SourceTypeMiddleware when they do not already carry a source.
Middleware implementations must treat input message and option slices, and existing messages, as read-only. To modify the downstream invocation, clone the slices and any message being changed, then pass the derived values to next.
func ContextProviderMiddleware ¶
func ContextProviderMiddleware(p ContextProvider) Middleware
ContextProviderMiddleware adapts a context provider into middleware for callers that explicitly need middleware composition. Agents configured with Config.ContextProviders run providers through the agent lifecycle rather than through this adapter.
type MiddlewareFunc ¶
type MiddlewareFunc func(next RunFunc, ctx context.Context, messages []*message.Message, options ...Option) iter.Seq2[*ResponseUpdate, error]
MiddlewareFunc adapts a function to the Middleware interface.
func (MiddlewareFunc) Run ¶
func (mf MiddlewareFunc) Run(next RunFunc, ctx context.Context, messages []*message.Message, options ...Option) iter.Seq2[*ResponseUpdate, error]
Run calls the underlying function, letting a plain func be used wherever a Middleware is required.
type Option ¶
type Option interface {
MAFValue() any
}
An Option is a configuration option for an Agent.
Each option must be implemented as its own distinct type. GetOption and AllOptions use the option's type to uniquely identify each option.
func AllowBackgroundResponses ¶
AllowBackgroundResponses sets whether to allow background responses during the agent run.
Background responses allow running long-running operations or tasks asynchronously in the background that can be resumed by streaming APIs and polled for completion by non-streaming APIs.
When this property is set to true, non-streaming APIs may start a background operation and return an initial response with a continuation token. Subsequent calls to the same API should be made in a polling manner with the continuation token to get the final result of the operation.
When this property is set to true, streaming APIs may also start a background operation and begin streaming response updates until the operation is completed. If the streaming connection is interrupted, the continuation token obtained from the last update that has one should be supplied to a subsequent call to the same streaming API to resume the stream from the point of interruption and continue receiving updates until the operation is completed.
This property only takes effect if the implementation it's used with supports background responses. If the implementation does not support background responses, this property will be ignored.
func WithContinuationToken ¶
WithContinuationToken sets the continuation token for resuming and getting the result of the agent response identified by this token.
This token is used for background responses that can be activated via AllowBackgroundResponses if the agent supports them. A streamed background response started with Stream can be resumed by passing a token from ResponseUpdate.ContinuationToken to a later Agent.Run. A non-streamed background response can be polled by passing Response.ContinuationToken to a later Agent.Run with no input messages.
func WithInstructions ¶
WithInstructions sets system instructions for an agent run when supported by the provider. Use AllOptions to access instructions because multiple instruction values can be supplied.
func WithResponseFormat ¶
func WithResponseFormat(format ResponseFormat) Option
WithResponseFormat sets the desired response format for the agent run.
func WithServiceID ¶
WithServiceID sets the service ID for a session.
func WithSession ¶
WithSession sets the session to use during the agent run.
func WithStructuredOutput ¶
WithStructuredOutput sets the variable pointed to by v to the structured output produced by the agent.
func WithToolMode ¶
WithToolMode sets the tool mode for the agent run.
type ProviderConfig ¶
type ProviderConfig struct {
// ProviderName identifies the underlying provider implementation.
ProviderName string
// Run executes a request and streams response updates.
Run RunFunc
// Middlewares wrap Run after agent history and context providers.
Middlewares []Middleware
// Format creates a provider response format for a structured output value.
Format func(v any) (ResponseFormat, error)
// Unmarshal decodes provider structured output into v using format.
Unmarshal func(format ResponseFormat, data []byte, v any) error
// CreateSession configures a provider-specific session. Implementations must
// treat options as read-only and clone the slice before making changes.
CreateSession func(ctx context.Context, session *Session, options ...Option) error
// ServiceDoesNotManageHistory indicates that this provider never manages
// conversation history server-side, even when a ServiceID is set on the
// session. When true, the agent's HistoryProvider is always preserved
// regardless of session service ID. Use this for providers like AGUI that
// require the caller to supply the full conversation history on every turn
// even after the service assigns a session or thread identifier.
ServiceDoesNotManageHistory bool
}
ProviderConfig configures the provider-specific implementation behind an Agent.
type Response ¶
type Response struct {
// AdditionalProperties contains provider-specific metadata associated with
// the response that does not fit the standard response schema.
AdditionalProperties map[string]any `json:",omitzero"`
// AgentID identifies the agent that generated this response.
AgentID string `json:",omitzero"`
// ID identifies this response.
ID string `json:",omitzero"`
// CreatedAt is the timestamp for the response. It is zero when the provider
// did not supply a creation time.
CreatedAt time.Time `json:",omitzero"`
// ContinuationToken is used to continue a background response. When present,
// pass it to a later run with [WithContinuationToken] to poll for completion
// or resume streaming, depending on the provider.
ContinuationToken string `json:",omitzero"`
// FinishReason describes why the agent stopped generating. Common values are
// "stop", "length", and "tool_calls". It is empty when the provider did not
// supply a finish reason.
FinishReason string `json:",omitzero"`
// RawRepresentation stores the provider-specific object or objects that
// produced this response.
RawRepresentation any `json:"-"`
// Messages contains the messages produced by the agent run.
Messages []*message.Message
}
Response represents the complete result of an Agent run.
A Response is the non-streaming counterpart to ResponseUpdate. Streaming runs can be collected into a Response with ResponseStream.Collect, which merges updates that belong to the same logical message and coalesces adjacent content items where possible.
func (*Response) Coalesce ¶
func (resp *Response) Coalesce()
Coalesce merges adjacent compatible content items within each message.
func (*Response) Contents ¶
Contents returns a sequence of all the contents in the response, across all messages. The contents are returned in the order they were added to the response.
func (*Response) String ¶
String returns the concatenated text of all TextContent items across the response messages.
func (*Response) ToUpdates ¶
func (resp *Response) ToUpdates() []*ResponseUpdate
ToUpdates converts this response into response updates suitable for streaming scenarios.
Each message in the response becomes a separate update. Response-level additional properties and a non-empty continuation token are included as an additional metadata-only update when present.
func (*Response) Update ¶
func (resp *Response) Update(update *ResponseUpdate)
Update folds a streaming ResponseUpdate into resp, appending its contents to the matching message and updating response-level fields from later updates.
func (*Response) Usage ¶
func (resp *Response) Usage() message.UsageDetails
Usage returns the token usage aggregated (summed) across all of the response's messages.
type ResponseFormat ¶
type ResponseFormat struct {
// Kind is the format type.
// For example, "text" or "json".
Kind string
Name string
Description string
Strict bool
// Schema is the schema that defines the format.
Schema any
}
ResponseFormat represents the response format that is desired by the caller.
type ResponseStream ¶
type ResponseStream iter.Seq2[*ResponseUpdate, error]
ResponseStream represents an execution of the agent.
func (ResponseStream) Collect ¶
func (r ResponseStream) Collect() (*Response, error)
Collect gathers all response updates into a single Response object.
type ResponseUpdate ¶
type ResponseUpdate struct {
// RawRepresentation stores the provider-specific object that produced this
// update. It is useful for debugging or for consumers that need to access the
// underlying provider model.
RawRepresentation any `json:"-"`
// AdditionalProperties contains provider-specific metadata associated with
// the update that does not fit the standard response-update schema.
AdditionalProperties map[string]any `json:",omitzero"`
// AgentID identifies the agent that produced this update.
AgentID string
// MessageID identifies the message of which this update is a part. Updates
// with the same non-empty MessageID are merged into the same message when
// collected into a [Response].
MessageID string
// ResponseID identifies the response of which this update is a part.
ResponseID string
// FinishReason is the reason the generation ended. It is typically set only
// on the final update of a stream. Common values are "stop", "length", and
// "tool_calls".
FinishReason string `json:",omitzero"`
// AuthorName is the display name of the author or agent that produced this update.
AuthorName string `json:",omitzero"`
// Role is the role of the update author.
Role message.Role `json:",omitzero"`
// ContinuationToken is used to continue the streamed response. When present,
// pass the latest token to a later run with [WithContinuationToken] to resume
// or poll for the same background response, depending on the provider.
ContinuationToken string `json:",omitzero"`
// CreatedAt is the timestamp for this update. It is zero when the provider
// did not supply a creation time.
CreatedAt time.Time `json:",omitzero"`
// Contents contains the content items carried by this update.
Contents message.Contents `json:",omitzero"`
}
ResponseUpdate represents a single streaming response chunk from an Agent.
Updates layer on each other to form a Response. A single update may contain content for a message, metadata about the response, a continuation token for background work, or any combination of those values. To get the text for the update, call ResponseUpdate.String.
func (*ResponseUpdate) String ¶
func (r *ResponseUpdate) String() string
String returns the concatenated text contents of the response messages.
func (*ResponseUpdate) Usage ¶
func (m *ResponseUpdate) Usage() message.UsageDetails
Usage returns the token usage carried by this update's UsageContent items.
type RunFunc ¶
type RunFunc = func(ctx context.Context, messages []*message.Message, options ...Option) iter.Seq2[*ResponseUpdate, error]
RunFunc is the provider function that executes an agent invocation. Implementations must treat the message and option slices, and existing messages, as read-only. Clone them before making changes.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session contains the state of a specific conversation with an agent which may include:
- Conversation history or a reference to externally stored conversation history.
- Memories or a reference to externally stored memories.
- Any other state that the agent needs to persist across runs for a conversation.
Agent behaviors such as history and context providers live on the agent and store their state in the Session. The zero value is ready to use. Agent.CreateSession can be used when a provider needs to configure provider-specific session state before the first run.
Because provider-specific state can be associated with the agent that created it, a Session may not be reusable across different agents.
To support conversations that may need to survive application restarts or separate service requests, a Session can be serialized and deserialized directly with encoding/json, so that it can be saved in a persistent store.
func (*Session) Get ¶
Get attempts to read the value associated with key into value.
It returns ok=true only when the value exists and can be read into the destination type. It returns ok=false with a nil error when the key is missing or the stored value cannot be read as the requested type.
value must be a non-nil pointer to the desired destination type.
func (Session) MarshalJSON ¶
func (*Session) ServiceID ¶
ServiceID returns the provider-specific identifier associated with the session.
func (*Session) Set ¶
Set stores a value in the session state under the given key. If the key already exists, its value is overwritten.
func (*Session) SetServiceID ¶
SetServiceID sets the provider-specific identifier associated with the session.
func (*Session) UnmarshalJSON ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package compaction reduces conversation history to fit a model's context window.
|
Package compaction reduces conversation history to fit a model's context window. |
|
format
|
|
|
jsonformat
Package jsonformat provides JSON schema-based response formatting and validation for structured agent output, deriving schemas from Go types and validating and normalizing values against them.
|
Package jsonformat provides JSON schema-based response formatting and validation for structured agent output, deriving schemas from Go types and validating and normalizing values against them. |
|
harness
|
|
|
agentmode
Package agentmode provides a context provider that tracks the agent's operating mode (e.g.
|
Package agentmode provides a context provider that tracks the agent's operating mode (e.g. |
|
loop
Package loop provides middleware that re-invokes an agent until one of its evaluators decides no more work is needed.
|
Package loop provides middleware that re-invokes an agent until one of its evaluators decides no more work is needed. |
|
todo
Package todo provides a context provider that gives agents todo list management tools for tracking work items during long-running complex tasks.
|
Package todo provides a context provider that gives agents todo list management tools for tracking work items during long-running complex tasks. |
|
toolapproval
Package toolapproval provides middleware that manages human-in-the-loop tool approval with support for "don't ask again" standing rules.
|
Package toolapproval provides middleware that manages human-in-the-loop tool approval with support for "don't ask again" standing rules. |
|
toolautocall
Package toolautocall provides the middleware that automatically invokes the function tools a model calls and feeds their results back for the next turn.
|
Package toolautocall provides the middleware that automatically invokes the function tools a model calls and feeds their results back for the next turn. |
|
Package skills provides domain knowledge bases ("skills") an agent can load on demand.
|
Package skills provides domain knowledge bases ("skills") an agent can load on demand. |
|
fsskills
Package fsskills discovers and loads skills from a filesystem (an fs.FS), materializing skill directories, their resources, and file-backed scripts as skills.Skill values.
|
Package fsskills discovers and loads skills from a filesystem (an fs.FS), materializing skill directories, their resources, and file-backed scripts as skills.Skill values. |