File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
vertexai/preview/reasoning_engines/templates Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -260,23 +260,18 @@ def __init__(
260260 llm = ChatVertexAI(model_name=model, **model_kwargs)
261261
262262 # runnable_builder
263- from langchain import agents
264- from langchain_core.runnables.history import RunnableWithMessageHistory
263+ from langgraph.prebuilt import create_react_agent
265264 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,
268267 tools=tools,
269- **agent_executor_kwargs,
270- )
271- runnable = RunnableWithMessageHistory(
272- runnable=agent_executor,
273- get_session_history=chat_history,
274268 **runnable_kwargs,
275269 )
276270 ```
277271
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.
280275
281276 **Example using Spanner:**
282277 ```python
You can’t perform that action at this time.
0 commit comments