schema

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddLLMUsageParams added in v0.0.9

type AddLLMUsageParams struct {
	Input  dto.LLMInput
	Output dto.LLMOutput
	Model  string
}

type AddMessageParams

type AddMessageParams struct {
	ChannelID string
	Ts        string
	Attrs     dto.MessageAttrs
}

type AddThreadMessageParams

type AddThreadMessageParams struct {
	ChannelID string
	ParentTs  string
	Ts        string
	Attrs     dto.MessageAttrs
}

type ChannelsV2

type ChannelsV2 struct {
	ID    string
	Attrs dto.ChannelAttrs
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DebugGetClosestDocsParams added in v0.0.13

type DebugGetClosestDocsParams struct {
	LimitVal  int32
	Embedding *pgvector.Vector
}

type DebugGetClosestDocsRow added in v0.0.13

type DebugGetClosestDocsRow struct {
	Url        string
	Path       string
	BlobSha    string
	ChunkIndex int32
	Chunk      string
	Distance   interface{}
}

type DebugGetDocumentForUpdateRow added in v0.0.10

type DebugGetDocumentForUpdateRow struct {
	Url         string
	Path        string
	BlobSha     string
	ChunkIndex  int32
	Chunk       string
	Distance    interface{}
	ChunkCount  int64
	AvgDistance float64
	MinDistance interface{}
}

type DebugGetLatestServiceUpdatesParams added in v0.0.4

type DebugGetLatestServiceUpdatesParams struct {
	QueryText      string
	Interval       pgtype.Interval
	BotID          string
	QueryEmbedding *pgvector.Vector
}

type DebugGetLatestServiceUpdatesRow added in v0.0.4

type DebugGetLatestServiceUpdatesRow struct {
	ChannelID        string
	Ts               string
	SemanticRank     int64
	SemanticDistance float64
	LexicalRank      int64
	RrfScore         float64
	MessageText      string
	TextTokens       string
	QueryTokens      string
	LexicalScore     float64
}

type DeleteDocParams added in v0.0.10

type DeleteDocParams struct {
	Url  string
	Path string
}

type DeleteOldMessagesParams

type DeleteOldMessagesParams struct {
	ChannelID string
	OlderThan pgtype.Interval
}

type DocumentationDoc added in v0.0.10

type DocumentationDoc struct {
	Url      string
	Path     string
	Revision string
	Content  string
	BlobSha  string
}

type DocumentationEmbedding added in v0.0.10

type DocumentationEmbedding struct {
	Url        string
	Path       string
	BlobSha    string
	ChunkIndex int32
	Chunk      string
	Embedding  *pgvector.Vector
}

type DocumentationStatus added in v0.0.10

type DocumentationStatus struct {
	Url       string
	Revision  string
	RefreshTs pgtype.Timestamptz
}

type GetAlertsRow

type GetAlertsRow struct {
	Service            string
	Alert              string
	Priority           string
	ThreadMessageCount int64
}

type GetAllMessagesParams added in v0.0.6

type GetAllMessagesParams struct {
	ChannelID string
	N         int32
}

type GetAllMessagesRow

type GetAllMessagesRow struct {
	ChannelID string
	Ts        string
	Attrs     dto.MessageAttrs
}

type GetClosestDocsParams added in v0.0.10

type GetClosestDocsParams struct {
	LimitVal  int32
	Embedding *pgvector.Vector
}

type GetClosestDocsRow added in v0.0.10

type GetClosestDocsRow struct {
	Url      string
	Path     string
	Revision string
	Content  string
}

type GetDocumentParams added in v0.0.10

type GetDocumentParams struct {
	Url      string
	Path     string
	Revision string
}

type GetDocumentationStatusRow added in v0.0.11

type GetDocumentationStatusRow struct {
	Source        string
	Revision      string
	RefreshTs     pgtype.Timestamptz
	DocumentCount int64
	ChunkCount    int64
}

type GetLLMUsageByModelParams added in v0.0.9

type GetLLMUsageByModelParams struct {
	Model     string
	OffsetVal int32
	LimitVal  int32
}

type GetLLMUsageByTimeRangeParams added in v0.0.9

type GetLLMUsageByTimeRangeParams struct {
	StartTime pgtype.Timestamptz
	EndTime   pgtype.Timestamptz
}

type GetLatestServiceUpdatesParams

type GetLatestServiceUpdatesParams struct {
	QueryText      string
	Interval       pgtype.Interval
	BotID          string
	QueryEmbedding *pgvector.Vector
}

type GetLatestServiceUpdatesRow

type GetLatestServiceUpdatesRow struct {
	ChannelID    string
	Ts           string
	Attrs        []byte
	SemanticRank int64
	LexicalRank  int64
	CRrfScore    float64
}

type GetMessageParams

type GetMessageParams struct {
	ChannelID string
	Ts        string
}

type GetMessageRow added in v0.0.5

type GetMessageRow struct {
	ChannelID string
	Ts        string
	Attrs     dto.MessageAttrs
	Embedding *pgvector.Vector
}

type GetMessagesByUserParams added in v0.0.6

type GetMessagesByUserParams struct {
	StartTs string
	EndTs   string
	UserID  string
}

type GetMessagesByUserRow added in v0.0.6

type GetMessagesByUserRow struct {
	ChannelID string
	Ts        string
	Attrs     dto.MessageAttrs
}

type GetMessagesWithinTSParams

type GetMessagesWithinTSParams struct {
	ChannelID string
	StartTs   string
	EndTs     string
}

type GetMessagesWithinTSRow

type GetMessagesWithinTSRow struct {
	ChannelID string
	Ts        string
	Attrs     dto.MessageAttrs
}

type GetThreadMessagesByServiceAndAlertParams

type GetThreadMessagesByServiceAndAlertParams struct {
	Service string
	Alert   string
	BotID   string
}

type GetThreadMessagesByServiceAndAlertRow added in v0.0.6

type GetThreadMessagesByServiceAndAlertRow struct {
	ChannelID string
	ParentTs  *string
	Ts        string
	Attrs     dto.MessageAttrs
}

type GetThreadMessagesParams

type GetThreadMessagesParams struct {
	ChannelID string
	ParentTs  string
	BotID     string
}

type GetThreadMessagesRow added in v0.0.6

type GetThreadMessagesRow struct {
	ChannelID string
	ParentTs  *string
	Ts        string
	Attrs     dto.MessageAttrs
}

type InsertDocWithEmbeddingsParams added in v0.0.10

type InsertDocWithEmbeddingsParams struct {
	ChunkIndices []int32
	Chunks       []string
	Embeddings   []*pgvector.Vector
	Url          string
	Path         string
	Revision     string
	BlobSha      string
	Content      string
}

type Llmusagev1 added in v0.0.9

type Llmusagev1 struct {
	ID        int32
	Input     dto.LLMInput
	Output    dto.LLMOutput
	Model     string
	Timestamp pgtype.Timestamptz
}

type MessagesV3 added in v0.0.6

type MessagesV3 struct {
	ChannelID string
	Ts        string
	ParentTs  *string
	Attrs     dto.MessageAttrs
	Embedding *pgvector.Vector
	Tsvec     interface{}
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AddChannel

func (q *Queries) AddChannel(ctx context.Context, id string) (ChannelsV2, error)

func (*Queries) AddLLMUsage added in v0.0.9

func (q *Queries) AddLLMUsage(ctx context.Context, arg AddLLMUsageParams) (Llmusagev1, error)

func (*Queries) AddMessage

func (q *Queries) AddMessage(ctx context.Context, arg AddMessageParams) error

func (*Queries) AddThreadMessage

func (q *Queries) AddThreadMessage(ctx context.Context, arg AddThreadMessageParams) error

func (*Queries) CountChannels added in v0.0.18

func (q *Queries) CountChannels(ctx context.Context) (int64, error)

func (*Queries) DebugGetClosestDocs added in v0.0.13

func (q *Queries) DebugGetClosestDocs(ctx context.Context, arg DebugGetClosestDocsParams) ([]DebugGetClosestDocsRow, error)

func (*Queries) DebugGetDocumentForUpdate added in v0.0.10

func (q *Queries) DebugGetDocumentForUpdate(ctx context.Context, embedding *pgvector.Vector) ([]DebugGetDocumentForUpdateRow, error)

func (*Queries) DebugGetLatestServiceUpdates added in v0.0.4

func (q *Queries) DebugGetLatestServiceUpdates(ctx context.Context, arg DebugGetLatestServiceUpdatesParams) ([]DebugGetLatestServiceUpdatesRow, error)

func (*Queries) DeleteDoc added in v0.0.10

func (q *Queries) DeleteDoc(ctx context.Context, arg DeleteDocParams) error

func (*Queries) DeleteOldMessages

func (q *Queries) DeleteOldMessages(ctx context.Context, arg DeleteOldMessagesParams) error

func (*Queries) GetAlerts

func (q *Queries) GetAlerts(ctx context.Context, service string) ([]GetAlertsRow, error)

func (*Queries) GetAllChannels

func (q *Queries) GetAllChannels(ctx context.Context) ([]ChannelsV2, error)

func (*Queries) GetAllMessages

func (q *Queries) GetAllMessages(ctx context.Context, arg GetAllMessagesParams) ([]GetAllMessagesRow, error)

func (*Queries) GetChannel added in v0.0.10

func (q *Queries) GetChannel(ctx context.Context, id string) (ChannelsV2, error)

func (*Queries) GetChannelByName

func (q *Queries) GetChannelByName(ctx context.Context, name string) (ChannelsV2, error)

func (*Queries) GetChannels added in v0.0.6

func (q *Queries) GetChannels(ctx context.Context, ids []string) ([]ChannelsV2, error)

func (*Queries) GetClosestDocs added in v0.0.10

func (q *Queries) GetClosestDocs(ctx context.Context, arg GetClosestDocsParams) ([]GetClosestDocsRow, error)

func (*Queries) GetDocument added in v0.0.10

func (q *Queries) GetDocument(ctx context.Context, arg GetDocumentParams) (DocumentationDoc, error)

func (*Queries) GetDocumentByPathSuffix added in v0.0.18

func (q *Queries) GetDocumentByPathSuffix(ctx context.Context, pathSuffix *string) ([]DocumentationDoc, error)

func (*Queries) GetDocumentForUpdate added in v0.0.10

func (q *Queries) GetDocumentForUpdate(ctx context.Context, embedding *pgvector.Vector) (DocumentationDoc, error)

func (*Queries) GetDocumentationStatus added in v0.0.11

func (q *Queries) GetDocumentationStatus(ctx context.Context) ([]GetDocumentationStatusRow, error)

func (*Queries) GetLLMUsageByModel added in v0.0.9

func (q *Queries) GetLLMUsageByModel(ctx context.Context, arg GetLLMUsageByModelParams) ([]Llmusagev1, error)

func (*Queries) GetLLMUsageByTimeRange added in v0.0.9

func (q *Queries) GetLLMUsageByTimeRange(ctx context.Context, arg GetLLMUsageByTimeRangeParams) ([]Llmusagev1, error)

func (*Queries) GetLatestServiceUpdates

func (q *Queries) GetLatestServiceUpdates(ctx context.Context, arg GetLatestServiceUpdatesParams) ([]GetLatestServiceUpdatesRow, error)

func (*Queries) GetMessage

func (q *Queries) GetMessage(ctx context.Context, arg GetMessageParams) (GetMessageRow, error)

func (*Queries) GetMessagesByUser added in v0.0.6

func (q *Queries) GetMessagesByUser(ctx context.Context, arg GetMessagesByUserParams) ([]GetMessagesByUserRow, error)

func (*Queries) GetMessagesWithinTS

func (q *Queries) GetMessagesWithinTS(ctx context.Context, arg GetMessagesWithinTSParams) ([]GetMessagesWithinTSRow, error)

func (*Queries) GetOrInsertDocumentationSource added in v0.0.10

func (q *Queries) GetOrInsertDocumentationSource(ctx context.Context, url string) (DocumentationStatus, error)

func (*Queries) GetServices

func (q *Queries) GetServices(ctx context.Context) ([]string, error)

func (*Queries) GetThreadMessages

func (q *Queries) GetThreadMessages(ctx context.Context, arg GetThreadMessagesParams) ([]GetThreadMessagesRow, error)

func (*Queries) InsertDocWithEmbeddings added in v0.0.10

func (q *Queries) InsertDocWithEmbeddings(ctx context.Context, arg InsertDocWithEmbeddingsParams) error

func (*Queries) PurgeLLMUsageOlderThan added in v0.0.9

func (q *Queries) PurgeLLMUsageOlderThan(ctx context.Context, olderThan pgtype.Timestamptz) (int64, error)

func (*Queries) UpdateChannelAttrs

func (q *Queries) UpdateChannelAttrs(ctx context.Context, arg UpdateChannelAttrsParams) error

func (*Queries) UpdateDocumentRevisionIfSHAMatches added in v0.0.15

func (q *Queries) UpdateDocumentRevisionIfSHAMatches(ctx context.Context, arg UpdateDocumentRevisionIfSHAMatchesParams) (DocumentationDoc, error)

func (*Queries) UpdateDocumentationSource added in v0.0.10

func (q *Queries) UpdateDocumentationSource(ctx context.Context, arg UpdateDocumentationSourceParams) error

func (*Queries) UpdateMessageAttrs

func (q *Queries) UpdateMessageAttrs(ctx context.Context, arg UpdateMessageAttrsParams) error

func (*Queries) UpdateReaction added in v0.0.6

func (q *Queries) UpdateReaction(ctx context.Context, arg UpdateReactionParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type UpdateChannelAttrsParams

type UpdateChannelAttrsParams struct {
	Attrs dto.ChannelAttrs
	ID    string
}

type UpdateDocumentRevisionIfSHAMatchesParams added in v0.0.15

type UpdateDocumentRevisionIfSHAMatchesParams struct {
	NewRevision string
	Url         string
	Path        string
	BlobSha     string
}

type UpdateDocumentationSourceParams added in v0.0.10

type UpdateDocumentationSourceParams struct {
	Revision string
	Url      string
}

type UpdateMessageAttrsParams

type UpdateMessageAttrsParams struct {
	Attrs     dto.MessageAttrs
	Embedding *pgvector.Vector
	ChannelID string
	Ts        string
}

type UpdateReactionParams added in v0.0.6

type UpdateReactionParams struct {
	Reaction  string
	ChannelID string
	Ts        string
	Count     int32
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL