Documentation
¶
Index ¶
- type AcceptResult
- type ChatRequest
- type ChatResponse
- type InteractionAction
- type InteractionHandler
- type Options
- type RunRequest
- type Service
- func (s *Service) AgentRepo() *agentrepo.Repository
- func (s *Service) Chat(ctx context.Context, req ChatRequest) (*ChatResponse, error)
- func (s *Service) EnrichToolDefinition(def *llm.ToolDefinition)
- func (s *Service) EnrichedToolDefinitions() []llm.ToolDefinition
- func (s *Service) ExecuteTool(ctx context.Context, req ToolRequest) (*ToolResponse, error)
- func (s *Service) ExecuteWorkflow(ctx context.Context, req WorkflowRequest) (*WorkflowResponse, error)
- func (s *Service) FeednRepo() *extrepo.Repository
- func (s *Service) MCPRepo() *mcprepo.Repository
- func (s *Service) ModelRepo() *modelrepo.Repository
- func (s *Service) OAuthRepo() *oauthrepo.Repository
- func (s *Service) ResetModel(ctx context.Context, agentId string) error
- func (s *Service) Run(ctx context.Context, req RunRequest) (*agentpkg.QueryOutput, error)
- func (s *Service) SwitchModel(ctx context.Context, agentId, modelName string) error
- func (s *Service) ToolDefinitions() []llm.ToolDefinition
- func (s *Service) WorkflowRepo() *workflowrepo.Repository
- type ToolRequest
- type ToolResponse
- type WorkflowRequest
- type WorkflowResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptResult ¶
type AcceptResult struct {
Action InteractionAction
Payload json.RawMessage
RedirectURL string
}
AcceptResult summarises the result of asking the user.
Action – what the user decided (accept/decline/timeout). Payload – JSON document to resubmit when Action==accept. RedirectURL – optional browser URL (useful for MCP UA flows).
type ChatRequest ¶
type ChatRequest struct {
ConversationID string
AgentPath string
Query string
UserId string
// Optional context object forwarded to QueryInput so that the agent can
// incorporate caller supplied metadata (e.g. project, user location, etc.).
Context map[string]interface{}
Policy *tool.Policy
Timeout time.Duration
// Attachments are optional assets to include in this turn (e.g. images).
// They are forwarded to the underlying LLM request as user content items.
Attachments []*promptpkg.Attachment
}
ChatRequest and ChatResponse remain same
type ChatResponse ¶
type InteractionAction ¶
type InteractionAction string
InteractionAction enumerates the high-level outcome of an interaction.
const ( ActionAccept InteractionAction = "accept" // user provided payload ActionDecline InteractionAction = "decline" // user explicitly declined ActionTimeout InteractionAction = "timeout" // no answer until ctx done )
type InteractionHandler ¶
type InteractionHandler interface {
Accept(ctx context.Context, el *plan.Elicitation) (AcceptResult, error)
}
InteractionHandler resolves an elicitation request through any UX channel. Implementations may block (CLI) or return immediately (HTTP).
type Options ¶
type Options struct {
Interaction InteractionHandler // optional
}
Options configures behaviour of Service.
type RunRequest ¶
type RunRequest struct {
Input *agentpkg.QueryInput // required
Policy *tool.Policy
Timeout time.Duration
}
RunRequest represents a one-shot workflow execution request using the extended QueryInput structure (location, documents, limits, …).
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service exposes high-level operations (currently Chat) that are decoupled from any particular user-interface.
func New ¶
New returns a Service using the supplied executor.Service. Ownership of exec is left to the caller – Service does not Stop()/Shutdown() it.
func (*Service) Chat ¶
func (s *Service) Chat(ctx context.Context, req ChatRequest) (*ChatResponse, error)
Chat executes an interactive turn, optionally looping on elicitation when an InteractionHandler is configured.
func (*Service) EnrichToolDefinition ¶
func (s *Service) EnrichToolDefinition(def *llm.ToolDefinition)
EnrichToolDefinition mutates def in place, replacing its Parameters with an enriched copy when overlays match.
func (*Service) EnrichedToolDefinitions ¶
func (s *Service) EnrichedToolDefinitions() []llm.ToolDefinition
EnrichedToolDefinitions exposes the executor definitions with overlay enrichment so that REST workspace handler returns UI-ready schemas.
func (*Service) ExecuteTool ¶
func (s *Service) ExecuteTool(ctx context.Context, req ToolRequest) (*ToolResponse, error)
ExecuteTool delegates to the underlying executor's tool registry.
func (*Service) ExecuteWorkflow ¶
func (s *Service) ExecuteWorkflow(ctx context.Context, req WorkflowRequest) (*WorkflowResponse, error)
ExecuteWorkflow loads the workflow located at req.Location and executes it using the shared runtime. When TaskID is empty the entire workflow is run; otherwise only the specified task is executed. The method waits until completion or timeout.
func (*Service) FeednRepo ¶ added in v0.2.1
func (s *Service) FeednRepo() *extrepo.Repository
func (*Service) MCPRepo ¶
func (s *Service) MCPRepo() *mcprepo.Repository
func (*Service) ModelRepo ¶
func (s *Service) ModelRepo() *modelrepo.Repository
Repositories expose typed accessors
func (*Service) ResetModel ¶
ResetModel clears modelRef so the agent uses executor default.
func (*Service) Run ¶
func (s *Service) Run(ctx context.Context, req RunRequest) (*agentpkg.QueryOutput, error)
Run executes the provided workflow and returns the raw QueryOutput. No elicitation loop is attempted – caller is responsible for checking output.Elicitation.
func (*Service) SwitchModel ¶
SwitchModel sets the default modelRef for a given agent configuration.
func (*Service) ToolDefinitions ¶
func (s *Service) ToolDefinitions() []llm.ToolDefinition
ToolDefinitions returns available tool definitions (read-only) gathered from the executor’s registry.
func (*Service) WorkflowRepo ¶
func (s *Service) WorkflowRepo() *workflowrepo.Repository
type ToolRequest ¶
type ToolRequest struct {
Name string // fully qualified tool name
Args map[string]interface{} // JSON-compatible arguments
Timeout time.Duration // optional per call timeout
}
ToolRequest parameters for executing a single tool.
type ToolResponse ¶
type ToolResponse struct {
Result interface{}
}
type WorkflowRequest ¶
type WorkflowRequest struct {
// Location points to a YAML/JSON workflow definition. It can be an
// absolute URL, a filesystem path or a relative path resolved by the
// executor's meta service.
Location string
// TaskID optionally limits execution to a single task inside the
// workflow (via Runtime.RunTaskOnce). Leave empty to run the whole
// process from the workflow's root node(s).
TaskID string
// Input passed as the execution input or initial state.
Input interface{}
// Timeout caps the total execution time. Zero means no timeout.
Timeout time.Duration
}
WorkflowRequest is retained for backward compatibility. In decoupled mode, workflow execution is not available and requests will return an error.
type WorkflowResponse ¶
type WorkflowResponse struct {
Output interface{}
Usage *usage.Aggregator
}
WorkflowResponse captures the execution result.