MentorAgent Docs
Menu

ReferencePackage: Novior.MentorAgent.Abstractions

MentorModelCall record

The MentorModelCall record of Novior.MentorAgent.Abstractions.Models: One call to a model, as IMentorActionObserver.OnModelCallAsync receives it: the tokens…

View as Markdown
On this page

One call to a model, as IMentorActionObserver.OnModelCallAsync receives it: the tokens it used, the agent it is attributed to, and for whom. One for each call — each round trip of an agent, each check of a classifier — so a turn has several. Never the text of the request or of the answer. More properties may be added.

Namespace: Novior.MentorAgent.Abstractions.Models. Package: Novior.MentorAgent.Abstractions.

public sealed record MentorModelCall : IEquatable<MentorModelCall>

Terminal
dotnet add package Novior.MentorAgent.Abstractions

The calls and the decisions (MentorActionDecision) reach an observer on two queues of their own, so the order between a call and a decision is not kept. Both carry MentorModelCall.SessionId, MentorModelCall.TurnId and MentorModelCall.Timestamp: sort by them to put a turn back together. The totals per model of the dashboard are MentorModelUsage.

public MentorModelCall()

public MentorAgentKind? AgentKind { get; init; }

The kind of agent the call is attributed to, or null for a check MentorAgent makes on its own (MentorModelCall.Purpose says which).

public string? AgentName { get; init; }

The name of the agent the call is attributed to, when it has one.

public long? CachedInputTokens { get; init; }

Of MentorModelCall.InputTokens, those the provider read from its cache, when it says so.

public TimeSpan Duration { get; init; }

How long the call took.

public long InputTokens { get; init; }

The tokens of the request; 0 when MentorModelCall.UsageMeasured is false.

public string? ModelId { get; init; }

The model that answered, as the provider named it, else the deployment the client points at.

public required MentorModelCallOutcome Outcome { get; init; }

How the call ended.

public long OutputTokens { get; init; }

The tokens of the answer; 0 when MentorModelCall.UsageMeasured is false.

public required MentorModelCallPurpose Purpose { get; init; }

What the call was for: the agent's reply, or one of MentorAgent's own checks.

public long? ReasoningTokens { get; init; }

Of MentorModelCall.OutputTokens, those spent on reasoning, when the provider says so.

public string? SessionId { get; init; }

An opaque id of the session, the same as MentorActionDecision.SessionId.

public required MentorActionSurface Surface { get; init; }

Where the turn came from.

public string? TenantId { get; init; }

The tenant of the turn, as MentorActionDecision.TenantId.

public required DateTimeOffset Timestamp { get; init; }

When the call ended.

public string? TurnId { get; init; }

An opaque id of the turn, the same as MentorActionDecision.TurnId; none outside a turn.

public bool UsageMeasured { get; init; }

Whether the provider said how many tokens the call used. A stream without a usage part, a call that failed or was stopped: the counts are unknown, not zero.

public ClaimsPrincipal? User { get; init; }

The signed-in user who asked, as MentorActionDecision.User; null when nobody is.