Skip to content

The agent engineering platform.

docs(standard-tests): fix formatting bug, rearrange admonition (#34180)

Mason Daugherty1922adc0922e
diff --git a/libs/standard-tests/langchain_tests/integration_tests/chat_models.py b/libs/standard-tests/langchain_tests/integration_tests/chat_models.py
index 6c3fcf62eb..c925346907 100644
--- a/libs/standard-tests/langchain_tests/integration_tests/chat_models.py
+++ b/libs/standard-tests/langchain_tests/integration_tests/chat_models.py
@@ -395,6 +395,51 @@ class ChatModelIntegrationTests(ChatModelTests):
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.
+
+ Defaults to `False`.
+
+ ```python
+ ToolMessage(
+ content=[
+ {
+ "type": "image_url",
+ "image_url": {"url": f"data:image/jpeg;base64,{image_data}"},
+ },
+ ],
+ tool_call_id="1",
+ name="random_image",
+ )
+ ```
+
+ ...as well as the LangChain `ImageContentBlock` format:
+
+ ```python
+ ToolMessage(
+ content=[
+ {
+ "type": "image",
+ "base64": image_data,
+ "mime_type": "image/jpeg",
+ },
+ ],
+ tool_call_id="1",
+ name="random_image",
+ )
+ ```
+
+ If set to `True`, the chat model will be tested with message sequences that
+ include `ToolMessage` objects of this form.
+
+ ```python
+ @property
+ def supports_image_tool_message(self) -> bool:
+ return True
+ ```
+
??? info "`supports_pdf_inputs`"
Boolean property indicating whether the chat model supports PDF inputs.
@@ -420,6 +465,36 @@ class ChatModelIntegrationTests(ChatModelTests):
return True
```
+ ??? info "`supports_pdf_tool_message`"
+
+ Boolean property indicating whether the chat model supports a `ToolMessage`
+ that includes PDF content using the LangChain `FileContentBlock` format.
+
+ Defaults to `False`.
+
+ ```python
+ ToolMessage(
+ content=[
+ {
+ "type": "file",
+ "base64": pdf_data,
+ "mime_type": "application/pdf",
+ },
+ ],
+ tool_call_id="1",
+ name="random_pdf",
+ )
+ ```
+
+ If set to `True`, the chat model will be tested with message sequences that
+ include `ToolMessage` objects of this form.
+
+ ```python
+ @property
+ def supports_pdf_tool_message(self) -> bool:
+ return True
+ ```
+
??? info "`supports_audio_inputs`"
Boolean property indicating whether the chat model supports audio inputs.
@@ -515,81 +590,6 @@ class ChatModelIntegrationTests(ChatModelTests):
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.
-
- Defaults to `False`.
-
- ```python
- ToolMessage(
- content=[
- {
- "type": "image_url",
- "image_url": {"url": f"data:image/jpeg;base64,{image_data}"},
- },
- ],
- tool_call_id="1",
- name="random_image",
- )
- ```
-
- ...as well as the LangChain `ImageContentBlock` format:
-
- ```python
- ToolMessage(
- content=[
- {
- "type": "image",
- "base64": image_data,
- "mime_type": "image/jpeg",
- },
- ],
- tool_call_id="1",
- name="random_image",
- )
- ```
-
- If set to `True`, the chat model will be tested with message sequences that
- include `ToolMessage` objects of this form.
-
- ```python
- @property
- def supports_image_tool_message(self) -> bool:
- return True
- ```
-
- ??? info "`supports_pdf_tool_message`"
-
- Boolean property indicating whether the chat model supports a `ToolMessage`
- that includes PDF content using the LangChain `FileContentBlock` format.
-
- Defaults to `False`.
-
- ```python
- ToolMessage(
- content=[
- {
- "type": "file",
- "base64": pdf_data,
- "mime_type": "application/pdf",
- },
- ],
- tool_call_id="1",
- name="random_pdf",
- )
- ```
-
- If set to `True`, the chat model will be tested with message sequences that
- include `ToolMessage` objects of this form.
-
- ```python
- @property
- def supports_pdf_tool_message(self) -> bool:
- return True
- ```
-
??? info "`supported_usage_metadata_details`"
Property controlling what usage metadata details are emitted in both invoke
diff --git a/libs/standard-tests/langchain_tests/unit_tests/chat_models.py b/libs/standard-tests/langchain_tests/unit_tests/chat_models.py
index f6e93474d7..cc29622c04 100644
--- a/libs/standard-tests/langchain_tests/unit_tests/chat_models.py
+++ b/libs/standard-tests/langchain_tests/unit_tests/chat_models.py
@@ -480,6 +480,54 @@ class ChatModelUnitTests(ChatModelTests):
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.
+
+ Defaults to `False`.
+
+ ```python
+ ToolMessage(
+ content=[
+ {
+ "type": "image_url",
+ "image_url": {"url": f"data:image/jpeg;base64,{image_data}"},
+ },
+ ],
+ tool_call_id="1",
+ name="random_image",
+ )
+ ```
+
+ (OpenAI Chat Completions format), as well as LangChain's `ImageContentBlock`
+ format:
+
+ ```python
+ ToolMessage(
+ content=[
+ {
+ "type": "image",
+ "base64": image_data,
+ "mime_type": "image/jpeg",
+ },
+ ],
+ tool_call_id="1",
+ name="random_image",
+ )
+ ```
+
+ (standard format).
+
+ If set to `True`, the chat model will be tested with message sequences that
+ include `ToolMessage` objects of this form.
+
+ ```python
+ @property
+ def supports_image_tool_message(self) -> bool:
+ return True
+ ```
+
??? info "`supports_pdf_inputs`"
Boolean property indicating whether the chat model supports PDF inputs.
@@ -505,6 +553,38 @@ class ChatModelUnitTests(ChatModelTests):
return True
```
+ ??? info "`supports_pdf_tool_message`"
+
+ Boolean property indicating whether the chat model supports a `ToolMessage`
+ that includes PDF content using the LangChain `FileContentBlock` format.
+
+ Defaults to `False`.
+
+ ```python
+ ToolMessage(
+ content=[
+ {
+ "type": "file",
+ "base64": pdf_data,
+ "mime_type": "application/pdf",
+ },
+ ],
+ tool_call_id="1",
+ name="random_pdf",
+ )
+ ```
+
+ using LangChain's `FileContentBlock` format.
+
+ If set to `True`, the chat model will be tested with message sequences that
+ include `ToolMessage` objects of this form.
+
+ ```python
+ @property
+ def supports_pdf_tool_message(self) -> bool:
+ return True
+ ```
+
??? info "`supports_audio_inputs`"
Boolean property indicating whether the chat model supports audio inputs.
@@ -598,82 +678,6 @@ class ChatModelUnitTests(ChatModelTests):
return False
```
- ??? info "`supports_image_tool_message`"
-
- Boolean property indicating whether the chat model supports `ToolMessage`
- objects that include image content, e.g.,
-
- ```python
- ToolMessage(
- content=[
- {
- "type": "image_url",
- "image_url": {"url": f"data:image/jpeg;base64,{image_data}"},
- },
- ],
- tool_call_id="1",
- name="random_image",
- )
- ```
-
- (OpenAI Chat Completions format), as well as LangChain's `ImageContentBlock`
- format:
-
- ```python
- ToolMessage(
- content=[
- {
- "type": "image",
- "base64": image_data,
- "mime_type": "image/jpeg",
- },
- ],
- tool_call_id="1",
- name="random_image",
- )
- ```
-
- (standard format).
-
- If set to `True`, the chat model will be tested with message sequences that
- include `ToolMessage` objects of this form.
-
- ```python
- @property
- def supports_image_tool_message(self) -> bool:
- return False
- ```
-
- ??? info "`supports_pdf_tool_message`"
-
- Boolean property indicating whether the chat model supports `ToolMessage`
- objects that include PDF content, i.e.,
-
- ```python
- ToolMessage(
- content=[
- {
- "type": "file",
- "base64": pdf_data,
- "mime_type": "application/pdf",
- },
- ],
- tool_call_id="1",
- name="random_pdf",
- )
- ```
-
- using LangChain's `FileContentBlock` format.
-
- If set to `True`, the chat model will be tested with message sequences that
- include `ToolMessage` objects of this form.
-
- ```python
- @property
- def supports_pdf_tool_message(self) -> bool:
- return False
- ```
-
??? info "`supported_usage_metadata_details`"
Property controlling what usage metadata details are emitted in both `invoke`