Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / function
semantic_summary
codeintel.text.semantic_summary
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 |
|---|---|---|
| _build_rows | indexer.py | through an import |
| Symbol | File | Resolved by |
|---|---|---|
| text | text.py | same file |
codeintel.text.semantic_summarybackend/app/codeintel/text.py, lines 117–149Open source
def semantic_summary(sym: Symbol, *, language: str, path: str, module_name: str, body: str = "", description: str = "") -> str: '''The text that gets embedded for a chunk (not the raw source). Format:: [python] pkg/auth.py :: TokenStore.issue def issue(self, user): """Issue a signed token.""" payload = {"sub": user.id} return self._sign(encode(payload)) calls: [_sign, encode] ``body`` (see :func:`body_excerpt`) goes before the call list: embedders truncate long inputs (MiniLM at 256 tokens), and the body says more. ''' local_name = sym.qualified_name if module_name and local_name.startswith(module_name + "."): local_name = local_name[len(module_name) + 1 :] if sym.kind in ("module", "block"): header = f"[{language}] {path}" else: header = f"[{language}] {path} :: {local_name}" lines = [header, sym.signature] if sym.signature else [header] if sym.docstring: lines.append(f' """{sym.docstring}"""') if description: lines.append(f" purpose: {description}") if body: lines.append(body) if sym.calls: lines.append(f" calls: [{', '.join(sym.calls[:20])}]") return "\n".join(lines)What the index recorded
- Signature
def semantic_summary(sym: Symbol, *, language: str, path: str, module_name: str, body: str, description: str) -> str:- File
backend/app/codeintel/text.py- Lines
- 117–149
- Parser
- python-ast
- Git blob
74781c9c047d5953611fd7634b2cf29e7661b895- Call sites
- 4 named, 0 resolved, 4 left unlinked
- Outside this subset
- 1 more edges reach code outside the graph shown here
