-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support Recursive Nodes in OpenAI Agents Draw Graph Visualization Extension #387
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
base: main
Are you sure you want to change the base?
Conversation
i realized the extension is not able to graph when an agent is recursive or has some path back to it. - intergrated way of keeping track of visited nodes(handoffs) - graph the new nodes with the return arrows
Awesome. |
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.
Generally looks good, can you please add some tests for this?
if visited is None: | ||
visited = set() | ||
|
||
if agent.name in visited: |
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.
multiple agents can share the same name, perhaps we can use the object instead?
if not parent: | ||
parts.append( | ||
f'"{agent.name}" [label="{agent.name}", shape=box, style=filled, ' | ||
"fillcolor=lightyellow, width=1.5, height=0.8];" | ||
'"__start__" [label="__start__", shape=ellipse, style=filled, ' |
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 know this isn't directly related to the PR, but it would be cool if we could first build a graph representation, and then second turn that into a visualization. That way, you could have different graph formats (graphviz, mermaid etc), and share code between them,
This PR is stale because it has been open for 10 days with no activity. |
This PR enhances the OpenAI Agents Graph extension by adding support for recursive nodes and cycles. Currently, the extension does not properly graph an agent when it is recursive or has a path that loops back to itself.
Changes Introduced:
This change improves the visualization of agents with cyclic or recursive behaviors, making the graph more accurate and comprehensive.