mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-22 11:00:37 +00:00
json mode standard test (#25497)
Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
@@ -132,6 +132,11 @@ class ChatModelTests(BaseStandardTests):
|
||||
is not BaseChatModel.with_structured_output
|
||||
)
|
||||
|
||||
@property
|
||||
def supports_json_mode(self) -> bool:
|
||||
"""(bool) whether the chat model supports JSON mode."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def supports_image_inputs(self) -> bool:
|
||||
"""(bool) whether the chat model supports image inputs, defaults to
|
||||
@@ -281,7 +286,7 @@ class ChatModelUnitTests(ChatModelTests):
|
||||
output.
|
||||
|
||||
By default, this is determined by whether the chat model's
|
||||
`with_structured_output` method is overridden. If the base implementation is
|
||||
``with_structured_output`` method is overridden. If the base implementation is
|
||||
intended to be used, this method should be overridden.
|
||||
|
||||
See: https://python.langchain.com/docs/concepts/structured_outputs/
|
||||
@@ -294,6 +299,21 @@ class ChatModelUnitTests(ChatModelTests):
|
||||
def has_structured_output(self) -> bool:
|
||||
return True
|
||||
|
||||
.. dropdown:: supports_json_mode
|
||||
|
||||
Boolean property indicating whether the chat model supports JSON mode in
|
||||
``with_structured_output``.
|
||||
|
||||
See: https://python.langchain.com/docs/concepts/structured_outputs/#json-mode
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@property
|
||||
def supports_json_mode(self) -> bool:
|
||||
return True
|
||||
|
||||
.. dropdown:: supports_image_inputs
|
||||
|
||||
Boolean property indicating whether the chat model supports image inputs.
|
||||
|
Reference in New Issue
Block a user