From 29e3b470176104332a67297f9d38c5b9bdd0522c Mon Sep 17 00:00:00 2001 From: Guillaume Loulier Date: Fri, 4 Oct 2024 11:28:03 +0200 Subject: [PATCH] refactor(vector): improve ollama support --- milli/src/vector/ollama.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/milli/src/vector/ollama.rs b/milli/src/vector/ollama.rs index 7d41ab4e9..12247973d 100644 --- a/milli/src/vector/ollama.rs +++ b/milli/src/vector/ollama.rs @@ -47,10 +47,10 @@ impl Embedder { url: options.url.unwrap_or_else(get_ollama_path), request: serde_json::json!({ "model": model, - "prompt": super::rest::REQUEST_PLACEHOLDER, + "input": super::rest::REQUEST_PLACEHOLDER, }), response: serde_json::json!({ - "embedding": super::rest::RESPONSE_PLACEHOLDER, + "embeddings": super::rest::RESPONSE_PLACEHOLDER, }), headers: Default::default(), }, @@ -118,6 +118,6 @@ impl Embedder { } fn get_ollama_path() -> String { - // Important: Hostname not enough, has to be entire path to embeddings endpoint - std::env::var("MEILI_OLLAMA_URL").unwrap_or("http://localhost:11434/api/embeddings".to_string()) + // Important: Hostname not enough, has to be entire path to embeddings endpoint (endpoint can be found in the API documentation: https://github.com/ollama/ollama/blob/main/docs/api.md#generate-embeddings) + std::env::var("MEILI_OLLAMA_URL").unwrap_or("http://localhost:11434/api/embed".to_string()) }