From 7c63c5f06c3e82aae40904ee71fd0a58533e2a99 Mon Sep 17 00:00:00 2001 From: ff137 Date: Wed, 15 Nov 2023 16:42:15 +0200 Subject: [PATCH] :art: logging --- src/xyz/didx/ai/embedding/EmbeddingHandler.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xyz/didx/ai/embedding/EmbeddingHandler.scala b/src/xyz/didx/ai/embedding/EmbeddingHandler.scala index 25778f4..ce0c43b 100644 --- a/src/xyz/didx/ai/embedding/EmbeddingHandler.scala +++ b/src/xyz/didx/ai/embedding/EmbeddingHandler.scala @@ -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