Skip to content

Conversation

zky001
Copy link

@zky001 zky001 commented Mar 12, 2025

This PR fixes an issue in the streaming response processing where the code incorrectly accessed non-existent attributes (input_tokens and output_tokens) on the Usage object. Instead, the correct property names (prompt_tokens and completion_tokens) should be used. see https://github.com/openai/openai-python/blob/v1.66.2/src/openai/types/completion_usage.py
fix bug metioned in #63

This PR fixes an issue in the streaming response processing where the code incorrectly accessed non-existent attributes (input_tokens and output_tokens) on the Usage object. Instead, the correct property names (prompt_tokens and completion_tokens) should be used.
@Kaikaikaifang
Copy link

This PR #61 has made a more comprehensive fix for this issue.

@zky001 zky001 closed this Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants