Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentTask ¶ added in v0.5.0
type AgentTask struct {
EnrichTask
}
AgentTask represents an agent-type enrichment task
type CommitPolicyAlert ¶ added in v0.5.0
type CommitPolicyAlert struct {
ID types.AlertID `json:"id"`
Schema types.AlertSchema `json:"schema"`
Metadata alert.Metadata `json:"metadata"`
Data any `json:"data"`
}
CommitPolicyAlert represents alert data for commit policy input (matches doc/policy.md format)
type CommitPolicyInput ¶ added in v0.5.0
type CommitPolicyInput struct {
Alert CommitPolicyAlert `json:"alert"`
Enrich EnrichResults `json:"enrich"`
}
CommitPolicyInput represents the input for commit policy evaluation
func NewCommitPolicyInput ¶ added in v0.5.0
func NewCommitPolicyInput(a *alert.Alert, enrichResults EnrichResults) CommitPolicyInput
NewCommitPolicyInput creates a CommitPolicyInput from an Alert
type CommitPolicyResult ¶ added in v0.5.0
type CommitPolicyResult 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"`
}
CommitPolicyResult represents the result of commit policy evaluation
func (*CommitPolicyResult) ApplyTo ¶ added in v0.5.0
func (r *CommitPolicyResult) ApplyTo(a *alert.Alert)
ApplyTo applies the commit policy result to an alert
type EnrichPolicyResult ¶ added in v0.5.0
type EnrichPolicyResult struct {
Query []QueryTask `json:"query"`
Agent []AgentTask `json:"agent"`
}
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 EnrichResults ¶ added in v0.5.0
EnrichResults represents all enrichment task results
type EnrichTask ¶ added in v0.5.0
type EnrichTask struct {
ID string `json:"id"`
Prompt string `json:"prompt,omitempty"` // File path
Inline string `json:"inline,omitempty"` // Inline prompt
Format types.GenAIContentFormat `json:"format"` // "text" or "json"
}
EnrichTask represents a generic 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 file path)
func (*EnrichTask) HasPromptFile ¶ added in v0.5.0
func (t *EnrichTask) HasPromptFile() bool
HasPromptFile returns true if task uses a prompt file
func (*EnrichTask) Validate ¶ added in v0.5.0
func (t *EnrichTask) Validate() error
Validate checks if the task configuration is valid
type QueryTask ¶ added in v0.5.0
type QueryTask struct {
EnrichTask
}
QueryTask represents a query-type enrichment task
type TaskType ¶ added in v0.5.0
type TaskType string
TaskType represents the type of enrichment task
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