Skip to content

Commit f48b503

Browse files
committed
Fix type mismatch error in embed_text.rs
- Fixed api_bail! usage in context expecting LlmApiConfig return type - Replaced unwrap_or_else with proper if-let pattern matching - Resolves compilation error in GitHub Actions build test
1 parent f7b4dcb commit f48b503

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/ops/functions/embed_text.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,16 @@ impl SimpleFunctionFactoryBase for Factory {
118118
LlmApiConfig::OpenRouter(super::super::super::llm::OpenRouterConfig {})
119119
}
120120
LlmApiType::Vllm => LlmApiConfig::Vllm(super::super::super::llm::VllmConfig {}),
121-
_ => spec.api_config.clone().unwrap_or_else(|| {
122-
api_bail!(
123-
"API key parameter is not supported for API type {:?}",
124-
spec.api_type
125-
)
126-
}),
121+
_ => {
122+
if let Some(config) = spec.api_config.clone() {
123+
config
124+
} else {
125+
api_bail!(
126+
"API key parameter is not supported for API type {:?}",
127+
spec.api_type
128+
)
129+
}
130+
},
127131
})
128132
} else {
129133
spec.api_config.clone()

0 commit comments

Comments
 (0)