Base class for chat model tests.
ChatModelTests()The chat model class to test, e.g., ChatParrotLink.
Initialization parameters for the chat model.
Standard chat model parameters.
Whether the model supports tool calling.
Whether the model supports tool calling.
Whether the chat model supports structured output.
Additional kwargs to pass to with_structured_output() in tests.
Override this property to customize how structured output is generated
for your model. The most common use case is specifying the method
parameter, which controls the mechanism used to enforce structured output:
'function_calling': Uses tool/function calling to enforce the schema.'json_mode': Uses the model's JSON mode.'json_schema': Uses native JSON schema support (e.g., OpenAI's
structured outputs).Whether the chat model supports JSON mode.
Supports image inputs.
Whether the chat model supports image inputs, defaults to
False.
Supports image inputs from URLs.
Whether the chat model supports image inputs from URLs, defaults to
False.
Whether the chat model supports PDF inputs, defaults to False.
Supports audio inputs.
Whether the chat model supports audio inputs, defaults to False.
Supports video inputs.
Whether the chat model supports video inputs, defaults to False.
No current tests are written for this feature.
Returns usage metadata.
Whether the chat model returns usage metadata on invoke and streaming responses.
Whether the chat model supports Anthropic-style inputs.
Supports image ToolMessage objects.
Whether the chat model supports ToolMessage objects that include image
content.
Supports PDF ToolMessage objects.
Whether the chat model supports ToolMessage objects that include PDF
content.
Whether to enable VCR tests for the chat model.
See enable_vcr_tests dropdown above <ChatModelTests> for more
information.
Supported usage metadata details.
What usage metadata details are emitted in invoke and stream. Only needs to be overridden if these details are returned by the model.
Whether the model supports overriding the model name at runtime.
Defaults to True.
If True, the model accepts a model kwarg in invoke(), stream(),
etc. that overrides the model specified at initialization.
This enables dynamic model selection without creating new instances.
Alternative model name to use when testing model override.
Should return a valid model name that differs from the default model.
Required if supports_model_override is True.