Documentation
¶
Index ¶
- type AlertRepository
- type Comment
- type Finding
- type History
- type Metadata
- type Ticket
- func (x *Ticket) CalculateEmbedding(ctx context.Context, llmClient gollem.LLMClient, alertRepo AlertRepository) error
- func (x *Ticket) FillMetadata(ctx context.Context, llmClient gollem.LLMClient, alertRepo AlertRepository) error
- func (t *Ticket) GetTagNames(ctx context.Context, ...) ([]string, error)
- func (t *Ticket) HasSlackThread() bool
- func (x *Ticket) NewComment(ctx context.Context, message string, user *slack.User, slackMessageID string) Comment
- func (x *Ticket) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertRepository ¶
type Finding ¶
type Finding struct {
Severity types.AlertSeverity `json:"severity"`
Summary string `json:"summary"`
Reason string `json:"reason"`
Recommendation string `json:"recommendation"`
}
Finding is the conclusion of the alert. This is set by the AI.
type History ¶
type Metadata ¶
type Metadata struct {
// Title is the title of the ticket for human readability.
Title string `json:"title"`
// Description is the description of the ticket for human readability.
Description string `json:"description"`
// Summary is the summary of the ticket for AI analysis.
Summary string `json:"summary"`
// TitleSource indicates the source of the title (human, ai, inherited)
TitleSource types.Source `json:"title_source"`
// DescriptionSource indicates the source of the description (human, ai, inherited)
DescriptionSource types.Source `json:"description_source"`
}
type Ticket ¶
type Ticket struct {
ID types.TicketID `json:"id"`
AlertIDs []types.AlertID `json:"-"`
SlackThread *slack.Thread `json:"slack_thread"`
SlackMessageID string `json:"slack_message_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Metadata
Status types.TicketStatus `json:"status"`
Conclusion types.AlertConclusion `json:"conclusion"`
Reason string `json:"reason"`
Finding *Finding `json:"finding"`
Assignee *slack.User `json:"assignee"`
IsTest bool `json:"is_test"`
Embedding firestore.Vector32 `json:"-"`
TagIDs map[string]bool `json:"tag_ids"`
}
func (*Ticket) CalculateEmbedding ¶
func (x *Ticket) CalculateEmbedding(ctx context.Context, llmClient gollem.LLMClient, alertRepo AlertRepository) error
CalculateEmbedding calculates the ticket embedding using a weighted average approach. It combines embeddings from title/description (weight 0.3) and alerts (weight 0.7).
func (*Ticket) FillMetadata ¶
func (*Ticket) GetTagNames ¶ added in v0.2.0
func (t *Ticket) GetTagNames(ctx context.Context, tagGetter func(context.Context, []string) ([]*tag.Tag, error)) ([]string, error)
GetTagNames returns tag names for external API compatibility
func (*Ticket) HasSlackThread ¶ added in v0.1.0
HasSlackThread returns true if the ticket has a valid Slack thread
func (*Ticket) NewComment ¶
Click to show internal directories.
Click to hide internal directories.