Struct weaviate_community::Classification
source · pub struct Classification { /* private fields */ }
Expand description
All classification related endpoints and functionality described in Weaviate meta API documentation
Implementations§
source§impl Classification
impl Classification
sourcepub async fn schedule(
&self,
request: ClassificationRequest
) -> Result<ClassificationResponse, Box<dyn Error>>
pub async fn schedule( &self, request: ClassificationRequest ) -> Result<ClassificationResponse, Box<dyn Error>>
Schedule a new classification
§Example
use weaviate_community::WeaviateClient;
use weaviate_community::collections::classification::{
ClassificationRequest,
ClassificationType
};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = WeaviateClient::builder("http://localhost:8080").build()?;
let req = ClassificationRequest::builder()
.with_type(ClassificationType::KNN)
.with_class("Article")
.with_based_on_properties(vec!["summary"])
.with_classify_properties(vec!["hasPopularity"])
.with_filters(serde_json::json!({
"trainingSetWhere": {
"path": ["wordCount"],
"operator": "GreaterThan",
"valueInt": 100
}
}))
.with_settings(serde_json::json!({
"k": 3
}))
.build();
let res = client.classification.schedule(req).await?;
Ok(())
}
sourcepub async fn get(
&self,
id: Uuid
) -> Result<ClassificationResponse, Box<dyn Error>>
pub async fn get( &self, id: Uuid ) -> Result<ClassificationResponse, Box<dyn Error>>
Get the status of a classification
§Example
use uuid::Uuid;
use weaviate_community::WeaviateClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let uuid = Uuid::parse_str("00037775-1432-35e5-bc59-443baaef7d80")?;
let client = WeaviateClient::builder("http://localhost:8080").build()?;
let res = client.classification.get(uuid).await?;
Ok(())
}
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Classification
impl Send for Classification
impl Sync for Classification
impl Unpin for Classification
impl !UnwindSafe for Classification
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