diff --git a/async-openai/src/types/responses.rs b/async-openai/src/types/responses.rs index 6b2762c3..bf2f829e 100644 --- a/async-openai/src/types/responses.rs +++ b/async-openai/src/types/responses.rs @@ -1336,7 +1336,7 @@ pub struct Usage { #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] pub struct Response { /// Unix timestamp (in seconds) when this Response was created. - pub created_at: u64, + pub created_at: f64, /// Error object if the API failed to generate a response. #[serde(skip_serializing_if = "Option::is_none")] @@ -1351,7 +1351,7 @@ pub struct Response { /// Instructions that were inserted as the first item in context. #[serde(skip_serializing_if = "Option::is_none")] - pub instructions: Option, + pub instructions: Option, /// The value of `max_output_tokens` that was honored. #[serde(skip_serializing_if = "Option::is_none")] @@ -1432,6 +1432,14 @@ pub struct Response { pub user: Option, } +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[serde(untagged, rename_all = "snake_case")] +pub enum Instructions { + String(String), + Array(Vec), +} + + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] #[serde(rename_all = "snake_case")] pub enum Status { @@ -1439,6 +1447,8 @@ pub enum Status { Failed, InProgress, Incomplete, + Queued, + Cancelled, } /// Event types for streaming responses from the Responses API