Skip to content

fixed the error that some openai compatible api's response don't have "object" field #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions async-openai/src/types/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ pub struct CreateChatCompletionResponse {
pub system_fingerprint: Option<String>,

/// The object type, which is always `chat.completion`.
pub object: String,
pub object: Option<String>,
pub usage: Option<CompletionUsage>,
}

Expand Down Expand Up @@ -980,7 +980,7 @@ pub struct CreateChatCompletionStreamResponse {
/// Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
pub system_fingerprint: Option<String>,
/// The object type, which is always `chat.completion.chunk`.
pub object: String,
pub object: Option<String>,

/// An optional field that will only be present when you set `stream_options: {"include_usage": true}` in your request.
/// When present, it contains a null value except for the last chunk which contains the token usage statistics for the entire request.
Expand Down