Skip to content

Commit 7739fc6

Browse files
committed
Update bit about completion token counting
1 parent dfe0376 commit 7739fc6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ client.chat(
195195
# => "Anna is a young woman in her mid-twenties, with wavy chestnut hair that falls to her shoulders..."
196196
```
197197

198-
Note: the API docs state that token usage is included in the streamed chat chunk objects, but this doesn't currently appear to be the case. To count tokens while streaming, try `OpenAI.rough_token_count` or [tiktoken_ruby](https://github.com/IAPark/tiktoken_ruby).
198+
Note: OpenAPI currently does not report token usage for streaming responses. To count tokens while streaming, try `OpenAI.rough_token_count` or [tiktoken_ruby](https://github.com/IAPark/tiktoken_ruby). Also, each call to the stream proc corresponds to a single token, so you can count the number of calls to the proc to get the completion token count.
199199

200200
### Functions
201201

0 commit comments

Comments
 (0)