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>
pull/22698/merge
Julian Weng 2 months ago committed by GitHub
parent dd4d4411c9
commit 6a1a0d977a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

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

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

Loading…
Cancel
Save