Back to the room

Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works

Code Observatory / method

_embed

codeintel.embeddings.HttpEmbedder._embed

PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.

PHAROS at 975a38dMIT license

Around this symbol

Search all symbols

Loading

Calls (2)
SymbolFileResolved by
_padembeddings.pysame file
_postembeddings.pysame file
Called by (2)
SymbolFileResolved by
embed_documentsembeddings.pysame file
embed_queryembeddings.pysame file
Inside (1)
SymbolFileResolved by
HttpEmbedderembeddings.pysame file
codeintel.embeddings.HttpEmbedder._embedbackend/app/codeintel/embeddings.py, lines 266–274Open source
    def _embed(self, texts: list[str]) -> list[list[float]]:        if self._batch_supported is not False:            try:                data = self._post("/embed/batch", {"texts": texts})                self._batch_supported = True                return [_pad(v, self.dim) for v in data["embeddings"]]            except FileNotFoundError:                self._batch_supported = False        return [_pad(self._post("/embed", {"text": t})["embedding"], self.dim) for t in texts]

What the index recorded

Signature
def _embed(self, texts: list[str]) -> list[list[float]]:
File
backend/app/codeintel/embeddings.py
Lines
266–274
Parser
python-ast
Git blob
df7f8202f23ca6ad2c57aca5f09b435eb6486d79
Call sites
2 named, 2 resolved, 0 left unlinked

Read it on GitHub at this commit