Documentation
¶
Index ¶
- Constants
- func BuildLlamaServerArgs(opts LlamaServerOptions) []string
- func CachedHFModelPath(cacheDir, repo, revision, file string) (string, error)
- func CompareFixtureOutput(output Output, expected FixtureExpected) []string
- func FailureKind(err error) string
- func IsUnavailable(localJudge Judge) bool
- func ResolveLlamaServerModel(ctx context.Context, opts LlamaServerOptions) (string, error)
- func ValidateOutput(output Output) error
- type Decision
- type DownloadProgress
- type DownloadProgressEvent
- type DownloadProgressHandler
- type Error
- type Fixture
- type FixtureDeterministicRule
- type FixtureExpected
- type FixtureHookEvent
- type FixtureNormalizedEvent
- type HTTPOptions
- type Input
- type Judge
- type LlamaServer
- type LlamaServerOptions
- type Metadata
- type MetadataProvider
- type OpenAICompatibleJudge
- type Output
- type Result
- type RiskLevel
- type ToolInput
- type UnavailableJudge
Constants ¶
View Source
const ( DefaultTimeout = 2 * time.Second DefaultRuntime = "openai-compatible" )
View Source
const ( DefaultLlamaServerRuntime = "llama-server" DefaultLlamaServerBinary = "llama-server" DefaultLlamaServerHost = "127.0.0.1" DefaultLlamaServerPort = 18080 DefaultLlamaServerStartupTimeout = 30 * time.Second DefaultLlamaServerHFRepo = "Qwen/Qwen3-0.6B-GGUF" DefaultLlamaServerHFFile = "Qwen3-0.6B-Q8_0.gguf" DefaultLlamaServerHFRevision = "main" DefaultLlamaServerDownloadTimeout = 10 * time.Minute )
View Source
const ( FailureTimeout = "timeout" FailureInvalidOutput = "invalid_output" )
Variables ¶
This section is empty.
Functions ¶
func BuildLlamaServerArgs ¶
func BuildLlamaServerArgs(opts LlamaServerOptions) []string
func CachedHFModelPath ¶
func CompareFixtureOutput ¶
func CompareFixtureOutput(output Output, expected FixtureExpected) []string
func FailureKind ¶
func IsUnavailable ¶ added in v0.8.0
func ResolveLlamaServerModel ¶
func ResolveLlamaServerModel(ctx context.Context, opts LlamaServerOptions) (string, error)
func ValidateOutput ¶
Types ¶
type DownloadProgress ¶ added in v0.8.0
type DownloadProgress struct {
Event DownloadProgressEvent
CurrentBytes int64
TotalBytes int64
Err error
}
type DownloadProgressEvent ¶ added in v0.8.0
type DownloadProgressEvent string
const ( DownloadProgressCacheCheck DownloadProgressEvent = "cache_check" DownloadProgressCacheHit DownloadProgressEvent = "cache_hit" DownloadProgressStart DownloadProgressEvent = "download_start" DownloadProgressUpdate DownloadProgressEvent = "download_update" DownloadProgressDone DownloadProgressEvent = "download_done" DownloadProgressError DownloadProgressEvent = "download_error" )
type DownloadProgressHandler ¶ added in v0.8.0
type DownloadProgressHandler func(DownloadProgress)
type Fixture ¶
type Fixture struct {
ID string `json:"id"`
Description string `json:"description"`
HookEvent FixtureHookEvent `json:"hook_event"`
NormalizedEvent FixtureNormalizedEvent `json:"normalized_event"`
DeterministicPolicy FixtureDeterministicRule `json:"deterministic_policy"`
JudgeExpected FixtureExpected `json:"judge_expected"`
Notes string `json:"notes"`
}
type FixtureDeterministicRule ¶ added in v0.8.0
type FixtureExpected ¶
type FixtureHookEvent ¶
type FixtureNormalizedEvent ¶ added in v0.8.0
type FixtureNormalizedEvent struct {
Type string `json:"type"`
ProviderCategory string `json:"provider_category,omitempty"`
OperationClass string `json:"operation_class,omitempty"`
ResourceClass string `json:"resource_class,omitempty"`
Environment string `json:"environment,omitempty"`
PathClass string `json:"path_class,omitempty"`
CommandSummary string `json:"command_summary,omitempty"`
RequestSummary string `json:"request_summary,omitempty"`
ExplicitUserIntent bool `json:"explicit_user_intent"`
Signals []string `json:"signals,omitempty"`
}
type HTTPOptions ¶
type Input ¶
type Input struct {
ToolName string `json:"tool_name,omitempty"`
ExplicitUserIntent bool `json:"explicit_user_intent,omitempty"`
ToolInput ToolInput `json:"tool_input"`
}
func InputFromFixture ¶
type LlamaServer ¶
type LlamaServer struct {
// contains filtered or unexported fields
}
func StartLlamaServer ¶
func StartLlamaServer(ctx context.Context, opts LlamaServerOptions) (*LlamaServer, error)
func (*LlamaServer) BaseURL ¶
func (s *LlamaServer) BaseURL() string
func (*LlamaServer) Stop ¶
func (s *LlamaServer) Stop() error
type LlamaServerOptions ¶
type MetadataProvider ¶
type MetadataProvider interface {
Metadata() Metadata
}
type OpenAICompatibleJudge ¶
type OpenAICompatibleJudge struct {
// contains filtered or unexported fields
}
func NewOpenAICompatibleJudge ¶
func NewOpenAICompatibleJudge(opts HTTPOptions) (*OpenAICompatibleJudge, error)
func (*OpenAICompatibleJudge) Metadata ¶
func (j *OpenAICompatibleJudge) Metadata() Metadata
type Output ¶
type Output struct {
Decision Decision `json:"decision"`
RiskLevel RiskLevel `json:"risk_level"`
Categories []string `json:"categories"`
Reason string `json:"reason"`
}
func ParseOutput ¶
type UnavailableJudge ¶
type UnavailableJudge struct {
}
func (UnavailableJudge) Metadata ¶
func (j UnavailableJudge) Metadata() Metadata
Click to show internal directories.
Click to hide internal directories.