-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(max): convert the insights graph to a Max tool #39893
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): convert the insights graph to a Max tool #39893
Conversation
027ed1a to
0f3499f
Compare
|
Greptile encountered an error while reviewing this PR. Please reach out to [email protected] for assistance. |
|
|
||
| def add_node(self, node: MaxNodeName, action: Any): | ||
| self._graph.add_node(node, action) | ||
| if isinstance(action, HasReasoningMessage): |
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.
I remembered that isinstance on Protocol(s) with runtime_checkable was pretty slow but maybe this changed with recent python releases, cannot find anything recent, just wanted to flag if we could've have done this on some magic variables instead
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.
I didn't know about that. ChatGPT confirms it, but it's still nanoseconds, so it's okay for a single check. I don't see a reason not to use it.
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.
I don't have a great memory so maybe ChatGPT is better lol, but I think it was related to accessing @property so maybe it's okay
kappa90
left a comment
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.
:yolo:
|
|
||
| from ee.hogai.graph.base import BaseAssistantNode | ||
| from ee.hogai.graph.graph import AssistantCompiledStateGraph | ||
| from ee.hogai.graph.base import AssistantCompiledStateGraph, BaseAssistantNode |
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.
FYI, AssistantCompiledStateGraph is gone on my loop-executor-ui-full branch, so there will be conflicts (I can fix them once we get there)
| ] | ||
|
|
||
| # The contextual insights tool overrides the static tool. Only inject if it's injected. | ||
| if not CreateAndQueryInsightTool.is_editing_mode(self.context_manager): |
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.
FYI on my branch I've created two distinct tools, one to create and one to edit, so that we can have distinct definitions, but we should probably discuss this better, I don't have a strong opinion.
6403cd2
into
feat/parallelize-tool-calls
Problem
Since we want to parallelize tool calls, we would like to split the monolithic graph into subgraphs or MaxTools, allowing the tools to be easily parallelized. This PR focuses on the insights subgraph.
Changes
How did you test this code?
Unit tests & manual testing