Expand description
Smart context selection for LLM workflows.
This module provides intelligent file selection based on:
- Semantic search using embeddings
- Call graph expansion (callers and callees)
- Token budget management
§Usage
ⓘ
let config = SmartConfig::default();
let result = smart_context(&db, &analytics, &provider, "add caching", config)?;
for file in result.selected_files {
println!("{}: {} tokens", file.path, file.token_count);
}Structs§
- File
Selection - A selected file with relevance information.
- Smart
Config - Configuration for smart context selection.
- Smart
Context - Result of smart context selection.
Enums§
- Selection
Reason - Reason why a file was selected.
Functions§
- format_
dry_ run - Format the smart context result for dry-run mode.
- format_
explain - Format the smart context result for display.
- smart_
context - Select files relevant to a task using semantic search and call graph analysis.
- smart_
context_ with_ embedding - Select files relevant to a task using a pre-computed embedding.