pub struct PredictionBuilder { /* private fields */ }
Expand description
Builder for creating predictions with a fluent API.
Implementations§
Source§impl PredictionBuilder
impl PredictionBuilder
Sourcepub fn new(api: PredictionsApi, version: impl Into<String>) -> Self
pub fn new(api: PredictionsApi, version: impl Into<String>) -> Self
Create a new prediction builder.
Sourcepub fn inputs(self, inputs: HashMap<String, Value>) -> Self
pub fn inputs(self, inputs: HashMap<String, Value>) -> Self
Add multiple input parameters from a HashMap.
Sourcepub fn file_input<K>(self, key: K, file: FileInput) -> Self
pub fn file_input<K>(self, key: K, file: FileInput) -> Self
Add a file input parameter.
Sourcepub fn file_input_with_strategy<K>(
self,
key: K,
file: FileInput,
strategy: FileEncodingStrategy,
) -> Self
pub fn file_input_with_strategy<K>( self, key: K, file: FileInput, strategy: FileEncodingStrategy, ) -> Self
Add a file input with specific encoding strategy.
Sourcepub async fn send(self) -> Result<Prediction>
pub async fn send(self) -> Result<Prediction>
Send the prediction request.
Sourcepub async fn send_and_wait(self) -> Result<Prediction>
pub async fn send_and_wait(self) -> Result<Prediction>
Send the prediction request and wait for completion.
Sourcepub async fn send_and_wait_with_timeout(
self,
max_duration: Duration,
) -> Result<Prediction>
pub async fn send_and_wait_with_timeout( self, max_duration: Duration, ) -> Result<Prediction>
Send the prediction request and wait for completion with custom timeout.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PredictionBuilder
impl !RefUnwindSafe for PredictionBuilder
impl Send for PredictionBuilder
impl Sync for PredictionBuilder
impl Unpin for PredictionBuilder
impl !UnwindSafe for PredictionBuilder
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