RunCompletion
AgentPrism.Abstractions.dllEverything needed to close a run.
public sealed record RunCompletion : IEquatable<RunCompletion>Inheritance
Section titled “Inheritance”Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Section titled “Constructors”RunCompletion()
Section titled “ RunCompletion()”public RunCompletion()Properties
Section titled “Properties”CompletedAt
Section titled “ CompletedAt”Gets the completion time (UTC).
public required DateTimeOffset CompletedAt { get; init; }Property Value
Section titled “Property Value”Gets the computed cost. null when the model is unknown (a code agent, for example); when the model is known the value is populated even if the price is not (see RunCost).
public RunCost? Cost { get; init; }Property Value
Section titled “Property Value”Gets the error information. Only populated for RunStatus.Failed.
public RunError? Error { get; init; }Property Value
Section titled “Property Value”EventCount
Section titled “ EventCount”Gets the total number of events written.
public long EventCount { get; init; }Property Value
Section titled “Property Value”ModelId
Section titled “ ModelId”Gets the model that actually answered, overriding runs.model_id
when it differs from the value written at RunStarted.
null leaves the stored value unchanged.
public string? ModelId { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”The row is written once, at run start, from the agent’s primary
ModelBinding — before it is known whether a
ModelBinding.Fallbacks link will answer instead. This
field lets completion correct the record so
IRunStore.GetStatisticsAsync’s ByModel breakdown groups by
the model that really ran. null is the
overwhelmingly common case (no fallback happened) and is a deliberate
no-op, not an omission.
Gets the run id.
public required Guid RunId { get; init; }Property Value
Section titled “Property Value”Status
Section titled “ Status”Gets the final status.
public required RunStatus Status { get; init; }Property Value
Section titled “Property Value”TenantId
Section titled “ TenantId”Gets the EXPECTED tenant of the run being closed. Defence in depth; when null no tenant check is made.
[JsonIgnore]public string? TenantId { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”For the reason, and why the ambient tenant is not used, see RunEvent.TenantId.
The field is WRITE-side only and is removed from the transport contract with
Serialization.JsonIgnoreAttribute.
Gets the token usage.
public RunUsage? Usage { get; init; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(RunCompletion?)
Section titled “ Equals(RunCompletion?)”public bool Equals(RunCompletion? other)Parameters
Section titled “Parameters”other RunCompletion?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(RunCompletion?, RunCompletion?)
Section titled “ operator ==(RunCompletion?, RunCompletion?)”public static bool operator ==(RunCompletion? left, RunCompletion? right)Parameters
Section titled “Parameters”left RunCompletion?
right RunCompletion?
Returns
Section titled “Returns”operator !=(RunCompletion?, RunCompletion?)
Section titled “ operator !=(RunCompletion?, RunCompletion?)”public static bool operator !=(RunCompletion? left, RunCompletion? right)Parameters
Section titled “Parameters”left RunCompletion?
right RunCompletion?