partners[minor]: Fix value error message for with_structured_output (#22877)

Currently, calling `with_structured_output()` with an invalid method
argument raises `Unrecognized method argument. Expected one of
'function_calling' or 'json_format'`, but the JSON mode option [is now
referred
to](https://python.langchain.com/v0.2/docs/how_to/structured_output/#the-with_structured_output-method)
by `'json_mode'`. This fixes that.

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
This commit is contained in:
Julian Weng 2024-06-20 11:03:21 -04:00 committed by GitHub
parent dd4d4411c9
commit 6a1a0d977a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -904,7 +904,7 @@ class ChatFireworks(BaseChatModel):
else: else:
raise ValueError( raise ValueError(
f"Unrecognized method argument. Expected one of 'function_calling' or " f"Unrecognized method argument. Expected one of 'function_calling' or "
f"'json_format'. Received: '{method}'" f"'json_mode'. Received: '{method}'"
) )
if include_raw: if include_raw:

View File

@ -1034,7 +1034,7 @@ class ChatGroq(BaseChatModel):
else: else:
raise ValueError( raise ValueError(
f"Unrecognized method argument. Expected one of 'function_calling' or " f"Unrecognized method argument. Expected one of 'function_calling' or "
f"'json_format'. Received: '{method}'" f"'json_mode'. Received: '{method}'"
) )
if include_raw: if include_raw:

View File

@ -1139,7 +1139,7 @@ class BaseChatOpenAI(BaseChatModel):
else: else:
raise ValueError( raise ValueError(
f"Unrecognized method argument. Expected one of 'function_calling' or " f"Unrecognized method argument. Expected one of 'function_calling' or "
f"'json_format'. Received: '{method}'" f"'json_mode'. Received: '{method}'"
) )
if include_raw: if include_raw: