Skip to content

ToolArgumentCondition

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

One comparison against a tool call argument: path · operator · value.

public sealed record ToolArgumentCondition : IEquatable<ToolArgumentCondition>

objectToolArgumentCondition

IEquatable<ToolArgumentCondition>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

A comparison only, never an expression. There is no OR — a rule’s conditions are combined with AND; two rules are written instead of one with an OR. There is no array index in ToolArgumentCondition.Path. This is a deliberate limit (’s sibling): the language must never grow into a rule engine.

public ToolArgumentCondition()

Gets the comparison operator.

public required ToolArgumentOperator Operator { get; init; }

ToolArgumentOperator

Gets the dotted path into the argument object, for example order.amount. No array index is accepted.

public required string Path { get; init; }

string

Gets the value compared against. For ToolArgumentOperator.In and ToolArgumentOperator.NotIn this is a JSON array of text or numbers; for every other operator it is a single text, number, or boolean.

public required JsonElement Value { get; init; }

JsonElement

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(ToolArgumentCondition? other)

other ToolArgumentCondition?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(ToolArgumentCondition?, ToolArgumentCondition?)

Section titled “ operator ==(ToolArgumentCondition?, ToolArgumentCondition?)”
public static bool operator ==(ToolArgumentCondition? left, ToolArgumentCondition? right)

left ToolArgumentCondition?

right ToolArgumentCondition?

bool

operator !=(ToolArgumentCondition?, ToolArgumentCondition?)

Section titled “ operator !=(ToolArgumentCondition?, ToolArgumentCondition?)”
public static bool operator !=(ToolArgumentCondition? left, ToolArgumentCondition? right)

left ToolArgumentCondition?

right ToolArgumentCondition?

bool