pub fn embed_via_backend(
_models_dir: &Path,
text: &str,
backend: &LlmBackendKind,
) -> Result<(Vec<f32>, LlmBackendKind), AppError>Expand description
Embeds a single text via the given backend. Used by
embed_with_fallback and exposed to allow direct one-shot
selection without a chain.
Embeds a single text via the given backend. Used by
embed_with_fallback and exposed to allow direct one-shot
selection without a chain.
BUG-003 / v1.0.85: returns (Vec<f32>, LlmBackendKind). The
second element reports the backend that ACTUALLY executed the
embedding, not the chain position requested by the caller, so
envelope.backend_invoked shows the operator the truth.
The tuple mattered more when the chain could substitute one
subprocess backend for another; v1.2.0 reduced LlmBackendKind
to OpenRouter and None, so the two now only differ when
OpenRouter is unreachable and the caller falls through to None.