standard-tests: add condition for image tool message test (#31041)

Require support for [standard
format](https://python.langchain.com/docs/how_to/multimodal_inputs/).
This commit is contained in:
ccurme
2025-04-27 13:24:43 -04:00
committed by GitHub
parent 04a899ebe3
commit ba2518995d
2 changed files with 106 additions and 23 deletions

View File

@@ -568,6 +568,25 @@ class ChatModelUnitTests(ChatModelTests):
name="random_image",
)
(OpenAI Chat Completions format), as well as
.. code-block:: python
ToolMessage(
content=[
{
"type": "image",
"source_type": "base64",
"data": 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 ToolMessages of this form.