pack_snippets
Extract source-grounded Swift code snippets by natural-language query, returning a ranked, deduplicated Markdown pack with line numbers for direct LLM ingestion.
Instructions
Hybrid query + source-grounded Swift snippet extraction.
Returns a Markdown context pack with ranked, deduplicated code snippets and line numbers — ready for direct LLM ingestion.
:param q: Natural-language query, e.g. "request error handling". :param k: Number of semantic seed nodes (default 8). :param hop: Graph expansion hops (default 1). :param rels: Comma-separated edge types to follow. :param context: Extra context lines around each definition (default 5). :param max_lines: Maximum lines per snippet block (default 60). :param max_nodes: Maximum nodes to include in the pack (default 15). :param min_score: Minimum semantic score for seed inclusion in [0, 1]. :param max_per_module: Maximum nodes per module (default 3; 0 disables). :param rerank_mode: 'hybrid' (default), 'semantic', or 'legacy'. :param rerank_semantic_weight: Semantic weight for hybrid mode (default 0.7). :param rerank_lexical_weight: Lexical weight for hybrid mode (default 0.3). :return: Markdown string with source-grounded code snippets.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | ||
| q | Yes | ||
| hop | No | ||
| rels | No | CONTAINS,CALLS,IMPORTS,INHERITS,CONFORMS,EXTENDS | |
| context | No | ||
| max_lines | No | ||
| max_nodes | No | ||
| min_score | No | ||
| rerank_mode | No | hybrid | |
| max_per_module | No | ||
| rerank_lexical_weight | No | ||
| rerank_semantic_weight | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |