qdrant_client/builders/
context_input_builder.rsuse crate::qdrant::*;
pub struct ContextInputBuilder {
pub(crate) pairs: Option<Vec<ContextInputPair>>,
}
impl ContextInputBuilder {
#[allow(unused_mut)]
pub fn pairs<VALUE: core::convert::Into<Vec<ContextInputPair>>>(self, value: VALUE) -> Self {
let mut new = self;
new.pairs = Option::Some(value.into());
new
}
fn build_inner(self) -> Result<ContextInput, std::convert::Infallible> {
Ok(ContextInput {
pairs: self.pairs.unwrap_or_default(),
})
}
fn create_empty() -> Self {
Self {
pairs: core::default::Default::default(),
}
}
}
impl From<ContextInputBuilder> for ContextInput {
fn from(value: ContextInputBuilder) -> Self {
value.build_inner().unwrap_or_else(|_| {
panic!(
"Failed to convert {0} to {1}",
"ContextInputBuilder", "ContextInput"
)
})
}
}
impl ContextInputBuilder {
pub fn build(self) -> ContextInput {
self.build_inner().unwrap_or_else(|_| {
panic!(
"Failed to build {0} into {1}",
"ContextInputBuilder", "ContextInput"
)
})
}
}
impl Default for ContextInputBuilder {
fn default() -> Self {
Self::create_empty()
}
}