-
Notifications
You must be signed in to change notification settings - Fork 17.9k
standard-tests: refactoring and fixes #31703
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
Conversation
version 0.3.17 checks for the presence of `model_name` in `response_metadata`, which is needed for usage tracking in callback handlers (source: https://python.langchain.com/api_reference/standard_tests/integration_tests/langchain_tests.integration_tests.chat_models.ChatModelIntegrationTests.html#langchain_tests.integration_tests.chat_models.ChatModelIntegrationTests.test_usage_metadata)
…the structure of the rest of the file)
…ition of built-in function
…llow similar positioning as js
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
CodSpeed WallTime Performance ReportMerging #31703 will not alter performanceComparing
|
CodSpeed Instrumentation Performance ReportMerging #31703 will not alter performanceComparing Summary
|
Eventually we should enforce more linting / type checking rules, good to fix these now though! |
libs/standard-tests/langchain_tests/integration_tests/chat_models.py
Outdated
Show resolved
Hide resolved
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.
Seems like a reasonable cleanup, let's confirm with @ccurme who owns integration test stuff :)
libs/standard-tests/langchain_tests/integration_tests/chat_models.py
Outdated
Show resolved
Hide resolved
closing some ties here, @ccurme will you merge after a final review? |
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.
Changes looking good, but a few nit picks to make this a bit more pythonic / less redundant!
libs/standard-tests/langchain_tests/integration_tests/chat_models.py
Outdated
Show resolved
Hide resolved
libs/standard-tests/langchain_tests/integration_tests/chat_models.py
Outdated
Show resolved
Hide resolved
libs/standard-tests/langchain_tests/integration_tests/chat_models.py
Outdated
Show resolved
Hide resolved
libs/standard-tests/langchain_tests/integration_tests/chat_models.py
Outdated
Show resolved
Hide resolved
…ol call validations plus additional clean ups
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.
Great!
libs/core/langchain_core/messages/base.py
: add model name to examples per docs ("0.3.17: Additionally check for the presence of model_name in the response metadata, which is needed for usage tracking in callback handlers")libs/core/langchain_core/utils/function_calling.py
: correct typolibs/standard-tests/langchain_tests/integration_tests/chat_models.py
:magic_function(input)
->magic_function(_input)
to prevent warning about redefining built ininput
model_name
is defined, but that it is not empty (test_usage_metadata)