docs(standard-tests): enrich doc to indicate missing default values (#34179)

This commit is contained in:
Mason Daugherty
2025-12-02 23:32:21 -05:00
committed by GitHub
parent 064b37f90e
commit 4a242a8a4f
2 changed files with 20 additions and 12 deletions

View File

@@ -320,7 +320,7 @@ class ChatModelIntegrationTests(ChatModelTests):
When using JSON mode, you must prompt the model to output JSON in your
message.
Example:
Example:
```python
structured_llm = llm.with_structured_output(MySchema, method="json_mode")
structured_llm.invoke("... Return the result as JSON.")
@@ -490,6 +490,8 @@ class ChatModelIntegrationTests(ChatModelTests):
Boolean property indicating whether the chat model supports Anthropic-style
inputs.
Defaults to `False`.
These inputs might feature "tool use" and "tool result" content blocks, e.g.,
```python
@@ -510,13 +512,15 @@ class ChatModelIntegrationTests(ChatModelTests):
```python
@property
def supports_anthropic_inputs(self) -> bool:
return False
return True
```
??? info "`supports_image_tool_message`"
Boolean property indicating whether the chat model supports a `ToolMessage`
that includes image content, e.g. in the OpenAI Chat Completions format:
that includes image content, e.g. in the OpenAI Chat Completions format.
Defaults to `False`.
```python
ToolMessage(
@@ -553,13 +557,15 @@ class ChatModelIntegrationTests(ChatModelTests):
```python
@property
def supports_image_tool_message(self) -> bool:
return False
return True
```
??? info "`supports_pdf_tool_message`"
Boolean property indicating whether the chat model supports a `ToolMessage
that include PDF content using the LangChain `FileContentBlock` format:
Boolean property indicating whether the chat model supports a `ToolMessage`
that includes PDF content using the LangChain `FileContentBlock` format.
Defaults to `False`.
```python
ToolMessage(
@@ -581,7 +587,7 @@ class ChatModelIntegrationTests(ChatModelTests):
```python
@property
def supports_pdf_tool_message(self) -> bool:
return False
return True
```
??? info "`supported_usage_metadata_details`"
@@ -589,6 +595,8 @@ class ChatModelIntegrationTests(ChatModelTests):
Property controlling what usage metadata details are emitted in both invoke
and stream.
Defaults to `{"invoke": [], "stream": []}`.
`usage_metadata` is an optional dict attribute on `AIMessage` objects that track
input and output tokens.
@@ -606,6 +614,8 @@ class ChatModelIntegrationTests(ChatModelTests):
[VCR](https://vcrpy.readthedocs.io/en/latest/) caching of HTTP calls, such
as benchmarking tests.
Defaults to `False`.
To enable these tests, follow these steps:
1. Override the `enable_vcr_tests` property to return `True`:
@@ -732,8 +742,7 @@ class ChatModelIntegrationTests(ChatModelTests):
3. Run tests to generate VCR cassettes.
Example:
```bash
```bash title="Example"
uv run python -m pytest tests/integration_tests/test_chat_models.py::TestMyModel::test_stream_time
```
@@ -748,7 +757,7 @@ class ChatModelIntegrationTests(ChatModelTests):
You can then commit the cassette to your repository. Subsequent test runs
will use the cassette instead of making HTTP calls.
''' # noqa: E501,D214
''' # noqa: E501
@property
def standard_chat_model_params(self) -> dict:

View File

@@ -822,8 +822,7 @@ class ChatModelUnitTests(ChatModelTests):
3. Run tests to generate VCR cassettes.
Example:
```bash
```bash title="Example"
uv run python -m pytest tests/integration_tests/test_chat_models.py::TestMyModel::test_stream_time
```