mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-02 14:28:46 +02:00
fix(prebuilt): raise on additional deprecated kwargs (#5848)
This commit is contained in:
@@ -473,6 +473,11 @@ def create_react_agent(
|
||||
if context_schema is None:
|
||||
context_schema = config_schema
|
||||
|
||||
if len(deprecated_kwargs) > 0:
|
||||
raise TypeError(
|
||||
f"create_react_agent() got unexpected keyword arguments: {deprecated_kwargs}"
|
||||
)
|
||||
|
||||
if version not in ("v1", "v2"):
|
||||
raise ValueError(
|
||||
f"Invalid version {version}. Supported versions are 'v1' and 'v2'."
|
||||
|
||||
@@ -31,3 +31,11 @@ def test_config_schema_deprecation() -> None:
|
||||
match="`get_config_jsonschema` is deprecated. Use `get_context_jsonschema` instead.",
|
||||
):
|
||||
assert agent.get_config_jsonschema() is not None
|
||||
|
||||
|
||||
def test_extra_kwargs_deprecation() -> None:
|
||||
with pytest.raises(
|
||||
TypeError,
|
||||
match="create_react_agent\(\) got unexpected keyword arguments: \{'extra': 'extra'\}",
|
||||
):
|
||||
create_react_agent(FakeToolCallingModel(), [], extra="extra")
|
||||
|
||||
Reference in New Issue
Block a user