Skip to content

Commit 66f3cfd

Browse files
committed
Make chat completions response sendable
1 parent bb9012a commit 66f3cfd

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Sources/OpenAI/Chat/ChatCompletionsResponse.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
import Foundation
99

1010
public extension ChatCompletions {
11-
struct Response: Decodable, Identifiable {
11+
struct Response: Decodable, Sendable, Identifiable {
1212
public let id: String
1313
public let object: String
1414
public let created: Date
1515
public let model: Model
1616
public let choices: [Choice]
1717
public let usage: Usage?
1818

19-
public struct Message: Decodable {
19+
public struct Message: Decodable, Sendable {
2020
/// The contents of the message
2121
public let content: String
2222
/// The refusal message generated by the model.
@@ -27,24 +27,24 @@ public extension ChatCompletions {
2727
public let audio: AudioResponse?
2828
}
2929

30-
public struct Choice: Decodable {
30+
public struct Choice: Decodable, Sendable {
3131
public let index: Int?
3232
public let message: Message?
3333
public let finishReason: FinishReason?
3434
}
3535

36-
public struct Chunk: Decodable, Identifiable {
36+
public struct Chunk: Decodable, Sendable, Identifiable {
3737
public let id: String
3838
public let object: String
3939
public let created: Int
4040
public let model: Model
4141
public let choices: [ChunkChoice]
4242

43-
public struct ChunkDelta: Decodable {
43+
public struct ChunkDelta: Decodable, Sendable {
4444
public let content: String?
4545
}
4646

47-
public struct ChunkChoice: Decodable {
47+
public struct ChunkChoice: Decodable, Sendable {
4848
public let index: Int
4949
public let delta: ChunkDelta
5050
public let finishReason: FinishReason?

0 commit comments

Comments
 (0)