QdrantSearch: Add query prefix.

This commit is contained in:
Lain Soykaf 2024-05-14 15:09:38 +04:00
parent bb08a766f4
commit 1490ff30af
1 changed files with 2 additions and 0 deletions

View File

@ -71,6 +71,8 @@ def add_to_index(activity) do
@impl true @impl true
def search(_user, query, _options) do def search(_user, query, _options) do
query = "Represent this sentence for searching relevant passages: #{query}"
with {:ok, embedding} <- get_embedding(query), with {:ok, embedding} <- get_embedding(query),
{:ok, %{body: %{"result" => result}}} <- {:ok, %{body: %{"result" => result}}} <-
QdrantClient.post("/collections/posts/points/search", build_search_payload(embedding)) do QdrantClient.post("/collections/posts/points/search", build_search_payload(embedding)) do