Documentation
¶
Index ¶
- Constants
- func InitEmbeddingsSearch(db *sqlx.DB, httpClient *http.Client, cfg embeddings.EmbeddingSearchConfig, ...) (embeddings.EmbeddingSearch, error)
- type Options
- type RAGResult
- type Request
- type Response
- type Search
- func (s *Search) Enabled() bool
- func (s *Search) RunSearch(ctx context.Context, userID string, bot *bots.Bot, ...) (map[string]string, error)
- func (s *Search) Search(ctx context.Context, query string, opts Options) ([]RAGResult, error)
- func (s *Search) SearchQuery(ctx context.Context, userID string, bot *bots.Bot, ...) (Response, error)
Constants ¶
View Source
const ( SearchResultsProp = "search_results" SearchQueryProp = "search_query" )
Variables ¶
This section is empty.
Functions ¶
func InitEmbeddingsSearch ¶
func InitEmbeddingsSearch(db *sqlx.DB, httpClient *http.Client, cfg embeddings.EmbeddingSearchConfig, licenseChecker *enterprise.LicenseChecker) (embeddings.EmbeddingSearch, error)
InitEmbeddingsSearch creates and initializes the embedding search system
Types ¶
type RAGResult ¶
type RAGResult struct {
Index int `json:"index"` // 1-based index for citation mapping
PostID string `json:"postId"`
ChannelID string `json:"channelId"`
ChannelName string `json:"channelName"`
TeamName string `json:"teamName"`
UserID string `json:"userId"`
Username string `json:"username"`
Content string `json:"content"`
Score float32 `json:"score"`
}
RAGResult represents an enriched search result with metadata
type Request ¶
type Request struct {
Query string `json:"query"`
TeamID string `json:"teamId"`
ChannelID string `json:"channelId"`
MaxResults int `json:"maxResults"`
}
Request represents a search query request
type Response ¶
type Response struct {
Answer string `json:"answer"`
Results []RAGResult `json:"results"`
PostID string `json:"postid,omitempty"`
ChannelID string `json:"channelid,omitempty"`
}
Response represents a response to a search query
type Search ¶
type Search struct {
// contains filtered or unexported fields
}
func New ¶
func New( getSearch func() embeddings.EmbeddingSearch, mmclient mmapi.Client, prompts *llm.Prompts, streamingService streaming.Service, licenseChecker *enterprise.LicenseChecker, ) *Search
func (*Search) Enabled ¶ added in v1.2.2
Enabled returns true if the search service is enabled and functional
func (*Search) RunSearch ¶
func (s *Search) RunSearch(ctx context.Context, userID string, bot *bots.Bot, query, teamID, channelID string, maxResults int) (map[string]string, error)
RunSearch initiates a search and sends results to a DM
Click to show internal directories.
Click to hide internal directories.