AgentCallGraph
AgentPrism.Core.dllValidates an agent call graph at save time.
public static class AgentCallGraphInheritance
Section titled “Inheritance”Inherited Members
Section titled “Inherited Members”object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Validation is done with a depth-first search and separates three errors:
unknown name, self-call, indirect cycle. All three break the save
operation (400 Bad Request); if left to run time, the user only
sees the error when they run the agent, in a message that is hard to
diagnose.
Static validation alone is not enough. An agent registered via a code-side factory does not carry a declarative definition and appears as a leaf in the graph; in reality it may still be calling other agents. The second line of defense is the run-time depth counter (AgentRunBudget.MaxDepth).
Methods
Section titled “Methods”Validate(string, IReadOnlyList<string>, IReadOnlyList<AgentDescriptor>)
Section titled “ Validate(string, IReadOnlyList<string>, IReadOnlyList<AgentDescriptor>)”Validates a definition’s call graph.
public static string? Validate(string agentName, IReadOnlyList<string> callableAgentNames, IReadOnlyList<AgentDescriptor> descriptors)Parameters
Section titled “Parameters”agentName string
Name of the agent being validated.
callableAgentNames IReadOnlyList<string>
Names of the agents this agent wants to call.
descriptors IReadOnlyList<AgentDescriptor>
All agent summaries in the catalog.
Returns
Section titled “Returns”A user-displayable description when there is a problem; null when the graph is valid.
Exceptions
Section titled “Exceptions”One of the parameters is null.
ValidateDetailed(string, IReadOnlyList<string>, IReadOnlyList<AgentDescriptor>)
Section titled “ ValidateDetailed(string, IReadOnlyList<string>, IReadOnlyList<AgentDescriptor>)”Validates a definition’s call graph and returns a result carrying a machine-readable code.
public static AgentCallGraphProblem? ValidateDetailed(string agentName, IReadOnlyList<string> callableAgentNames, IReadOnlyList<AgentDescriptor> descriptors)Parameters
Section titled “Parameters”agentName string
Name of the agent being validated.
callableAgentNames IReadOnlyList<string>
Names of the agents this agent wants to call.
descriptors IReadOnlyList<AgentDescriptor>
All agent summaries in the catalog.
Returns
Section titled “Returns”The code and description when there is a problem; null when the graph is valid.
Remarks
Section titled “Remarks”Performs the same validation as AgentCallGraph.Validate;
The validation endpoint takes its code (unknown_agent/cycle)
from here, while the save-time 400 response only uses
AgentCallGraphProblem.Message.
Exceptions
Section titled “Exceptions”One of the parameters is null.