pub struct AsyncCortexDbClient { /* private fields */ }Expand description
Async HTTP client for the CortexDB API.
Enable with the async feature:
cortex-sdk = { version = "...", features = ["async"] }Implementations§
Source§impl AsyncCortexDbClient
impl AsyncCortexDbClient
pub async fn health(&self) -> SdkResult<Value>
pub async fn health_response(&self) -> SdkResult<HealthResponse>
pub async fn stats(&self) -> SdkResult<Value>
pub async fn stats_response(&self) -> SdkResult<StatsResponse>
pub async fn validate(&self) -> SdkResult<Value>
pub async fn validate_response(&self) -> SdkResult<ValidationResponse>
pub async fn put_cell(&self, cell_id: u64, payload: &str) -> SdkResult<Value>
pub async fn put_cell_response( &self, cell_id: u64, payload: &str, ) -> SdkResult<PutCellResponse>
pub async fn write_batch(&self, request: &WriteBatchRequest) -> SdkResult<Value>
pub async fn write_batch_response( &self, request: &WriteBatchRequest, ) -> SdkResult<WriteBatchResponse>
pub async fn get_cell(&self, cell_id: u64) -> SdkResult<Value>
pub async fn get_cell_response( &self, cell_id: u64, ) -> SdkResult<CellLookupResponse>
pub async fn tombstone_cell(&self, cell_id: u64) -> SdkResult<Value>
pub async fn flush(&self) -> SdkResult<Value>
pub async fn compact(&self) -> SdkResult<Value>
Source§impl AsyncCortexDbClient
impl AsyncCortexDbClient
pub async fn ingest_text( &self, scope: &str, source: &str, text: &str, ) -> SdkResult<Value>
pub async fn ingest_text_response( &self, scope: &str, source: &str, text: &str, ) -> SdkResult<IngestResponse>
pub async fn ingest_json( &self, scope: &str, source: &str, document: &str, ) -> SdkResult<Value>
pub async fn ingest_json_response( &self, scope: &str, source: &str, document: &str, ) -> SdkResult<IngestResponse>
pub async fn ingest_csv( &self, scope: &str, source: &str, document: &str, ) -> SdkResult<Value>
pub async fn ingest_csv_response( &self, scope: &str, source: &str, document: &str, ) -> SdkResult<IngestResponse>
pub async fn ingestion_job(&self, job_id: u64) -> SdkResult<Value>
pub async fn ingestion_job_response( &self, job_id: u64, ) -> SdkResult<IngestionJobResponse>
pub async fn delete_ingestion_job( &self, job_id: u64, ) -> SdkResult<DeleteJobResponse>
pub async fn retry_ingestion_job( &self, job_id: u64, ) -> SdkResult<IngestionJobResponse>
Source§impl AsyncCortexDbClient
impl AsyncCortexDbClient
pub async fn aql(&self, scope: &str, statement: &str) -> SdkResult<Value>
pub async fn aql_response( &self, scope: &str, statement: &str, ) -> SdkResult<AqlResponse>
pub async fn context(&self, scope: &str, statement: &str) -> SdkResult<Value>
pub async fn context_response( &self, scope: &str, statement: &str, ) -> SdkResult<ContextPackResponse>
pub async fn context_prompt( &self, scope: &str, statement: &str, ) -> SdkResult<String>
pub async fn context_markdown( &self, scope: &str, statement: &str, ) -> SdkResult<String>
pub async fn verify(&self, scope: &str, statement: &str) -> SdkResult<Value>
pub async fn verify_response( &self, scope: &str, statement: &str, ) -> SdkResult<VerificationReportResponse>
pub async fn verify_request_response( &self, request: &VerifyRequest, ) -> SdkResult<VerificationReportResponse>
pub async fn verify_request_export( &self, request: &VerifyRequest, ) -> SdkResult<String>
pub async fn answer_with_grounded_context<F, Fut>( &self, request: GroundedAnswerRequest, answerer: F, ) -> SdkResult<GroundedAnswerResponse>
pub async fn remember(&self, scope: &str, statement: &str) -> SdkResult<Value>
pub async fn remember_response( &self, scope: &str, statement: &str, ) -> SdkResult<RememberResponse>
Source§impl AsyncCortexDbClient
impl AsyncCortexDbClient
pub async fn search_keyword( &self, scope: &str, query: &str, limit: usize, ) -> SdkResult<Value>
pub async fn search_keyword_response( &self, scope: &str, query: &str, limit: usize, ) -> SdkResult<SearchResponse>
pub async fn search_auto( &self, scope: &str, query: &str, vector: Option<&str>, limit: usize, ) -> SdkResult<Value>
pub async fn search_auto_response( &self, scope: &str, query: &str, vector: Option<&str>, limit: usize, ) -> SdkResult<SearchResponse>
pub async fn search_explain( &self, scope: &str, query: &str, mode: &str, vector: Option<&str>, limit: usize, ) -> SdkResult<Value>
pub async fn search_explain_response( &self, scope: &str, query: &str, mode: &str, vector: Option<&str>, limit: usize, ) -> SdkResult<SearchExplainResponse>
pub async fn search_vector( &self, scope: &str, vector: &[i16], algorithm: VectorAlgorithm, limit: usize, ) -> SdkResult<Value>
pub async fn search_vector_response( &self, scope: &str, vector: &[i16], algorithm: VectorAlgorithm, limit: usize, ) -> SdkResult<SearchResponse>
pub async fn evaluate_ann( &self, scope: &str, vector: &[i16], limit: usize, ) -> SdkResult<Value>
pub async fn evaluate_ann_response( &self, scope: &str, vector: &[i16], limit: usize, ) -> SdkResult<AnnEvaluationResponse>
Source§impl AsyncCortexDbClient
impl AsyncCortexDbClient
Sourcepub fn new(base_url: impl Into<String>) -> Self
pub fn new(base_url: impl Into<String>) -> Self
Create an async client with the default 10-second per-request timeout.
Sourcepub fn with_timeout(base_url: impl Into<String>, timeout: Duration) -> Self
pub fn with_timeout(base_url: impl Into<String>, timeout: Duration) -> Self
Create an async client with a custom per-request timeout.
Sourcepub fn with_token(self, token: impl Into<String>) -> Self
pub fn with_token(self, token: impl Into<String>) -> Self
Set the Bearer token for authenticated requests.
Sourcepub fn with_tenant(self, tenant: impl Into<String>) -> Self
pub fn with_tenant(self, tenant: impl Into<String>) -> Self
Set the tenant ID for per-tenant database routing.
Sourcepub fn with_retries(self, max_retries: u32, retry_delay: Duration) -> Self
pub fn with_retries(self, max_retries: u32, retry_delay: Duration) -> Self
Set retry behaviour for transient requests.
Trait Implementations§
Source§impl Clone for AsyncCortexDbClient
impl Clone for AsyncCortexDbClient
Source§fn clone(&self) -> AsyncCortexDbClient
fn clone(&self) -> AsyncCortexDbClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AsyncCortexDbClient
impl !UnwindSafe for AsyncCortexDbClient
impl Freeze for AsyncCortexDbClient
impl Send for AsyncCortexDbClient
impl Sync for AsyncCortexDbClient
impl Unpin for AsyncCortexDbClient
impl UnsafeUnpin for AsyncCortexDbClient
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