Documentation
¶
Index ¶
- Constants
- Variables
- func FastTriagePrompt() string
- func OpsPrompt(page, lang string, enabledGroups []string) string
- func SetBuilder(build func(tenantID string) *Agent)
- func TriagePrompt() string
- type Agent
- type CapabilityGroup
- type CompletionRequest
- type CompletionResponse
- type Event
- type EventKind
- type EventSink
- type LLMClient
- type LLMConfig
- type Message
- type Role
- type RunResult
- type RunTask
- type ToolBroker
- type ToolCall
- type ToolResult
- type ToolSpec
Constants ¶
const EscalateSentinel = "NEEDS_INVESTIGATION:"
EscalateSentinel is the exact reply FastTriagePrompt asks for when the alert and its deterministic score aren't enough to classify confidently. The queue checks for this literal prefix to decide whether to fall back to the full agentic TriagePrompt (which has investigation tools).
Variables ¶
var ErrLLMRateLimited = errors.New("rate limit reached — upgrade to Enterprise for higher usage limits")
Functions ¶
func FastTriagePrompt ¶
func FastTriagePrompt() string
FastTriagePrompt is the default triage path: one completion, no tools. The deterministic score is computed in Go before this prompt ever runs (see the queue's ScoreAlert call) and handed over as plain context, not as something the model decides whether to fetch — that decision was never really a choice, so it shouldn't cost a round trip. Writing the resulting note is also done in Go from this reply, not via a tool call. The only way this path costs more than one LLM call is the model asking to escalate, which is exactly the case where more calls are warranted.
func SetBuilder ¶
func TriagePrompt ¶
func TriagePrompt() string
TriagePrompt is the escalation path: a full agentic pass with investigation tools, used only when FastTriagePrompt asked to escalate. The score is still handed over as pre-computed context here too — it is never a tool call in either path.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func New ¶
func New(llm LLMClient, broker *ToolBroker, model string, maxTokens, contextWindow int) *Agent
func (*Agent) Broker ¶
func (a *Agent) Broker() *ToolBroker
func (*Agent) QuickComplete ¶
QuickComplete runs a single, tool-free LLM completion — the non-agentic fast path for a task that doesn't need investigation, like classifying an alert that already carries its deterministic score. It never loops and never offers tools, so it costs exactly one LLM call no matter what the model answers.
type CapabilityGroup ¶
type CompletionRequest ¶
type CompletionResponse ¶
type LLMClient ¶
type LLMClient interface {
Complete(ctx context.Context, req CompletionRequest) (CompletionResponse, error)
Provider() string
}
func NewLLMClient ¶
type LLMConfig ¶
type LLMConfig struct {
Provider string // "anthropic" → Anthropic wire format; anything else → OpenAI-compatible
URL string // full endpoint
Model string
APIKey string
AuthType string // bearer | header | none
AuthHeaderName string // header name when AuthType == "header"
CustomHeaders map[string]string
}
type Message ¶
type Message struct {
Role Role
Content string
ToolCalls []ToolCall // set on assistant turns that call tools
ToolResult *ToolResult // set on tool turns (one per message)
}
type ToolBroker ¶
type ToolBroker struct {
// contains filtered or unexported fields
}
func NewToolBroker ¶
func NewToolBroker(backendURL, internalKey, tenantID string) *ToolBroker
func (*ToolBroker) Call ¶
func (b *ToolBroker) Call(ctx context.Context, name string, args json.RawMessage) (string, bool, error)
func (*ToolBroker) Close ¶
func (b *ToolBroker) Close()