Skip to content
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
5 changes: 5 additions & 0 deletions Sources/OpenAI/Public/Models/ChatStreamResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public struct ChatStreamResult: Codable, Equatable, Sendable {

/// The contents of the chunk message.
public let content: String?
/// The refusal message generated by the model when using Structured Outputs.
public let refusal: String?
/// If the audio output modality is requested, this object contains data about the audio response from the model.
public let audio: ChoiceDeltaAudio?

Expand Down Expand Up @@ -109,6 +111,7 @@ public struct ChatStreamResult: Codable, Equatable, Sendable {

public enum CodingKeys: String, CodingKey {
case content
case refusal
case audio
case role
case toolCalls = "tool_calls"
Expand All @@ -130,6 +133,8 @@ public struct ChatStreamResult: Codable, Equatable, Sendable {
public struct ChoiceLogprobs: Codable, Equatable, Sendable {
/// A list of message content tokens with log probability information.
public let content: [Self.ChatCompletionTokenLogprob]?
/// A list of message refusal tokens with log probability information.
public let refusal: [Self.ChatCompletionTokenLogprob]?

public struct ChatCompletionTokenLogprob: Codable, Equatable, Sendable {
/// The token.
Expand Down