pub trait IndexAccess: Send + Sync {
// Required method
fn fetch_code_rag<'a>(
&'a self,
query: &'a str,
budget_tokens: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, ContextError>> + Send + 'a>>;
}Expand description
Read-only access to a code-index retriever.
Implemented by IndexState in zeph-core. The assembler calls only fetch_code_rag
to populate the code_context slot.
The return type uses Pin<Box<dyn Future>> rather than async fn to preserve
dyn-compatibility: the trait is used as &dyn IndexAccess in ContextAssemblyInput.
Required Methods§
Sourcefn fetch_code_rag<'a>(
&'a self,
query: &'a str,
budget_tokens: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, ContextError>> + Send + 'a>>
fn fetch_code_rag<'a>( &'a self, query: &'a str, budget_tokens: usize, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, ContextError>> + Send + 'a>>
Retrieve up to budget_tokens of code context for the given query.
Returns None when no relevant context is found or when code-index is disabled.
§Errors
Propagates errors from the underlying code retriever.