langchain
1df3ee91 - partners: (langchain-openai) total_tokens should not add 'Nonetype' t… (#31146)

Commit
241 days ago
partners: (langchain-openai) total_tokens should not add 'Nonetype' t… (#31146) partners: (langchain-openai) total_tokens should not add 'Nonetype' t… # PR Description ## Description Fixed an issue in `langchain-openai` where `total_tokens` was incorrectly adding `None` to an integer, causing a TypeError. The fix ensures proper type checking before adding token counts. ## Issue Fixes the TypeError traceback shown in the image where `'NoneType'` cannot be added to an integer. ## Dependencies None ## Twitter handle None ![image](https://github.com/user-attachments/assets/9683a795-a003-455a-ada9-fe277245e2b2) Co-authored-by: qiulijie <qiulijie@yuaiweiwu.com>
Author
Parents
Loading