File tree 1 file changed +6
-11
lines changed
vertexai/preview/reasoning_engines/templates
1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -260,23 +260,18 @@ def __init__(
260
260
llm = ChatVertexAI(model_name=model, **model_kwargs)
261
261
262
262
# runnable_builder
263
- from langchain import agents
264
- from langchain_core.runnables.history import RunnableWithMessageHistory
263
+ from langgraph.prebuilt import create_react_agent
265
264
llm_with_tools = llm.bind_tools(tools=tools, **model_tool_kwargs)
266
- agent_executor = agents.AgentExecutor (
267
- agent=prompt | llm_with_tools | output_parser ,
265
+ runnable = create_react_agent (
266
+ llm_with_tools,
268
267
tools=tools,
269
- **agent_executor_kwargs,
270
- )
271
- runnable = RunnableWithMessageHistory(
272
- runnable=agent_executor,
273
- get_session_history=chat_history,
274
268
**runnable_kwargs,
275
269
)
276
270
```
277
271
278
- By default, no checkpointer is used. To enable checkpointing, provide a
279
- `checkpointer_builder` function that returns a checkpointer instance.
272
+ By default, no checkpointer is used (i.e. there is no state history). To
273
+ enable checkpointing, provide a `checkpointer_builder` function that
274
+ returns a checkpointer instance.
280
275
281
276
**Example using Spanner:**
282
277
```python
You can’t perform that action at this time.
0 commit comments