pub struct DciAgent<M: CompletionModel, P: PromptHook<M> = ()> { /* private fields */ }Expand description
A ready-to-run Direct Corpus Interaction agent.
Implementations§
Source§impl<M: CompletionModel + 'static> DciAgent<M, ()>
impl<M: CompletionModel + 'static> DciAgent<M, ()>
Sourcepub fn builder(model: M, corpus: CorpusRoot) -> DciAgentBuilder<M>
pub fn builder(model: M, corpus: CorpusRoot) -> DciAgentBuilder<M>
Start building a DCI agent.
Source§impl<M: CompletionModel + 'static, P: PromptHook<M> + 'static> DciAgent<M, P>
impl<M: CompletionModel + 'static, P: PromptHook<M> + 'static> DciAgent<M, P>
Sourcepub fn agent(&self) -> &Agent<M, P>
pub fn agent(&self) -> &Agent<M, P>
Borrow the underlying rig agent (e.g. to register additional tools or wrap it as a delegate in later phases).
Sourcepub async fn investigate(&self, question: &str) -> Result<String, PromptError>
pub async fn investigate(&self, question: &str) -> Result<String, PromptError>
Run an investigation: prompt the agent and let it interact with the corpus across multiple tool-calling turns until it produces an answer.
Token usage for the whole run is emitted as a telemetry
prompt.completed event (see crate::telemetry).
Auto Trait Implementations§
impl<M, P = ()> !RefUnwindSafe for DciAgent<M, P>
impl<M, P = ()> !UnwindSafe for DciAgent<M, P>
impl<M, P> Freeze for DciAgent<M, P>where
P: Freeze,
impl<M, P> Send for DciAgent<M, P>
impl<M, P> Sync for DciAgent<M, P>
impl<M, P> Unpin for DciAgent<M, P>where
P: Unpin,
impl<M, P> UnsafeUnpin for DciAgent<M, P>where
P: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more