Documentation
¶
Overview ¶
Package tuning provides AI tuning capabilities for the platform.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSystemPrompt ¶
BuildSystemPrompt builds a system prompt for a persona.
func DefaultHints ¶
DefaultHints returns default hints for common tools.
Types ¶
type HintManager ¶
type HintManager struct {
// contains filtered or unexported fields
}
HintManager manages tool hints.
func (*HintManager) GetHint ¶
func (m *HintManager) GetHint(toolName string) (string, bool)
GetHint gets a hint for a tool.
func (*HintManager) SetHint ¶
func (m *HintManager) SetHint(toolName, hint string)
SetHint sets a hint for a tool.
func (*HintManager) SetHints ¶
func (m *HintManager) SetHints(hints map[string]string)
SetHints sets multiple hints at once.
type PromptConfig ¶
type PromptConfig struct {
PromptsDir string
}
PromptConfig configures prompt management.
type PromptManager ¶
type PromptManager struct {
// contains filtered or unexported fields
}
PromptManager manages prompt resources.
func NewPromptManager ¶
func NewPromptManager(cfg PromptConfig) *PromptManager
NewPromptManager creates a new prompt manager.
func (*PromptManager) All ¶
func (m *PromptManager) All() map[string]string
All returns all prompts.
func (*PromptManager) Get ¶
func (m *PromptManager) Get(name string) (string, bool)
Get retrieves a prompt by name.
func (*PromptManager) LoadPrompts ¶
func (m *PromptManager) LoadPrompts() error
LoadPrompts loads prompts from the configured directory.
type QueryMetadata ¶
type QueryMetadata struct {
QualityScore *float64
IsDeprecated bool
DeprecationNote string
ContainsPII bool
RowCount *int64
}
QueryMetadata provides context for rule evaluation.
type RuleEngine ¶
type RuleEngine struct {
// contains filtered or unexported fields
}
RuleEngine evaluates rules against actions.
func NewRuleEngine ¶
func NewRuleEngine(rules *Rules) *RuleEngine
NewRuleEngine creates a new rule engine.
func (*RuleEngine) CheckQueryExecution ¶
func (e *RuleEngine) CheckQueryExecution(metadata QueryMetadata) []Violation
CheckQueryExecution checks rules for query execution.
func (*RuleEngine) GetCustomRule ¶
func (e *RuleEngine) GetCustomRule(name string) (any, bool)
GetCustomRule retrieves a custom rule value.
func (*RuleEngine) GetMaxQueryLimit ¶
func (e *RuleEngine) GetMaxQueryLimit() int
GetMaxQueryLimit returns the maximum query limit.
func (*RuleEngine) ShouldRequireDataHubCheck ¶
func (e *RuleEngine) ShouldRequireDataHubCheck() bool
ShouldRequireDataHubCheck returns whether DataHub check is required.
type Rules ¶
type Rules struct {
// RequireDataHubCheck requires checking DataHub before writing queries.
RequireDataHubCheck bool `yaml:"require_datahub_check"`
// WarnOnDeprecated warns when accessing deprecated entities.
WarnOnDeprecated bool `yaml:"warn_on_deprecated"`
// QualityThreshold is the minimum quality score for data access.
QualityThreshold float64 `yaml:"quality_threshold"`
// MaxQueryLimit is the maximum number of rows a query can return.
MaxQueryLimit int `yaml:"max_query_limit"`
// RequirePIIAcknowledgment requires acknowledgment when accessing PII data.
RequirePIIAcknowledgment bool `yaml:"require_pii_acknowledgment"`
// Custom rules
Custom map[string]any `yaml:"custom,omitempty"`
}
Rules defines operational rules for the platform.