Skip to content

Commit

Permalink
feat: display similarity scores in search results (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-on authored Nov 21, 2024
1 parent 72402a9 commit 2c5468f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/chat-view/SimilaritySearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ function SimiliartySearchItem({
}
return (
<div onClick={handleClick} className="smtcmp-similarity-search-item">
<div className="smtcmp-similarity-search-item__similarity">
{chunk.similarity.toFixed(3)}
</div>
<div className="smtcmp-similarity-search-item__path">
{path.basename(chunk.path)}
</div>
Expand Down
6 changes: 6 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,12 @@ button.smtcmp-chat-input-model-select {
background-color: var(--background-modifier-hover);
}

.smtcmp-similarity-search-item__similarity {
flex-shrink: 0;
font-size: var(--font-smallest);
color: var(--text-muted);
}

.smtcmp-similarity-search-item__path {
flex-shrink: 1;
white-space: nowrap;
Expand Down

0 comments on commit 2c5468f

Please sign in to comment.