Class AgentGraphDefinition
Inheritance
AgentGraphDefinition
Assembly: LaunchDarkly.ServerSdk.Ai.dll
Syntax
public sealed class AgentGraphDefinition
Properties
|
Edit this page
View Source
Enabled
Whether the graph passed all validation checks. False if the flag's
_ldMeta.enabled is false, the root is missing, any node is
unreachable from the root, or any child agent config could not be fetched.
Declaration
public bool Enabled { get; }
Property Value
Methods
|
Edit this page
View Source
CreateTracker()
Creates a new graph-level tracker for this invocation.
Declaration
public AiGraphTracker CreateTracker()
Returns
|
Edit this page
View Source
GetChildNodes(string)
Returns the direct children of the given node by following its outgoing edges.
Returns an empty list if the node is not found.
Declaration
public IReadOnlyList<AgentGraphNode> GetChildNodes(string nodeKey)
Parameters
| Type |
Name |
Description |
| string |
nodeKey |
|
Returns
|
Edit this page
View Source
GetConfig()
Returns the raw flag value including LaunchDarkly metadata. Always non-null,
even when Enabled is false.
Declaration
public AgentGraphFlagValue GetConfig()
Returns
|
Edit this page
View Source
GetNode(string)
Returns the node with the given key, or null if not found.
Declaration
public AgentGraphNode GetNode(string nodeKey)
Parameters
| Type |
Name |
Description |
| string |
nodeKey |
|
Returns
|
Edit this page
View Source
GetParentNodes(string)
Returns all nodes that have an outgoing edge pointing to the given node key.
Declaration
public IReadOnlyList<AgentGraphNode> GetParentNodes(string nodeKey)
Parameters
| Type |
Name |
Description |
| string |
nodeKey |
|
Returns
|
Edit this page
View Source
ReverseTraverse(Func<AgentGraphNode, Dictionary<string, object>, object>, Dictionary<string, object>)
Performs a reverse breadth-first traversal: starts from terminal nodes and
works upward toward the root. The root node is always processed last.
Cycle-safe: each node is visited at most once.
Declaration
public void ReverseTraverse(Func<AgentGraphNode, Dictionary<string, object>, object> fn, Dictionary<string, object> initialContext = null)
Parameters
|
Edit this page
View Source
RootNode()
Returns the root node of the graph, or null if the graph is disabled or has no root.
Declaration
public AgentGraphNode RootNode()
Returns
|
Edit this page
View Source
TerminalNodes()
Returns all nodes with no outgoing edges (leaf nodes).
Declaration
public IReadOnlyList<AgentGraphNode> TerminalNodes()
Returns
|
Edit this page
View Source
Traverse(Func<AgentGraphNode, Dictionary<string, object>, object>, Dictionary<string, object>)
Performs a breadth-first traversal of the graph starting from the root node.
For each visited node, fn is called with the node and the
accumulated context dictionary. The return value of fn is
stored in the context under the node's key and passed to subsequent calls.
Cycle-safe: each node is visited at most once.
Declaration
public void Traverse(Func<AgentGraphNode, Dictionary<string, object>, object> fn, Dictionary<string, object> initialContext = null)
Parameters
Extension Methods