mirror of
https://github.com/openai/codex.git
synced 2026-05-01 11:52:10 +03:00
Add a codex.rate_limits event for websockets (#10324)
When communicating over websockets, we can't rely on headers to deliver rate limit information. This PR adds a `codex.rate_limits` event that the server can pass to the client to inform them about rate limit usage. The client parses this data the same way we parse rate limit headers in HTTP mode. This PR also wires up the etag and reasoning headers for websockets
This commit is contained in:
@@ -165,6 +165,12 @@ pub struct ResponsesStreamEvent {
|
||||
content_index: Option<i64>,
|
||||
}
|
||||
|
||||
impl ResponsesStreamEvent {
|
||||
pub fn kind(&self) -> &str {
|
||||
&self.kind
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum ResponsesEventError {
|
||||
Api(ApiError),
|
||||
|
||||
Reference in New Issue
Block a user