diff --git a/src/predictions.rs b/src/predictions.rs index 0f33a74..6308c31 100644 --- a/src/predictions.rs +++ b/src/predictions.rs @@ -19,7 +19,7 @@ use crate::models::ModelClient; use crate::{api_key, base_url}; /// Status of a retrieved or created prediction -#[derive(serde::Serialize, serde::Deserialize, Debug, Eq, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Eq, PartialEq, Clone)] #[serde(rename_all = "lowercase")] pub enum PredictionStatus { /// The prediction is starting up. If this status lasts longer than a few seconds, then it's @@ -96,6 +96,11 @@ impl Prediction { anyhow::Ok(()) } + /// Get the status for the current prediction + pub async fn get_status(&mut self) -> PredictionStatus { + self.status.clone() + } + /// Get the stream from a prediction pub async fn get_stream( &mut self,