standard-tests, openai[patch]: add support standard audio inputs (#30904)

This commit is contained in:
ccurme
2025-04-17 10:30:57 -04:00
committed by GitHub
parent 2c2db1ab69
commit add6a78f98
4 changed files with 157 additions and 1 deletions

View File

@@ -171,9 +171,15 @@ class ChatModelTests(BaseStandardTests):
"""(bool) whether the chat model supports PDF inputs, defaults to ``False``."""
return False
@property
def supports_audio_inputs(self) -> bool:
"""(bool) whether the chat model supports audio inputs, defaults to
``False``."""
return False
@property
def supports_video_inputs(self) -> bool:
"""(bool) whether the chat model supports video inputs, efaults to ``False``.
"""(bool) whether the chat model supports video inputs, defaults to ``False``.
No current tests are written for this feature."""
return False
@@ -463,6 +469,33 @@ class ChatModelUnitTests(ChatModelTests):
def supports_pdf_inputs(self) -> bool:
return True
.. dropdown:: supports_audio_inputs
Boolean property indicating whether the chat model supports audio inputs.
Defaults to ``False``.
If set to ``True``, the chat model will be tested using content blocks of the
form
.. code-block:: python
{
"type": "audio",
"source_type": "base64",
"data": "<base64 audio data>",
"mime_type": "audio/wav", # or appropriate mime-type
}
See https://python.langchain.com/docs/concepts/multimodality/
Example:
.. code-block:: python
@property
def supports_audio_inputs(self) -> bool:
return True
.. dropdown:: supports_video_inputs
Boolean property indicating whether the chat model supports image inputs.