Documentation
¶
Overview ¶
Package routing provides query routing and classification for cloud services.
Index ¶
- func ApplyLLMClassification(ctx *ServiceContext, llmService string)
- func ClassifyWithLLM(ctx context.Context, question string, debug bool) (string, error)
- func DefaultInfraProvider() string
- func GetClassificationPrompt(question string) string
- func NeedsLLMClassification(ctx ServiceContext) bool
- type Classification
- type ServiceContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyLLMClassification ¶
func ApplyLLMClassification(ctx *ServiceContext, llmService string)
ApplyLLMClassification updates the ServiceContext based on LLM classification result
func ClassifyWithLLM ¶
ClassifyWithLLM uses the AI client to determine which service a query is about. Returns the service name and any error encountered.
func DefaultInfraProvider ¶ added in v0.0.6
func DefaultInfraProvider() string
DefaultInfraProvider returns the configured default infrastructure provider. Falls back to AWS for backward compatibility.
func GetClassificationPrompt ¶
GetClassificationPrompt returns a prompt for LLM to classify which service a query is about
func NeedsLLMClassification ¶
func NeedsLLMClassification(ctx ServiceContext) bool
NeedsLLMClassification determines if a query needs LLM classification based on ambiguity (multiple services detected) or Cloudflare being inferred.
Types ¶
type Classification ¶
type Classification struct {
Service string `json:"service"`
Confidence string `json:"confidence"`
Reason string `json:"reason"`
}
Classification represents the result of LLM-based query classification
type ServiceContext ¶
type ServiceContext struct {
AWS bool
GitHub bool
Terraform bool
K8s bool
GCP bool
Azure bool
Cloudflare bool
DigitalOcean bool
Hetzner bool
Vercel bool
Railway bool
Verda bool
IAM bool
Code bool
}
ServiceContext represents which services were detected in a query
func InferContext ¶
func InferContext(question string) ServiceContext
InferContext analyzes a question and determines which cloud service contexts are relevant. Returns a ServiceContext with boolean flags for each detected service.