mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
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:
parent
dd4d4411c9
commit
6a1a0d977a
@ -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:
|
||||||
|
@ -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:
|
||||||
|
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user