Closed fizz-viva closed 2 months ago
@fizz-viva this is now available on the main
branch and in AIProxySwift release 0.24.0. Please see this PR for usage instructions: https://github.com/lzell/AIProxySwift/pull/45
Thanks for the feedback!
@lzell ah, great. Thanks a lot.
`public struct OpenAIChatUsage: Decodable { /// Number of tokens in the generated completion. let completionTokens: Int?
/// Number of tokens in the prompt.
let promptTokens: Int?
/// Total number of tokens used in the request (prompt + completion).
let totalTokens: Int?
/// Breakdown of tokens used in a completion.
let completionTokensDetails: Details?
private enum CodingKeys: String, CodingKey {
case completionTokens = "completion_tokens"
case promptTokens = "prompt_tokens"
case totalTokens = "total_tokens"
case completionTokensDetails = "completion_tokens_details"
}
}`
Hey @lzell did you forget to make properties public to access outside of the package? Please have a look and make them accessible publicly.
@fizz-viva whoops! Fixed now on main and version v0.24.1
"usage": { "completion_tokens" = 61; "completion_tokens_details" = { "reasoning_tokens" = 0; }; "prompt_tokens" = 94; "total_tokens" = 155; }
Can we get the usage object in the response model please?