agents

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NilCallback added in v0.1.11

func NilCallback(msg *responses.ResponseChunk)

Types

type A2A added in v0.1.1

type A2A struct {
	InvokeHandler    http.Handler
	AgentCardHandler http.Handler
	// contains filtered or unexported fields
}

func (*A2A) Cancel added in v0.1.1

func (*A2A) Cancel(ctx context.Context, reqCtx *a2asrv.RequestContext, q eventqueue.Queue) error

func (*A2A) Execute added in v0.1.1

func (agent *A2A) Execute(ctx context.Context, reqCtx *a2asrv.RequestContext, q eventqueue.Queue) error

type Accumulator

type Accumulator struct {
}

func (*Accumulator) ReadStream

func (a *Accumulator) ReadStream(stream chan *responses.ResponseChunk, cb func(chunk *responses.ResponseChunk)) (*responses.Response, error)

type Agent

type Agent struct {
	Name string
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent(opts *AgentOptions) *Agent

func (*Agent) A2A added in v0.1.1

func (a *Agent) A2A(agentCard *a2a.AgentCard) *A2A

func (*Agent) Execute

func (e *Agent) Execute(ctx context.Context, in *AgentInput) (*AgentOutput, error)

func (*Agent) ExecuteWithExecutor

func (e *Agent) ExecuteWithExecutor(ctx context.Context, in *AgentInput, cb func(chunk *responses.ResponseChunk)) (*AgentOutput, error)

func (*Agent) GetRunID added in v0.1.11

func (e *Agent) GetRunID(ctx context.Context) string

func (*Agent) PrepareMCPTools added in v0.1.11

func (e *Agent) PrepareMCPTools(ctx context.Context, runContext map[string]any) ([]core.Tool, error)

func (*Agent) WithLLM added in v0.1.11

func (e *Agent) WithLLM(wrappedLLM LLM) *Agent

type AgentInput

type AgentInput struct {
	Namespace         string                               `json:"namespace"`
	PreviousMessageID string                               `json:"previous_message_id"`
	Messages          []responses.InputMessageUnion        `json:"messages"`
	RunContext        map[string]any                       `json:"run_context"`
	Callback          func(chunk *responses.ResponseChunk) `json:"-"`
	StreamBroker      core.StreamBroker                    `json:"-"`
}

type AgentOptions

type AgentOptions struct {
	History     *history.CommonConversationManager
	Instruction core.SystemPromptProvider
	Parameters  responses.Parameters

	Name       string
	LLM        llm.Provider
	Output     map[string]any
	Tools      []core.Tool
	McpServers []MCPToolset
	Runtime    AgentRuntime
	MaxLoops   int
}

type AgentOutput

type AgentOutput struct {
	RunID            string                          `json:"run_id"`
	Status           core.RunStatus                  `json:"status"`
	Output           []responses.InputMessageUnion   `json:"output"`
	PendingApprovals []responses.FunctionCallMessage `json:"pending_approvals"`
}

AgentOutput represents the result of agent execution

type AgentRuntime

type AgentRuntime interface {
	Run(ctx context.Context, agent *Agent, in *AgentInput) (*AgentOutput, error)
}

type LLM added in v0.1.11

type LLM interface {
	NewStreamingResponses(ctx context.Context, in *responses.Request, cb func(chunk *responses.ResponseChunk)) (*responses.Response, error)
}

type MCPToolset added in v0.1.11

type MCPToolset interface {
	GetName() string
	ListTools(ctx context.Context, runContext map[string]any) ([]core.Tool, error)
}

type WrappedLLM added in v0.1.11

type WrappedLLM struct {
	// contains filtered or unexported fields
}

func (*WrappedLLM) NewStreamingResponses added in v0.1.11

func (l *WrappedLLM) NewStreamingResponses(ctx context.Context, in *responses.Request, cb func(chunk *responses.ResponseChunk)) (*responses.Response, error)

Jump to

Keyboard shortcuts

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