mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-27 08:58:48 +00:00
standard-tests: refactoring and fixes (#31703)
- `libs/core/langchain_core/messages/base.py`: add model name to examples [per docs](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) ("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 typo - `libs/standard-tests/langchain_tests/integration_tests/chat_models.py`: - `magic_function(input)` -> `magic_function(_input)` to prevent warning about redefining built in `input` - relocate a few tests for better grouping and narrative flow - suppress some type hint warnings following suit from similar tests - fix a few more typos - validate not only that `model_name` is defined, but that it is not empty (test_usage_metadata)
This commit is contained in:
parent
b6f74bff40
commit
6d71b6b6ee
@ -34,7 +34,8 @@ class BaseMessage(Serializable):
|
||||
"""
|
||||
|
||||
response_metadata: dict = Field(default_factory=dict)
|
||||
"""Response metadata. For example: response headers, logprobs, token counts."""
|
||||
"""Response metadata. For example: response headers, logprobs, token counts, model
|
||||
name."""
|
||||
|
||||
type: str
|
||||
"""The type of the message. Must be a string that is unique to the message type.
|
||||
|
@ -668,7 +668,7 @@ def tool_example_to_messages(
|
||||
..., description="The color of the person's hair if known"
|
||||
)
|
||||
height_in_meters: Optional[str] = Field(
|
||||
..., description="Height in METERs"
|
||||
..., description="Height in METERS"
|
||||
)
|
||||
|
||||
examples = [
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user