Forge documentation
Library referencePython

forge.embed

Python embed package; imports are explicit from this package.

Python embed package; imports are explicit from this package.

Package contract

FieldValue
Languagepython
Source version0.1.0
Manifestforge-py/pyproject.toml
Source files5
EvidenceSource reference; registry publication and runtime conformance are separate checks

Import boundary

import forge.embed

Use a source checkout or your verified private registry. Manifest coordinates identify the package; they do not establish that a public registry release exists.

Source reference

Download package reference JSON. Each original source file and generated declaration artifact has its own SHA-256 digest. Function bodies and constant values are omitted from downloads. These are source declaration inventories, not compiler-resolved rustdoc, TypeDoc, DocC, or Dokka output. Private modules can contain public declarations that are not reachable through the package boundary; consult the entry point before importing.

chunking.py

Read declaration text · 5 declaration entries

class Chunk()

class TextChunker()

def __init__(self, chunk_size: int=1000, overlap: int=200) -> None

def chunk(self, text: str) -> list[Chunk]

def chunk_text(text: str, chunk_size: int=1000, overlap: int=200) -> list[Chunk]

provider.py

Read declaration text · 5 declaration entries

class EmbeddingResult()

class EmbeddingProvider(ABC)

def provider_name(self) -> str

async def embed(self, texts: list[str], options: EmbedOptions | None=None) -> EmbeddingResult

async def embed_single(self, text: str, options: EmbedOptions | None=None) -> tuple[float, ...]

similarity.py

Read declaration text · 3 declaration entries

def cosine_similarity(a: tuple[float, ...], b: tuple[float, ...]) -> float

def dot_product(a: tuple[float, ...], b: tuple[float, ...]) -> float

def euclidean_distance(a: tuple[float, ...], b: tuple[float, ...]) -> float

vector_store.py

Read declaration text · 6 declaration entries

class SearchResult()

class VectorStore()

def __init__(self) -> None

def add(self, doc_id: str, embedding: tuple[float, ...], metadata: dict[str, Any] | None=None) -> None

def search(self, query: tuple[float, ...], top_k: int=10) -> list[SearchResult]

def remove(self, doc_id: str) -> bool

Continue

On this page