Documentation
¶
Index ¶
- type Agent
- func (a *Agent) EnsureSpaceGrants(sessionID string, spaces []string)
- func (a *Agent) Flush(ctx context.Context, sessionID string) error
- func (a *Agent) Generate(ctx context.Context, sessionID, userInput string) (string, error)
- func (a *Agent) GenerateWithFiles(ctx context.Context, sessionID string, userInput string, files []models.File) (string, error)
- func (a *Agent) RetrieveAttachmentFiles(ctx context.Context, sessionID string, limit int) ([]models.File, error)
- func (agent *Agent) Save(ctx context.Context, role, content string)
- func (a *Agent) SessionMemory() *memory.SessionMemory
- func (a *Agent) SetSharedSpaces(shared *memory.SharedSession)
- func (a *Agent) SubAgents() []SubAgent
- func (a *Agent) ToolSpecs() []ToolSpec
- func (a *Agent) Tools() []Tool
- type Options
- type QueryType
- type StaticSubAgentDirectory
- type StaticToolCatalog
- type SubAgent
- type SubAgentDirectory
- type Tool
- type ToolCatalog
- type ToolRequest
- type ToolResponse
- type ToolSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
UTCPClient utcp.UtcpClientInterface
// contains filtered or unexported fields
}
Agent orchestrates model calls, memory, tools, and sub-agents.
func (*Agent) EnsureSpaceGrants ¶
EnsureSpaceGrants gives the provided sessionID writer access to each space. This mirrors how tests set up spaces: mem.Spaces.Grant(space, session, role, ttl).
func (*Agent) GenerateWithFiles ¶
func (a *Agent) GenerateWithFiles( ctx context.Context, sessionID string, userInput string, files []models.File, ) (string, error)
GenerateWithFiles sends the user message plus in-memory files to the model without ingesting them into long-term memory. Use this when you already have file bytes (e.g., uploaded via API) and want the model to consider them ephemerally for this turn only.
func (*Agent) RetrieveAttachmentFiles ¶
func (a *Agent) RetrieveAttachmentFiles(ctx context.Context, sessionID string, limit int) ([]models.File, error)
RetrieveAttachmentFiles returns attachment files stored for the session. It reconstructs the original bytes from base64-encoded metadata, making it suitable for binary assets such as images and videos.
func (*Agent) Save ¶
Save stores a conversation turn into all shared spaces. role should be "user" or "agent".
func (*Agent) SessionMemory ¶
func (a *Agent) SessionMemory() *memory.SessionMemory
SessionMemory exposes the underlying session memory (useful for advanced setup/tests).
func (*Agent) SetSharedSpaces ¶
func (a *Agent) SetSharedSpaces(shared *memory.SharedSession)
type Options ¶
type Options struct {
Model models.Agent
Memory *memory.SessionMemory
SystemPrompt string
ContextLimit int
Tools []Tool
SubAgents []SubAgent
ToolCatalog ToolCatalog
SubAgentDirectory SubAgentDirectory
UTCPClient utcp.UtcpClientInterface
}
Options configure a new Agent.
type StaticSubAgentDirectory ¶
type StaticSubAgentDirectory struct {
// contains filtered or unexported fields
}
StaticSubAgentDirectory is the default SubAgentDirectory implementation.
func NewStaticSubAgentDirectory ¶
func NewStaticSubAgentDirectory(subagents []SubAgent) *StaticSubAgentDirectory
NewStaticSubAgentDirectory constructs a directory from the provided sub-agents.
func (*StaticSubAgentDirectory) All ¶
func (d *StaticSubAgentDirectory) All() []SubAgent
All returns the registered sub-agents in registration order.
func (*StaticSubAgentDirectory) Lookup ¶
func (d *StaticSubAgentDirectory) Lookup(name string) (SubAgent, bool)
Lookup retrieves a sub-agent by name.
func (*StaticSubAgentDirectory) Register ¶
func (d *StaticSubAgentDirectory) Register(subAgent SubAgent) error
Register adds a sub-agent to the directory. Duplicate names return an error.
type StaticToolCatalog ¶
type StaticToolCatalog struct {
// contains filtered or unexported fields
}
StaticToolCatalog is the default in-memory implementation of ToolCatalog used by the runtime.
func NewStaticToolCatalog ¶
func NewStaticToolCatalog(tools []Tool) *StaticToolCatalog
NewStaticToolCatalog constructs a catalog seeded with the provided tools.
func (*StaticToolCatalog) Lookup ¶
func (c *StaticToolCatalog) Lookup(name string) (Tool, ToolSpec, bool)
Lookup returns the tool and its specification if present.
func (*StaticToolCatalog) Register ¶
func (c *StaticToolCatalog) Register(tool Tool) error
Register adds a tool to the catalog using a lower-cased key. Duplicate names return an error.
func (*StaticToolCatalog) Specs ¶
func (c *StaticToolCatalog) Specs() []ToolSpec
Specs returns a snapshot of the tool specifications in registration order.
func (*StaticToolCatalog) Tools ¶
func (c *StaticToolCatalog) Tools() []Tool
Tools returns the registered tools in order.
type SubAgent ¶
type SubAgent interface {
Name() string
Description() string
Run(ctx context.Context, input string) (string, error)
}
SubAgent represents a specialist agent that can be delegated work.
type SubAgentDirectory ¶
type SubAgentDirectory interface {
Register(subAgent SubAgent) error
Lookup(name string) (SubAgent, bool)
All() []SubAgent
}
SubAgentDirectory stores sub-agents by name while preserving insertion order.
type Tool ¶
type Tool interface {
Spec() ToolSpec
Invoke(ctx context.Context, req ToolRequest) (ToolResponse, error)
}
Tool exposes structured metadata and an invocation handler.
type ToolCatalog ¶
type ToolCatalog interface {
Register(tool Tool) error
Lookup(name string) (Tool, ToolSpec, bool)
Specs() []ToolSpec
Tools() []Tool
}
ToolCatalog maintains an ordered set of tools and provides lookup by name.
type ToolRequest ¶
ToolRequest captures an invocation request for a tool.
type ToolResponse ¶
ToolResponse represents the structured response returned by a tool.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
app
command
main.go — fixed agent-mode with provider flag Runs your Agent with optional file context using GenerateWithFiles.
|
main.go — fixed agent-mode with provider flag Runs your Agent with optional file context using GenerateWithFiles. |
|
example
command
main.go — fixed agent-mode with provider flag, Postgres memory + CreateSchema Runs your Agent with optional file context using GenerateWithFiles.
|
main.go — fixed agent-mode with provider flag, Postgres memory + CreateSchema Runs your Agent with optional file context using GenerateWithFiles. |
|
quickstart
command
main.go — guided swarm quickstart wiring ADK agents into the CLI.
|
main.go — guided swarm quickstart wiring ADK agents into the CLI. |
|
team
command
main.go — multi-agent swarm orchestrator with shared memory spaces.
|
main.go — multi-agent swarm orchestrator with shared memory spaces. |
|
src
|
|