Skip to content

Commit

Permalink
🎨 logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ff137 committed Nov 15, 2023
1 parent 8886e00 commit 7c63c5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/xyz/didx/ai/embedding/EmbeddingHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ object EmbeddingHandler {
maxResults: Int = 1,
minScore: Double = 0.7
): Option[EmbeddingMatch[TextSegment]] = {
val queryEmbedding: Response[Embedding] = embeddingModel.embed(queryText.take(256))
val queryEmbedding: Response[Embedding] = embeddingModel.embed(queryText.take(256))

scribe.info(s"Finding most relevant embedding from query: $queryText")
val relevant: List[EmbeddingMatch[TextSegment]] =
embeddingStore.findRelevant(queryEmbedding.content(), maxResults, minScore).asScala.toList
val embeddingMatch: Option[EmbeddingMatch[TextSegment]] = relevant.headOption
Expand Down

0 comments on commit 7c63c5f

Please sign in to comment.