mirror of
https://github.com/openai/codex.git
synced 2026-11-21 22:50:37 +00:00
[codex] Thread backend-selected near-limit prompt state through client models
This commit is contained in:
@@ -44,3 +44,7 @@ pub use self::rate_limit_window_snapshot::RateLimitWindowSnapshot;
|
||||
|
||||
pub(crate) mod credit_status_details;
|
||||
pub use self::credit_status_details::CreditStatusDetails;
|
||||
|
||||
pub(crate) mod usage_limit_nudge;
|
||||
pub use self::usage_limit_nudge::UsageLimitNudge;
|
||||
pub use self::usage_limit_nudge::UsageLimitNudgeAction;
|
||||
|
||||
@@ -44,6 +44,12 @@ pub struct RateLimitStatusPayload {
|
||||
skip_serializing_if = "Option::is_none"
|
||||
)]
|
||||
pub rate_limit_reached_type: Option<Option<RateLimitReachedType>>,
|
||||
#[serde(
|
||||
rename = "current_usage_limit_nudge",
|
||||
default,
|
||||
skip_serializing_if = "Option::is_none"
|
||||
)]
|
||||
pub current_usage_limit_nudge: Option<Box<models::UsageLimitNudge>>,
|
||||
}
|
||||
|
||||
impl RateLimitStatusPayload {
|
||||
@@ -54,6 +60,7 @@ impl RateLimitStatusPayload {
|
||||
credits: None,
|
||||
additional_rate_limits: None,
|
||||
rate_limit_reached_type: None,
|
||||
current_usage_limit_nudge: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* codex-backend
|
||||
*
|
||||
* codex-backend
|
||||
*
|
||||
* The version of the OpenAPI document: 0.0.1
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct UsageLimitNudge {
|
||||
#[serde(rename = "threshold")]
|
||||
pub threshold: u8,
|
||||
#[serde(rename = "action")]
|
||||
pub action: UsageLimitNudgeAction,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum UsageLimitNudgeAction {
|
||||
#[serde(rename = "add_credits")]
|
||||
AddCredits,
|
||||
#[serde(rename = "upgrade")]
|
||||
Upgrade,
|
||||
}
|
||||
Reference in New Issue
Block a user