pub struct RagAgent<M: CompletionModel, C: VectorStoreIndex, T: VectorStoreIndex> {
pub tools: ToolSet,
/* private fields */
}
Expand description
Struct representing a RAG agent, i.e.: an agent enhanced with two collections of vector store indices, one for context documents and one for tools. The ragged context and tools are used to enhance the completion model at prompt-time. Note: The type of the VectorStoreIndex must be the same for all the dynamic context and tools indices (but can be different for context and tools). If you need to use a more complex combination of vector store indices, you should implement a custom agent.
Fields§
§tools: ToolSet
Actual tool implementations
Implementations§
source§impl<M: CompletionModel, C: VectorStoreIndex, T: VectorStoreIndex> RagAgent<M, C, T>
impl<M: CompletionModel, C: VectorStoreIndex, T: VectorStoreIndex> RagAgent<M, C, T>
Trait Implementations§
source§impl<M: CompletionModel, C: VectorStoreIndex, T: VectorStoreIndex> Chat for RagAgent<M, C, T>
impl<M: CompletionModel, C: VectorStoreIndex, T: VectorStoreIndex> Chat for RagAgent<M, C, T>
source§impl<M: CompletionModel, C: VectorStoreIndex, T: VectorStoreIndex> Completion<M> for RagAgent<M, C, T>
impl<M: CompletionModel, C: VectorStoreIndex, T: VectorStoreIndex> Completion<M> for RagAgent<M, C, T>
source§async fn completion(
&self,
prompt: &str,
chat_history: Vec<Message>,
) -> Result<CompletionRequestBuilder<M>, CompletionError>
async fn completion( &self, prompt: &str, chat_history: Vec<Message>, ) -> Result<CompletionRequestBuilder<M>, CompletionError>
Generates a completion request builder for the given
prompt
and chat_history
.
This function is meant to be called by the user to further customize the
request at prompt time before sending it. Read moresource§impl<M: CompletionModel, C: VectorStoreIndex, T: VectorStoreIndex> Prompt for RagAgent<M, C, T>
impl<M: CompletionModel, C: VectorStoreIndex, T: VectorStoreIndex> Prompt for RagAgent<M, C, T>
Auto Trait Implementations§
impl<M, C, T> Freeze for RagAgent<M, C, T>where
M: Freeze,
impl<M, C, T> !RefUnwindSafe for RagAgent<M, C, T>
impl<M, C, T> Send for RagAgent<M, C, T>
impl<M, C, T> Sync for RagAgent<M, C, T>
impl<M, C, T> Unpin for RagAgent<M, C, T>
impl<M, C, T> !UnwindSafe for RagAgent<M, C, T>
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