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 (t *Ticket) NormalizeLegacyStatus()
- 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" required:"true" maxLength:"255"`
// Description is the description of the ticket for human readability.
Description string `json:"description" required:"true" maxLength:"1024"`
// Summary is the summary of the ticket for AI analysis.
Summary string `json:"summary" maxLength:"4096"`
// TitleSource indicates the source of the title (human, ai, inherited)
TitleSource types.Source `json:"title_source" maxLength:"255"`
// DescriptionSource indicates the source of the description (human, ai, inherited)
DescriptionSource types.Source `json:"description_source" maxLength:"1024"`
}
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"`
// Topic is inherited from the first alert and never changes
Topic types.KnowledgeTopic `json:"topic"`
Metadata
Status types.TicketStatus `json:"status"`
Conclusion types.AlertConclusion `json:"conclusion"`
Reason string `json:"reason"`
ResolvedAt *time.Time `json:"resolved_at"`
ArchivedAt *time.Time `json:"archived_at"`
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 ¶
func (*Ticket) NormalizeLegacyStatus ¶ added in v0.10.0
func (t *Ticket) NormalizeLegacyStatus()
NormalizeLegacyStatus migrates legacy "pending" status to "open" for backward compatibility. This handles existing Firestore data created before the pending status was removed.
Click to show internal directories.
Click to hide internal directories.