-
Notifications
You must be signed in to change notification settings - Fork 3.2k
wip: modify model request as its own node #6071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
||
from langgraph.agent import create_agent | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Experiencing some import issues, temporary workaround
@@ -113,7 +168,7 @@ def create_agent( | |||
[first_node, END], | |||
) | |||
graph.add_conditional_edges( | |||
last_node, _make_model_to_tools_edge(first_node), ["tools", END] | |||
last_node, _make_model_to_tools_edge(first_node), [first_node, "tools", END] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
post_model
should be able to route to model
else: | ||
model_ = request.model.bind_tools(request.tools, tool_choice=request.tool_choice) | ||
output = model_.invoke(messages) | ||
if state.response is not None: | ||
return {"messages": output, "response": None} | ||
else: | ||
return {"messages": output} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to rebind each time here, also side note, need to add more complex structured output logic from the other agent
Closing for now, have ported this over to LC via langchain-ai/langchain#32828 |
Working on swarm impl w/ this change to verify architectural value