Skip to main content

embed_passage_with_choice

Function embed_passage_with_choice 

Source
pub fn embed_passage_with_choice(
    models_dir: &Path,
    text: &str,
    choice: Option<LlmBackendChoice>,
) -> Result<Vec<f32>, AppError>
Expand description

Embed a single passage using the LLM backend selected by the user via --llm-backend. Routes to embed_with_fallback so failures fall through to the next backend in the chain before giving up.

When choice is None (e.g. a sub-command that does not yet expose the flag), behaviour matches embed_passage_local — the active embedder from LlmEmbedding::detect_available decides the backend.