pub enum OpenAiCountTokensResponse {
Success {
stats_code: StatusCode,
headers: OpenAiResponseHeaders,
body: ResponseBody,
},
Error {
stats_code: StatusCode,
headers: OpenAiResponseHeaders,
body: OpenAiApiErrorResponse,
},
}Expand description
Full HTTP response for OpenAI responses.input_tokens.count endpoint.
Variants§
Success
Fields
§
stats_code: StatusCodeHTTP status code returned by server (should be 200 OK).
§
headers: OpenAiResponseHeadersResponse headers.
§
body: ResponseBodySuccessful body.
Error
Fields
§
stats_code: StatusCodeHTTP status code returned by server (typically non-2xx).
§
headers: OpenAiResponseHeadersResponse headers.
§
body: OpenAiApiErrorResponseError body.
Trait Implementations§
Source§impl Clone for OpenAiCountTokensResponse
impl Clone for OpenAiCountTokensResponse
Source§fn clone(&self) -> OpenAiCountTokensResponse
fn clone(&self) -> OpenAiCountTokensResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpenAiCountTokensResponse
impl Debug for OpenAiCountTokensResponse
Source§impl<'de> Deserialize<'de> for OpenAiCountTokensResponse
impl<'de> Deserialize<'de> for OpenAiCountTokensResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl TryFrom<ClaudeCountTokensResponse> for OpenAiCountTokensResponse
impl TryFrom<ClaudeCountTokensResponse> for OpenAiCountTokensResponse
Source§type Error = TransformError
type Error = TransformError
The type returned in the event of a conversion error.
Source§fn try_from(value: ClaudeCountTokensResponse) -> Result<Self, TransformError>
fn try_from(value: ClaudeCountTokensResponse) -> Result<Self, TransformError>
Performs the conversion.
Source§impl TryFrom<GeminiCountTokensResponse> for OpenAiCountTokensResponse
impl TryFrom<GeminiCountTokensResponse> for OpenAiCountTokensResponse
Source§type Error = TransformError
type Error = TransformError
The type returned in the event of a conversion error.
Source§fn try_from(value: GeminiCountTokensResponse) -> Result<Self, TransformError>
fn try_from(value: GeminiCountTokensResponse) -> Result<Self, TransformError>
Performs the conversion.
Source§impl TryFrom<OpenAiCountTokensResponse> for ClaudeCountTokensResponse
impl TryFrom<OpenAiCountTokensResponse> for ClaudeCountTokensResponse
Source§type Error = TransformError
type Error = TransformError
The type returned in the event of a conversion error.
Source§fn try_from(value: OpenAiCountTokensResponse) -> Result<Self, TransformError>
fn try_from(value: OpenAiCountTokensResponse) -> Result<Self, TransformError>
Performs the conversion.
Source§impl TryFrom<OpenAiCountTokensResponse> for GeminiCountTokensResponse
impl TryFrom<OpenAiCountTokensResponse> for GeminiCountTokensResponse
Source§type Error = TransformError
type Error = TransformError
The type returned in the event of a conversion error.
Source§fn try_from(value: OpenAiCountTokensResponse) -> Result<Self, TransformError>
fn try_from(value: OpenAiCountTokensResponse) -> Result<Self, TransformError>
Performs the conversion.
impl StructuralPartialEq for OpenAiCountTokensResponse
Auto Trait Implementations§
impl Freeze for OpenAiCountTokensResponse
impl RefUnwindSafe for OpenAiCountTokensResponse
impl Send for OpenAiCountTokensResponse
impl Sync for OpenAiCountTokensResponse
impl Unpin for OpenAiCountTokensResponse
impl UnsafeUnpin for OpenAiCountTokensResponse
impl UnwindSafe for OpenAiCountTokensResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more