Skip to content

Commit abd17ea

Browse files
glyuckm1guelpf
authored andcommitted
Add inputTokenDetails and outputTokenDetails to Response.usage
1 parent 096cb14 commit abd17ea

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Models/Response.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,25 @@ public struct Response: Identifiable, Codable, Equatable, Sendable {
5757
public let totalTokens: Int
5858
public let inputTokens: Int
5959
public let outputTokens: Int
60+
public let inputTokenDetails: InputTokenDetails
61+
public let outputTokenDetails: OutputTokenDetails
62+
63+
public struct InputTokenDetails: Codable, Equatable, Sendable {
64+
public let textTokens: Int
65+
public let audioTokens: Int
66+
public let cachedTokens: Int
67+
public let cachedTokensDetails: CachedTokensDetails
68+
69+
public struct CachedTokensDetails: Codable, Equatable, Sendable {
70+
public let textTokens: Int
71+
public let audioTokens: Int
72+
}
73+
}
74+
75+
public struct OutputTokenDetails: Codable, Equatable, Sendable {
76+
public let textTokens: Int
77+
public let audioTokens: Int
78+
}
6079
}
6180

6281
/// The unique ID of the response.

0 commit comments

Comments
 (0)