EmbeddingCapability (embedding/capability.py)

EverOS · src/everos/component/embedding/capability.py · python · Apache-2.0
ai, tag:embed-classified

Wrapper providing soft and strict access to an optional embedding provider.

# Source: https://github.com/EverMind-AI/EverOS | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""EmbeddingCapability — soft-dependency wrapper for EmbeddingProvider.

The wrapper encapsulates ``Optional[EmbeddingProvider]`` so consumers
never see ``None`` directly. Two consumption modes:

- :meth:`embed_or_none` / :meth:`embed_batch_or_none` for soft-degrade
  write paths (cascade handlers that write ``vector=NULL`` when embedding
  is unavailable).
- :meth:`require` for hard-required paths (search VECTOR/HYBRID/AGENTIC)
  that raise :class:`ProviderNotConfiguredError` -> HTTP 422 when missing.

Design rationale: EverOS has multiple code paths that need to know
whether embedding 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key