langgraph-prebuilt 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/PKG-INFO +1 -1
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/langgraph/prebuilt/chat_agent_executor.py +10 -5
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/pyproject.toml +1 -1
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/uv.lock +1 -1
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/.gitignore +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/LICENSE +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/Makefile +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/README.md +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/langgraph/prebuilt/__init__.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/langgraph/prebuilt/interrupt.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/langgraph/prebuilt/py.typed +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/langgraph/prebuilt/tool_node.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/langgraph/prebuilt/tool_validator.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/__init__.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/__snapshots__/test_react_agent_graph.ambr +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/any_str.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/compose-postgres.yml +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/conftest.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/conftest_checkpointer.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/conftest_store.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/memory_assert.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/messages.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/model.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/test_react_agent.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/test_react_agent_graph.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/test_tool_node.py +0 -0
- {langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/tests/test_validation_node.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langgraph-prebuilt
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Library with high-level APIs for creating and executing LangGraph agents and tools.
|
|
5
5
|
Project-URL: Repository, https://www.github.com/langchain-ai/langgraph
|
|
6
6
|
License-Expression: MIT
|
{langgraph_prebuilt-0.2.0 → langgraph_prebuilt-0.2.1}/langgraph/prebuilt/chat_agent_executor.py
RENAMED
|
@@ -240,7 +240,7 @@ def _validate_chat_history(
|
|
|
240
240
|
|
|
241
241
|
def create_react_agent(
|
|
242
242
|
model: Union[str, LanguageModelLike],
|
|
243
|
-
tools: Union[Sequence[Union[BaseTool, Callable]], ToolNode],
|
|
243
|
+
tools: Union[Sequence[Union[BaseTool, Callable, dict[str, Any]]], ToolNode],
|
|
244
244
|
*,
|
|
245
245
|
prompt: Optional[Prompt] = None,
|
|
246
246
|
response_format: Optional[
|
|
@@ -420,12 +420,13 @@ def create_react_agent(
|
|
|
420
420
|
else AgentState
|
|
421
421
|
)
|
|
422
422
|
|
|
423
|
+
llm_builtin_tools: list[dict] = []
|
|
423
424
|
if isinstance(tools, ToolNode):
|
|
424
425
|
tool_classes = list(tools.tools_by_name.values())
|
|
425
426
|
tool_node = tools
|
|
426
427
|
else:
|
|
427
|
-
|
|
428
|
-
|
|
428
|
+
llm_builtin_tools = [t for t in tools if isinstance(t, dict)]
|
|
429
|
+
tool_node = ToolNode([t for t in tools if not isinstance(t, dict)])
|
|
429
430
|
tool_classes = list(tool_node.tools_by_name.values())
|
|
430
431
|
|
|
431
432
|
if isinstance(model, str):
|
|
@@ -442,8 +443,12 @@ def create_react_agent(
|
|
|
442
443
|
|
|
443
444
|
tool_calling_enabled = len(tool_classes) > 0
|
|
444
445
|
|
|
445
|
-
if
|
|
446
|
-
model
|
|
446
|
+
if (
|
|
447
|
+
_should_bind_tools(model, tool_classes)
|
|
448
|
+
and len(tool_classes) > 0
|
|
449
|
+
or (len(llm_builtin_tools) > 0)
|
|
450
|
+
):
|
|
451
|
+
model = cast(BaseChatModel, model).bind_tools(tool_classes + llm_builtin_tools) # type: ignore[operator]
|
|
447
452
|
|
|
448
453
|
model_runnable = _get_prompt_runnable(prompt) | model
|
|
449
454
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|