LaunchDarkly Dotnet Server AI SDK
Search Results for

    Show / Hide Table of Contents

    Class AgentGraphDefinition

    Represents a fully-resolved agent graph returned by AgentGraph(string, Context, IReadOnlyDictionary<string, object>). When Enabled is false, all node collections are empty and traversal is a no-op; only GetConfig() and CreateTracker() remain meaningful.

    Inheritance
    object
    AgentGraphDefinition
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: LaunchDarkly.Sdk.Server.Ai.Graph
    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
    Type Description
    bool

    Methods

    | Edit this page View Source

    CreateTracker()

    Creates a new graph-level tracker for this invocation.

    Declaration
    public AiGraphTracker CreateTracker()
    Returns
    Type Description
    AiGraphTracker
    | 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
    Type Description
    IReadOnlyList<AgentGraphNode>
    | 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
    Type Description
    AgentGraphFlagValue
    | 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
    Type Description
    AgentGraphNode
    | 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
    Type Description
    IReadOnlyList<AgentGraphNode>
    | 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
    Type Name Description
    Func<AgentGraphNode, Dictionary<string, object>, object> fn
    Dictionary<string, object> initialContext
    | 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
    Type Description
    AgentGraphNode
    | Edit this page View Source

    TerminalNodes()

    Returns all nodes with no outgoing edges (leaf nodes).

    Declaration
    public IReadOnlyList<AgentGraphNode> TerminalNodes()
    Returns
    Type Description
    IReadOnlyList<AgentGraphNode>
    | 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
    Type Name Description
    Func<AgentGraphNode, Dictionary<string, object>, object> fn
    Dictionary<string, object> initialContext

    Extension Methods

    PluginExtensions.GetPluginHooks<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    PluginExtensions.GetPluginHooks<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    PluginExtensions.GetPluginHooks<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    PluginExtensions.GetPluginHooks<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    PluginExtensions.GetPluginHooks<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    PluginExtensions.GetPluginHooks<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    PluginExtensions.GetPluginHooks<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    PluginExtensions.RegisterPlugins<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    PluginExtensions.RegisterPlugins<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    PluginExtensions.RegisterPlugins<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    PluginExtensions.RegisterPlugins<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    PluginExtensions.RegisterPlugins<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    PluginExtensions.RegisterPlugins<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    PluginExtensions.RegisterPlugins<TClient, THook>(TClient, IEnumerable<PluginBase<TClient, THook>>, EnvironmentMetadata, Logger)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX