Skip to content
Tracon

NonTokenUsageRecord

Namespace Tracon · Assembly Tracon.Abstractions.dll

One non-token item a workflow function node reported: the persistent record behind GET /api/runs/{runId}/usage.

public sealed record NonTokenUsageRecord : IEquatable<NonTokenUsageRecord>
Inheritance
object ← NonTokenUsageRecord
Implements
IEquatable<NonTokenUsageRecord>
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

A node reports with IWorkflowContext.ReportUsageAsync and every report is an item. A retried node keeps the items of its failed attempts: the work was done and the provider billed it.

public NonTokenUsageRecord()

Gets the moment the item was reported (UTC).

public required DateTimeOffset CreatedAt { get; init; }

DateTimeOffset

Gets the record id. A time-ordered UUID (v7).

public required Guid Id { get; init; }

Guid

Gets the name of the function node that reported the item, or null when the reporting code did not run inside a function node Tracon registered (a custom executor in a graph built in code, for example).

public string? NodeName { get; init; }

string?

Gets the run the item belongs to.

public required Guid RunId { get; init; }

Guid

Gets the EXPECTED tenant of the run. Defense in depth; when null no tenant check is made.

[JsonIgnore]
public string? TenantId { get; init; }

string?

Write-side only, like ToolInvocationRecord.TenantId: it is the WHERE guard of the insert, never a column, and is left out of the HTTP contract.

Gets the measurement and its amount.

public required ToolCallUsage Usage { get; init; }

ToolCallUsage

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(NonTokenUsageRecord? other)

other NonTokenUsageRecord?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(NonTokenUsageRecord?, NonTokenUsageRecord?)

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

left NonTokenUsageRecord?

right NonTokenUsageRecord?

bool

operator !=(NonTokenUsageRecord?, NonTokenUsageRecord?)

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

left NonTokenUsageRecord?

right NonTokenUsageRecord?

bool