-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openai:compatible with other llm usage meta data #24500
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add a test case where both content and usage_metadata are returned? I'm pretty sure this has the exact same bug as #23704
I think this if/else block would need more substantial refactoring to work with this.
Will mark as draft for now - feel free to mark ready again when that's fixed!
@efriis Yes, the same one. Based on the original, the return stream chunk message and unit tests of chatglm4, deepseek and gpt-3.5-turbo are added in libs/partners/openai/tests/unit_tests/chat_models/test_base.py. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you fix the lint errors in the new tests?
…_llm_usage # Conflicts: # libs/partners/openai/tests/unit_tests/chat_models/test_base.py
PR message:
Add tests and docs:
libs/partners/openai/tests/unit_tests/chat_models/test_base.py
cd libs/partners/openai poetry run pytest tests/unit_tests/chat_models/test_base.py::test_openai_astream poetry run pytest tests/unit_tests/chat_models/test_base.py::test_openai_stream poetry run pytest tests/unit_tests/chat_models/test_base.py::test_deepseek_astream poetry run pytest tests/unit_tests/chat_models/test_base.py::test_deepseek_stream poetry run pytest tests/unit_tests/chat_models/test_base.py::test_glm4_astream poetry run pytest tests/unit_tests/chat_models/test_base.py::test_glm4_stream