Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / function
retrieve_context
modules.code.router.retrieve_context
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 |
|---|---|---|
| assemble_context | context.py | through an import |
| ContextRequest | context.py | through an import |
| get_embedder | embeddings.py | through an import |
| secret | runtime.py | through an import |
| _mode_unavailable | router.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| router | router.py | same file |
modules.code.router.retrieve_contextbackend/app/modules/code/router.py, lines 241–256Open source
@router.post("/context/retrieve", response_model=ContextResponse)def retrieve_context(body: ContextRequestIn, db: Session = Depends(get_sync_db)): """Everything an assistant needs to answer ``query``: ranked code with verified source, callers/callees, coding rules and a Markdown rendering.""" settings = get_settings() try: return assemble_context( db, get_embedder(), ContextRequest(**body.model_dump()), fetch_token=secret(settings.GIT_CLONE_TOKEN), ) except RepositoryNotFound as exc: raise HTTPException(status_code=404, detail={"error": "repository_not_found", "detail": str(exc)}) from exc except ModeUnavailable as exc: raise _mode_unavailable(exc) from excWhat the index recorded
- Signature
def retrieve_context(body: ContextRequestIn, db: Session):- File
backend/app/modules/code/router.py- Lines
- 241–256
- Parser
- python-ast
- Git blob
d914024790aaafe7234adda557677b76e4ad73d5- Call sites
- 10 named, 6 resolved, 4 left unlinked
- Outside this subset
- 1 more edges reach code outside the graph shown here
