Table of Contents

Class AgentResult

Namespace
Emissary
Assembly
Emissary.dll

The outcome of an agent run.

public sealed class AgentResult
Inheritance
AgentResult
Inherited Members

Properties

Conversation

The full conversation including every assistant turn and tool result.

public required Conversation Conversation { get; init; }

Property Value

Conversation

FinalText

The text of the last assistant message, or "" if there is none.

public string FinalText { get; }

Property Value

string

Model

The model that produced the run. Needed to price Usage, and worth recording when comparing runs across model versions.

public string Model { get; init; }

Property Value

string

PlannedEffects

The privileged calls intercepted in Shadow runs — the plan of effects awaiting approval. Empty for live runs.

public IReadOnlyList<PlannedEffect> PlannedEffects { get; init; }

Property Value

IReadOnlyList<PlannedEffect>

StopReason

Why the run ended.

public required AgentStopReason StopReason { get; init; }

Property Value

AgentStopReason

Suspension

The durable suspension state when StopReason is AwaitingApproval; otherwise null.

public SuspendedRun? Suspension { get; init; }

Property Value

SuspendedRun

Tainted

Whether untrusted tool output (a tool marked Untrusted) entered the conversation during the run.

public bool Tainted { get; init; }

Property Value

bool

ToolFailures

Tool handlers that threw during the run and were reported to the model instead of ending it. Empty when nothing failed. Carries the exceptions in full even when the model was told only the exception type (see IncludeExceptionMessage).

public IReadOnlyList<ToolFailure> ToolFailures { get; init; }

Property Value

IReadOnlyList<ToolFailure>

Usage

Token usage summed over all turns.

public required AgentUsage Usage { get; init; }

Property Value

AgentUsage

Methods

FinalAs<T>(JsonTypeInfo<T>)

Deserializes FinalText as T — for runs configured with OutputSchemaJson. AOT-safe: pass source-generated metadata (YourJsonContext.Default.YourType).

public T FinalAs<T>(JsonTypeInfo<T> typeInfo)

Parameters

typeInfo JsonTypeInfo<T>

Source-generated serializer metadata for T.

Returns

T

Type Parameters

T

The structured output type.

Exceptions

InvalidOperationException

The final text is not a T.