Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnrichPolicyResult ¶ added in v0.5.0
type EnrichPolicyResult struct {
Prompts []EnrichTask `json:"prompts"`
}
EnrichPolicyResult represents the result of enrich policy evaluation
func (*EnrichPolicyResult) EnsureTaskIDs ¶ added in v0.5.0
func (r *EnrichPolicyResult) EnsureTaskIDs()
EnsureTaskIDs ensures all tasks have IDs
func (*EnrichPolicyResult) TaskCount ¶ added in v0.5.0
func (r *EnrichPolicyResult) TaskCount() int
TaskCount returns the total number of tasks
type EnrichResult ¶ added in v0.7.0
type EnrichResult struct {
ID string `json:"id"`
Prompt string `json:"prompt"` // Actual prompt text used
Result any `json:"result"` // Task execution result
}
EnrichResult represents a single enrichment task result with metadata
type EnrichResults ¶ added in v0.5.0
type EnrichResults []EnrichResult
EnrichResults represents all enrichment task results as an array
type EnrichTask ¶ added in v0.5.0
type EnrichTask struct {
ID string `json:"id"`
Template string `json:"template,omitempty"` // Template file path
Params map[string]any `json:"params,omitempty"` // Template parameters
Inline string `json:"inline,omitempty"` // Inline prompt
Format types.GenAIContentFormat `json:"format"` // "text" or "json"
}
EnrichTask represents a prompt-based enrichment task definition
func (*EnrichTask) EnsureID ¶ added in v0.5.0
func (t *EnrichTask) EnsureID()
EnsureID ensures the task has an ID, generating one if necessary
func (*EnrichTask) GetPromptContent ¶ added in v0.5.0
func (t *EnrichTask) GetPromptContent() string
GetPromptContent returns the prompt content (inline or template path)
func (*EnrichTask) HasTemplateFile ¶ added in v0.7.0
func (t *EnrichTask) HasTemplateFile() bool
HasTemplateFile returns true if task uses a template file
func (*EnrichTask) Validate ¶ added in v0.5.0
func (t *EnrichTask) Validate() error
Validate checks if the task configuration is valid
type TestData ¶
type TestData struct {
// Metafiles is the metadata (README) of the test data that is generated by the AI.
Metafiles map[types.AlertSchema]map[string]string
// Data is the test data that is from the original alert or modified.
Data map[types.AlertSchema]map[string]any
}
func NewTestData ¶
func NewTestData() *TestData
type TestDataSet ¶
func NewTestDataSet ¶
func NewTestDataSet() *TestDataSet
type TriagePolicyAlert ¶ added in v0.7.0
type TriagePolicyAlert struct {
ID types.AlertID `json:"id"`
Schema types.AlertSchema `json:"schema"`
Metadata alert.Metadata `json:"metadata"`
Data any `json:"data"`
}
TriagePolicyAlert represents alert data for triage policy input (matches doc/policy.md format)
type TriagePolicyInput ¶ added in v0.7.0
type TriagePolicyInput struct {
Alert TriagePolicyAlert `json:"alert"`
Enrich EnrichResults `json:"enrich"`
}
TriagePolicyInput represents the input for triage policy evaluation
func NewTriagePolicyInput ¶ added in v0.7.0
func NewTriagePolicyInput(a *alert.Alert, enrichResults EnrichResults) TriagePolicyInput
NewTriagePolicyInput creates a TriagePolicyInput from an Alert
type TriagePolicyResult ¶ added in v0.7.0
type TriagePolicyResult struct {
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Channel string `json:"channel,omitempty"`
Attr []alert.Attribute `json:"attr,omitempty"`
Publish types.PublishType `json:"publish,omitempty"`
Topic types.KnowledgeTopic `json:"topic,omitempty"`
}
TriagePolicyResult represents the result of triage policy evaluation
func (*TriagePolicyResult) ApplyTo ¶ added in v0.7.0
func (r *TriagePolicyResult) ApplyTo(a *alert.Alert)
ApplyTo applies the triage policy result to an alert