pub struct HelixDBVectorStore<C, E> { /* private fields */ }Expand description
A client for easily carrying out Rig-related vector store operations.
If you are unsure what type to use for the client, helix_rs::HelixDB is the typical default.
Usage:
let openai_model =
rig::providers::openai::Client::from_env().embedding_model("text-embedding-ada-002");
let helixdb_client = HelixDB::new(None, Some(6969), None);
let vector_store = HelixDBVectorStore::new(helixdb_client, openai_model.clone());Implementations§
Source§impl<C, E> HelixDBVectorStore<C, E>
impl<C, E> HelixDBVectorStore<C, E>
Trait Implementations§
Source§impl<C, E> InsertDocuments for HelixDBVectorStore<C, E>
impl<C, E> InsertDocuments for HelixDBVectorStore<C, E>
Source§impl<C, E> VectorStoreIndex for HelixDBVectorStore<C, E>
impl<C, E> VectorStoreIndex for HelixDBVectorStore<C, E>
Source§async fn top_n<T: for<'a> Deserialize<'a> + Send>(
&self,
req: VectorSearchRequest<HelixDBFilter>,
) -> Result<Vec<(f64, String, T)>, VectorStoreError>
async fn top_n<T: for<'a> Deserialize<'a> + Send>( &self, req: VectorSearchRequest<HelixDBFilter>, ) -> Result<Vec<(f64, String, T)>, VectorStoreError>
Returns the top N most similar documents as
(score, id, document) tuples.Source§async fn top_n_ids(
&self,
req: VectorSearchRequest<HelixDBFilter>,
) -> Result<Vec<(f64, String)>, VectorStoreError>
async fn top_n_ids( &self, req: VectorSearchRequest<HelixDBFilter>, ) -> Result<Vec<(f64, String)>, VectorStoreError>
Returns the top N most similar document IDs as
(score, id) tuples.Auto Trait Implementations§
impl<C, E> Freeze for HelixDBVectorStore<C, E>
impl<C, E> RefUnwindSafe for HelixDBVectorStore<C, E>where
C: RefUnwindSafe,
E: RefUnwindSafe,
impl<C, E> Send for HelixDBVectorStore<C, E>
impl<C, E> Sync for HelixDBVectorStore<C, E>
impl<C, E> Unpin for HelixDBVectorStore<C, E>
impl<C, E> UnsafeUnpin for HelixDBVectorStore<C, E>where
C: UnsafeUnpin,
E: UnsafeUnpin,
impl<C, E> UnwindSafe for HelixDBVectorStore<C, E>where
C: UnwindSafe,
E: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T, F> Tool for Twhere
F: SearchFilter<Value = Value> + WasmCompatSend + WasmCompatSync + for<'de> Deserialize<'de>,
T: VectorStoreIndex<Filter = F>,
impl<T, F> Tool for Twhere
F: SearchFilter<Value = Value> + WasmCompatSend + WasmCompatSync + for<'de> Deserialize<'de>,
T: VectorStoreIndex<Filter = F>,
Source§const NAME: &'static str = "search_vector_store"
const NAME: &'static str = "search_vector_store"
The name of the tool. This name should be unique.
Source§type Error = VectorStoreError
type Error = VectorStoreError
The error type of the tool.
Source§type Args = VectorSearchRequest<F>
type Args = VectorSearchRequest<F>
The arguments type of the tool.
Source§type Output = Vec<VectorStoreOutput>
type Output = Vec<VectorStoreOutput>
The output type of the tool.
Source§async fn definition(&self, _prompt: String) -> ToolDefinition
async fn definition(&self, _prompt: String) -> ToolDefinition
A method returning the tool definition. The user prompt can be used to
tailor the definition to the specific use case.