Commit f5c51fc
authored
Fix openai count_tokens (#5281)
### Description
`choice.message` is a
[`ChatCompletionMessage`](https://github.com/openai/openai-python/blob/1d77265e3d31afda8df6528a1926c854ef27de3b/src/openai/types/chat/chat_completion.py#L39-L40)
and not a string
#### Issues
* resolves: #5277
* resolves: PY-20241 parent a979755 commit f5c51fc
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | | - | |
| 91 | + | |
| 92 | + | |
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
| |||
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
160 | | - | |
161 | | - | |
| 163 | + | |
| 164 | + | |
162 | 165 | | |
163 | 166 | | |
164 | 167 | | |
| |||
0 commit comments