Documentation
¶
Index ¶
- func Runtime(reg Registry, llm LLMClient, mcp MCPClient, convStore ConversationStore, ...) *runtime
- type AgentRequest
- type AgentResponse
- type Attachment
- type ConversationStore
- type DecisionInfo
- type KnowledgeBaseStore
- type LLMClient
- type LLMConfig
- type LLMResponse
- type MCPClient
- type ModHandle
- type NsHandle
- type NsModResolver
- type Registry
- type TAQService
- type Tool
- type ToolCall
- type ToolCallInfo
- type Usage
- type WorkflowService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Runtime ¶
func Runtime(reg Registry, llm LLMClient, mcp MCPClient, convStore ConversationStore, kb KnowledgeBaseStore, ns knowledge.NamespaceLookup, mod knowledge.ModuleLookup, obs *observability.Bus) *runtime
Runtime creates a new Agent Runtime.
Types ¶
type AgentRequest ¶
type AgentRequest struct {
AgentID uint64 `json:"agentID,string"`
Input string `json:"input"`
ConversationID uint64 `json:"conversationID,string"`
ExecContext map[string]any `json:"execContext"` // User/system context
Attachments []Attachment `json:"attachments"`
}
AgentRequest represents the input for an agent execution.
type AgentResponse ¶
type AgentResponse struct {
Output string `json:"output"`
ConversationID uint64 `json:"conversationID,string"`
ToolCalls []ToolCallInfo `json:"toolCalls"`
Decisions []DecisionInfo `json:"decisions"`
Usage Usage `json:"usage"`
Context string `json:"context,omitempty"`
}
AgentResponse represents the output of an agent execution.
type Attachment ¶
type Attachment struct {
Name string `json:"name"`
MediaType string `json:"mediaType"`
Content []byte `json:"content"` // Or a stream/reader if needed
}
Attachment represents a file or image attached to the request.
type ConversationStore ¶
type ConversationStore interface {
FindByID(ctx context.Context, ID uint64) (*types.AiConversation, error)
Create(ctx context.Context, new *types.AiConversation) (*types.AiConversation, error)
Update(ctx context.Context, upd *types.AiConversation) (*types.AiConversation, error)
DeleteByID(ctx context.Context, ID uint64) error
}
ConversationStore manages conversation persistence. Satisfied by system/service.AiConversation().
type DecisionInfo ¶
type KnowledgeBaseStore ¶
type LLMClient ¶
type LLMClient interface {
// Chat interacts with the LLM.
// It takes the agent definition (for system prompt/config), current history, and available tools.
Chat(ctx context.Context, prompt string, history []types.AiConversationMessage, tools []Tool, config LLMConfig) (*LLMResponse, error)
}
LLMClient abstracts the LLM provider.
type LLMResponse ¶
type MCPClient ¶
type MCPClient interface {
// GetTools returns tools filtered to the agent's allowed tool list.
GetTools(ctx context.Context, allowedTools []string) ([]Tool, error)
// ExecuteTool executes a specific tool.
ExecuteTool(ctx context.Context, toolName string, args map[string]any) (any, error)
}
MCPClient abstracts the Model Context Protocol tools.
type NsModResolver ¶
type TAQService ¶
type ToolCallInfo ¶
type ToolCallInfo struct {
Tool string `json:"tool"`
Args map[string]any `json:"args"`
Result any `json:"result"`
Error string `json:"error,omitempty"`
DurationMs int `json:"durationMs"`
}
ToolCallInfo describes a tool call that was executed.
Click to show internal directories.
Click to hide internal directories.