Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / method
_edge
codeintel.embeddings.EdgeFirstEmbedder._edge
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 symbolsLoading
| Symbol | File | Resolved by |
|---|---|---|
| _pad | embeddings.py | same file |
| _http | embeddings.py | same file |
| _reset_http | embeddings.py | same file |
| EmbeddingUnavailable | embeddings.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| encode_raw | embeddings.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| EdgeFirstEmbedder | embeddings.py | same file |
codeintel.embeddings.EdgeFirstEmbedder._edgebackend/app/codeintel/embeddings.py, lines 405–427Open source
def _edge(self, texts: list[str]) -> list[list[float]]: import httpx try: resp = self._http().post("/embed/batch", json={"texts": texts}) except httpx.TransportError: # An idle connection the edge or the proxy closed: retry once on a # fresh one before falling back (the fallback loads the local model). self._reset_http() try: resp = self._http().post("/embed/batch", json={"texts": texts}) except Exception: self._reset_http() raise if resp.status_code != 200: raise EmbeddingUnavailable(f"edge returned HTTP {resp.status_code}") data = resp.json() if data.get("model_id") != self.model_id: raise EmbeddingUnavailable(f"edge runs {data.get('model_id')!r}, not {self.model_id!r}") vectors = data["embeddings"] if len(vectors) != len(texts): raise EmbeddingUnavailable("edge returned the wrong number of vectors") return [_pad(v, self.dim) for v in vectors]What the index recorded
- Signature
def _edge(self, texts: list[str]) -> list[list[float]]:- File
backend/app/codeintel/embeddings.py- Lines
- 405–427
- Parser
- python-ast
- Git blob
df7f8202f23ca6ad2c57aca5f09b435eb6486d79- Call sites
- 8 named, 4 resolved, 4 left unlinked
