You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromlangchain_core.agentsimportAgentFinishfromlanggraph.prebuiltimportToolNodetool_executor=ToolNode(tools)
defrun_agent(data):
agent_outcome=agent_runnable.invoke(data)
return {"agent_outcome": agent_outcome}
defexecute_tools(data):
agent_action=data["agent_outcome"]
output=tool_executor.invoke(agent_action)
return {"intermediate_steps": [(agent_action, str(output))]}
# Define logic that will be used to determine which conditional edge to go downdefshould_continue(data):
ifisinstance(data["agent_outcome"], AgentFinish):
return"end"else:
return"continue"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I was following langgraph example. I use
Cohere
model and bindTavilySearchResults
but I can not execute it.1. Create Agent Executor
2. Define the state
3. Nodes
4. Workflow
5. Execution
The following error is thrown:
The first stream is printed and it come
AIMessage
instead ofAgentActionMessageLog
Beta Was this translation helpful? Give feedback.
All reactions