ExperimentAssignmentResolver
AgentPrism.Core.dllDeterministically assigns a run request to a bucket, when a running experiment exists for an agent.
public sealed class ExperimentAssignmentResolverInheritance
Section titled “Inheritance”object ← ExperimentAssignmentResolver
Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”The assignment is deterministic: the same key always produces the same bucket. A random assignment would change the instructions mid-conversation.
Constructors
Section titled “Constructors”ExperimentAssignmentResolver(IExperimentStore)
Section titled “ ExperimentAssignmentResolver(IExperimentStore)”Creates a new assignment resolver.
public ExperimentAssignmentResolver(IExperimentStore store)Parameters
Section titled “Parameters”store IExperimentStore
Experiment store.
Exceptions
Section titled “Exceptions”store is null.
Methods
Section titled “Methods”ResolveAsync(string, string, string, CancellationToken)
Section titled “ ResolveAsync(string, string, string, CancellationToken)”Produces an assignment for the given key, when a running experiment exists for this agent.
public ValueTask<ExperimentAssignment?> ResolveAsync(string tenantId, string agentName, string assignmentKey, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
Tenant identifier.
agentName string
Agent name.
assignmentKey string
Assignment key (session id or run id).
cancellationToken CancellationToken
Cancellation token.
Returns
Section titled “Returns”ValueTask<ExperimentAssignment?>
The assignment; null when there is no running experiment.