Skip to content

Commit aea9ccd

Browse files
refactor: makes the id in the ChatCompletion and ChatCompletionChunk optional (#19)
1 parent fbd2b13 commit aea9ccd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/LLMChatOpenAI/ChatCompletion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
/// A struct that represents a chat completion response.
1111
public struct ChatCompletion: Decodable, Sendable {
1212
/// A unique identifier for the chat completion.
13-
public let id: String
13+
public let id: String?
1414

1515
/// An array of chat completion choices. Can be more than one if `n` is greater than 1.
1616
public let choices: [Choice]

Sources/LLMChatOpenAI/ChatCompletionChunk.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
/// A struct that represents a streamed chunk of a chat completion response.
1111
public struct ChatCompletionChunk: Decodable, Sendable {
1212
/// A unique identifier for the chat completion. Each chunk has the same identifier.
13-
public let id: String
13+
public let id: String?
1414

1515
/// An array of chat completion choices. Can contain more than one elements if `n` is greater than 1.
1616
public var choices: [Choice]

0 commit comments

Comments
 (0)