diff --git a/crates/milli/src/vector/ollama.rs b/crates/milli/src/vector/ollama.rs index fb0f3fb82..cc70e2c47 100644 --- a/crates/milli/src/vector/ollama.rs +++ b/crates/milli/src/vector/ollama.rs @@ -45,11 +45,6 @@ impl EmbedderOptions { // **warning**: do not swap these two `if`s, as the second one is always true when the first one is. let (request, response) = if url.ends_with("/api/embeddings") { - ( - serde_json::json!({"model": model, "input": [super::rest::REQUEST_PLACEHOLDER, super::rest::REPEAT_PLACEHOLDER]}), - serde_json::json!({"embeddings": [super::rest::RESPONSE_PLACEHOLDER, super::rest::REPEAT_PLACEHOLDER]}), - ) - } else if url.ends_with("/api/embed") { ( serde_json::json!({ "model": model, @@ -59,6 +54,11 @@ impl EmbedderOptions { "embedding": super::rest::RESPONSE_PLACEHOLDER, }), ) + } else if url.ends_with("/api/embed") { + ( + serde_json::json!({"model": model, "input": [super::rest::REQUEST_PLACEHOLDER, super::rest::REPEAT_PLACEHOLDER]}), + serde_json::json!({"embeddings": [super::rest::RESPONSE_PLACEHOLDER, super::rest::REPEAT_PLACEHOLDER]}), + ) } else { return Err(NewEmbedderError::ollama_unsupported_url(url)); };