routing

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package routing provides query routing and classification for cloud services.

Index

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

func ClassifyWithLLM(ctx context.Context, question string, debug bool) (string, error)

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

func GetClassificationPrompt(question string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL