Skip to content

Commit

Permalink
added helper function in Prediction to retrieve status
Browse files Browse the repository at this point in the history
  • Loading branch information
KCaverly committed Dec 4, 2023
1 parent ef43cbd commit 40a8bae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/predictions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 40a8bae

Please sign in to comment.