mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-14 15:16:21 +00:00
expant unit tests v1
This commit is contained in:
parent
16729de369
commit
308e734c78
@ -7,7 +7,7 @@ This module provides updated test patterns for the new messages introduced in
|
||||
content blocks system.
|
||||
"""
|
||||
|
||||
from typing import cast
|
||||
from typing import Literal, cast
|
||||
|
||||
import pytest
|
||||
from langchain_core.language_models.v1.chat_models import BaseChatModelV1
|
||||
@ -154,6 +154,49 @@ class ChatModelV1Tests(BaseStandardTests):
|
||||
"""Whether the model can handle ``InvalidToolCall`` blocks."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def has_tool_choice(self) -> bool:
|
||||
"""Whether the model supports forcing tool calling via ``tool_choice``."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def structured_output_kwargs(self) -> dict:
|
||||
"""Additional kwargs for ``with_structured_output``."""
|
||||
return {}
|
||||
|
||||
@property
|
||||
def supports_anthropic_inputs(self) -> bool:
|
||||
"""Whether the model supports Anthropic-style inputs."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def returns_usage_metadata(self) -> bool:
|
||||
"""Whether the model returns usage metadata on invoke and streaming."""
|
||||
return True
|
||||
|
||||
@property
|
||||
def supported_usage_metadata_details(
|
||||
self,
|
||||
) -> dict[
|
||||
Literal["invoke", "stream"],
|
||||
list[
|
||||
Literal[
|
||||
"audio_input",
|
||||
"audio_output",
|
||||
"reasoning_output",
|
||||
"cache_read_input",
|
||||
"cache_creation_input",
|
||||
]
|
||||
],
|
||||
]:
|
||||
"""What usage metadata details are emitted in ``invoke()`` and ``stream()``."""
|
||||
return {"invoke": [], "stream": []}
|
||||
|
||||
@property
|
||||
def enable_vcr_tests(self) -> bool:
|
||||
"""Whether to enable VCR tests for the chat model."""
|
||||
return False
|
||||
|
||||
|
||||
class ChatModelV1UnitTests(ChatModelV1Tests):
|
||||
"""Unit tests for chat models with content blocks v1 support.
|
||||
|
Loading…
Reference in New Issue
Block a user