-
Notifications
You must be signed in to change notification settings - Fork 2
feat: agent_graph SDK method #85
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
| # AI Config Agent Graph | ||
| # ============================================================================ | ||
| @dataclass | ||
| class AIAgentGraphConfig: |
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.
For all other configs, the enabled value is part of the config and not wrapped. It's worth a debate if the reason to separate this into the Response is so you don't have to make all the fields optional incase it is disabled. If we make that change we should consider it for all other configs and potentially make the AIAgentGraphResponse a generic.
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 can add in a synthetic enabled directly onto the config object if we'd prefer to keep it the same as the others
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'm actually updating to this - it makes things much cleaner type-wise. I added an enabled member to the config object and the agent_graph object inherits from that. This will also give us an avenue to handle provider-specific errors (ie you're using langgraph but we can't find your creds) and disable the graph if necessary
|
Updated to include Would now be used as: agent_graph = ai_client.agent_graph("test-agent-graph", context)
if agent_graph.enabled:
await run_open_ai_agents(agent_graph)
else:
print("Agent graph is not enabled") |
Requirements
Describe the solution you've provided
This pull requests implements the following functionality:
AgentGraphDefinitionclass which allows traversal of a graph throughtraverseandreverse_traversemethods:Describe alternatives you've considered
This is the implementation of a new feature within LaunchDarkly. There weren't alternatives considered as this is the initial implementation and offering regarding this feature.
Additional context
This PR will be followed up with other PRs introducing:
Note
Adds a retrievable AI agent graph with traversal utilities.
AgentGraphDefinitionwithtraverseandreverse_traverse, node/edge accessors, and terminal/root helpersEdge,AIAgentGraphConfig;AgentGraphNodeinternal representationLDAIClient.agent_graph(key, context)fetches graph variations, validates enabled agents, builds nodes, and returns an enabled/disabled graph definitionldai/__init__.pyhandoffpropagationWritten by Cursor Bugbot for commit 3041fad. This will update automatically on new commits. Configure here.