Skip to content

Commit 227abee

Browse files
committed
feat(llm): add embedding support for Ollama
1 parent 129bc89 commit 227abee

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/llm/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ pub async fn new_llm_embedding_client(
145145
api_config: Option<LlmApiConfig>,
146146
) -> Result<Box<dyn LlmEmbeddingClient>> {
147147
let client = match api_type {
148+
LlmApiType::Ollama => {
149+
Box::new(ollama::Client::new(address).await?) as Box<dyn LlmEmbeddingClient>
150+
}
148151
LlmApiType::Gemini => {
149152
Box::new(gemini::AiStudioClient::new(address)?) as Box<dyn LlmEmbeddingClient>
150153
}
@@ -156,11 +159,7 @@ pub async fn new_llm_embedding_client(
156159
}
157160
LlmApiType::VertexAi => Box::new(gemini::VertexAiClient::new(address, api_config).await?)
158161
as Box<dyn LlmEmbeddingClient>,
159-
LlmApiType::Ollama
160-
| LlmApiType::OpenRouter
161-
| LlmApiType::LiteLlm
162-
| LlmApiType::Vllm
163-
| LlmApiType::Anthropic => {
162+
LlmApiType::OpenRouter | LlmApiType::LiteLlm | LlmApiType::Vllm | LlmApiType::Anthropic => {
164163
api_bail!("Embedding is not supported for API type {:?}", api_type)
165164
}
166165
};

0 commit comments

Comments
 (0)