-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(max): enable parallel tool calls #38811
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
feat(max): enable parallel tool calls #38811
Conversation
Size Change: 0 B Total Size: 3.05 MB ℹ️ View Unchanged
|
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.
11 files reviewed, 4 comments
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
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.
Error tracking pieces looks fine. Tried reviewing the rest but honestly it's probably worth someone with an understanding of Max's internals having a look
…-search' into feat/paralel-tool-calls
…-search' into feat/paralel-tool-calls
ee/hogai/graph/taxonomy/nodes.py
Outdated
# If we're still here, check if we've hit the iteration limit within this cycle | ||
if state.iteration_count >= self.MAX_ITERATIONS: | ||
return self._get_reset_state(ITERATION_LIMIT_PROMPT, "max_iterations", state) |
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.
Shouldn't it check for LLM turns, not for the number of tool calls? It doesn't make sense to limit by tool count.
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.
The state.iteration_count
increases by one only when the llm returns, I think I am making a mistake here by checking for its value in every tool_call processing, we should only check once. Let me know if that makes sense.
for action, _ in intermediate_steps: | ||
try: | ||
tool_input = self._toolkit.get_tool_input_model(action) | ||
except ValidationError as e: |
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.
One might be broken, but others might not be. We should process all generated tools.
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.
True, fixed that
tool_call_id=action.log, | ||
) | ||
tool_result_msg.append(tool_msg) | ||
tool_msgs.append(tool_msg) |
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.
Can we move tool_msgs closer to the loop? They're quite distant now.
|
||
messages: Sequence[AssistantMessageUnion] = Field(default=[]) | ||
|
||
iteration_count: int = Field(default=0) |
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.
There may be some quirks with LangGraph defaults. Are you sure that the Tools node doesn't reset the iteration count when it returns the partial state?
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.
True, the tool node resets the count, I had to pass the iteration_count when returning the partial state there
if tool_metadata["lookup_feature_flag"]: | ||
tool_input, tool_call_id = tool_metadata["lookup_feature_flag"][0] | ||
result = self._lookup_feature_flag(tool_input.arguments.flag_key) # type: ignore | ||
return {tool_call_id: result} |
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.
This line will only handle a single tool, but it might have multiple tools.
8a3b67b
to
144c1d4
Compare
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
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.
LGTM
…-search' into feat/paralel-tool-calls
c96563d
into
feat/allow-multiple-entity-event-search
Problem
Taxonomy search should be optimised to reduce the time spent exploring entities and properties when building HogQL