Abstract base class defining the standard request and response contracts for AI embedding providers. Use when implementing new vector embedding backends.
# Source: https://github.com/HKUDS/DeepTutor | 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.
"""
Base Embedding Adapter
=======================
Abstract base class for all embedding adapters.
Defines the contract that all embedding providers must implement.
"""
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Any, Dict, List, Optional
from deeptutor.services.keypool import KeyPool
def looks_like_multimodal_embedding_model(model_name: Optional[str]) -> bool:
"""Best-effort guard for OpenAI-compatible multimodal embedding models."""
if not model_name:
return False
normalized = model_name.lower().replace("_", "-")
re
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key