mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
docs(standard-tests): enrich doc to indicate missing default values (#34179)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user