feat(embeddings): add embedding model support and related changes
* Introduced EmbeddingModel method in Client and Provider interfaces * Updated InsertThought and SearchThoughts methods to handle embedding models * Created embeddings table and updated match_thoughts function for model filtering * Removed embedding column from thoughts table * Adjusted permissions for new embeddings table
This commit is contained in:
@@ -54,12 +54,13 @@ func (t *SearchTool) Handle(ctx context.Context, req *mcp.CallToolRequest, in Se
|
||||
return nil, SearchOutput{}, err
|
||||
}
|
||||
|
||||
model := t.provider.EmbeddingModel()
|
||||
var results []thoughttypes.SearchResult
|
||||
if project != nil {
|
||||
results, err = t.store.SearchSimilarThoughts(ctx, embedding, threshold, limit, &project.ID, nil)
|
||||
results, err = t.store.SearchSimilarThoughts(ctx, embedding, model, threshold, limit, &project.ID, nil)
|
||||
_ = t.store.TouchProject(ctx, project.ID)
|
||||
} else {
|
||||
results, err = t.store.SearchThoughts(ctx, embedding, threshold, limit, map[string]any{})
|
||||
results, err = t.store.SearchThoughts(ctx, embedding, model, threshold, limit, map[string]any{})
|
||||
}
|
||||
if err != nil {
|
||||
return nil, SearchOutput{}, err
|
||||
|
||||
Reference in New Issue
Block a user