Skip to content

Commit fcfc93a

Browse files
committed
Add support for embedding models in OpenRouter
1 parent 98e9e6e commit fcfc93a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

rust/cocoindex/src/llm/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ pub async fn new_llm_embedding_client(
166166
LlmApiType::Ollama => {
167167
Box::new(ollama::Client::new(address).await?) as Box<dyn LlmEmbeddingClient>
168168
}
169+
LlmApiType::OpenRouter => {
170+
Box::new(openrouter::Client::new_openrouter(address, api_key).await?)
171+
as Box<dyn LlmEmbeddingClient>
172+
}
169173
LlmApiType::Gemini => {
170174
Box::new(gemini::AiStudioClient::new(address, api_key)?) as Box<dyn LlmEmbeddingClient>
171175
}
@@ -178,8 +182,7 @@ pub async fn new_llm_embedding_client(
178182
Box::new(gemini::VertexAiClient::new(address, api_key, api_config).await?)
179183
as Box<dyn LlmEmbeddingClient>
180184
}
181-
LlmApiType::OpenRouter
182-
| LlmApiType::LiteLlm
185+
LlmApiType::LiteLlm
183186
| LlmApiType::Vllm
184187
| LlmApiType::Anthropic
185188
| LlmApiType::Bedrock => {

0 commit comments

Comments
 (0)