Documentation
¶
Index ¶
- Constants
- func WithBundleRepo(r *toolbundlerepo.Repository) func(*Service)
- func WithConversationClient(c apiconv.Client) func(*Service)
- func WithProfileRepo(r *promptrepo.Repository) func(*Service)
- func WithTemplateRepo(r *tplrepo.Repository) func(*Service)
- type ClassificationContext
- type Context
- type DirectActionContext
- type DirectActionExecutionContext
- type PlannerContext
- type PromptingContext
- type RoutingContext
- type RunOption
- type ScopeContext
- type Service
- type TranscriptMessage
Constants ¶
const ( SourceWorkspace = "workspace" SourceAgent = "agent" SourceReused = "reused" SourceCallerProvided = "caller-provided" SourceFallback = "fallback" )
Source values for Context.Source. Centralized so the runtime, intake services, and observability subscribers all reference the same constants.
const ( ModeRoute = "route" ModeClarify = "clarify" ModePlanner = "planner" )
Mode values for Context.Mode. Workspace intake's classification result.
const ContextKey = "intake.turnContext"
ContextKey is the key used to store Context in QueryInput.Context.
Variables ¶
This section is empty.
Functions ¶
func WithBundleRepo ¶
func WithBundleRepo(r *toolbundlerepo.Repository) func(*Service)
func WithConversationClient ¶ added in v0.1.11
func WithProfileRepo ¶
func WithProfileRepo(r *promptrepo.Repository) func(*Service)
func WithTemplateRepo ¶ added in v0.1.8
func WithTemplateRepo(r *tplrepo.Repository) func(*Service)
Types ¶
type ClassificationContext ¶ added in v0.1.8
type Context ¶ added in v0.1.8
type Context struct {
Classification ClassificationContext `json:"classification,omitempty"`
Scope ScopeContext `json:"scope,omitempty"`
Prompting PromptingContext `json:"prompting,omitempty"`
DirectAction DirectActionContext `json:"directAction,omitempty"`
DirectActionExecution DirectActionExecutionContext `json:"directActionExecution,omitempty"`
Routing RoutingContext `json:"routing,omitempty"`
Planner PlannerContext `json:"planner,omitempty"`
}
Context is the structured output of intake. It is grouped by feature area so routing, scope extraction, prompting hints, and planner state do not bleed together as unrelated top-level keys.
func FromContext ¶ added in v0.1.8
FromContext retrieves a Context previously stored under ContextKey. Returns nil when missing or the stored value has the wrong type.
func StoreCallerProvided ¶ added in v0.1.8
StoreCallerProvided records a caller-supplied Context into the QueryInput context map under the well-known ContextKey. The stored value is a copy (so later mutation of the caller's struct does not race with the runtime), annotated with Source = SourceCallerProvided. The runtime's intake skip rule then sees a non-nil Context under the key and bypasses the intake-sidecar LLM call (see service/agent/intake_query.go).
ctxMap is the QueryInput.Context map (lazy-initialized when nil). Returns the resulting (possibly newly-allocated) map and a pointer to the stored copy.
type DirectActionContext ¶ added in v0.1.9
type DirectActionContext struct {
ToolName string `json:"toolName,omitempty"`
Input map[string]interface{} `json:"input,omitempty"`
InputJSON string `json:"inputJson,omitempty"`
AssistantText string `json:"assistantText,omitempty"`
}
func NormalizeClassifierDirectAction ¶ added in v0.1.13
func NormalizeClassifierDirectAction(action *DirectActionContext) DirectActionContext
type DirectActionExecutionContext ¶ added in v0.1.9
type PlannerContext ¶ added in v0.1.8
type PromptingContext ¶ added in v0.1.8
type RoutingContext ¶ added in v0.1.8
type RunOption ¶ added in v0.1.10
type RunOption func(*runOptions)
RunOption customizes a single intake sidecar call.
func WithTranscript ¶ added in v0.1.10
func WithTranscript(messages []TranscriptMessage) RunOption
WithTranscript provides recent visible user/assistant transcript context for the current intake call. Intake uses it to resolve elided follow-up requests while still classifying the current user message as the active request.
type ScopeContext ¶ added in v0.1.8
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service runs the intake sidecar LLM call and returns an intake Context.
func (*Service) Run ¶
func (s *Service) Run(ctx context.Context, userMessage string, cfg *agentmdl.Intake, userID string, opts ...RunOption) *Context
Run executes the intake sidecar for the given user message and agent config. Returns nil when the sidecar is not enabled or a non-fatal error occurs (callers always proceed with the turn regardless).
type TranscriptMessage ¶ added in v0.1.10
TranscriptMessage is a compact, generic transcript row provided to intake. It intentionally carries only speaker role and visible text content so workspace-specific state and internal execution details stay out of the framework contract.