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
FinalText
The text of the last assistant message, or "" if there is none.
public string FinalText { get; }
Property Value
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
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
StopReason
Why the run ended.
public required AgentStopReason StopReason { get; init; }
Property Value
Suspension
The durable suspension state when StopReason is AwaitingApproval; otherwise null.
public SuspendedRun? Suspension { get; init; }
Property Value
Tainted
Whether untrusted tool output (a tool marked Untrusted) entered the conversation during the run.
public bool Tainted { get; init; }
Property Value
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
Usage
Token usage summed over all turns.
public required AgentUsage Usage { get; init; }
Property Value
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
typeInfoJsonTypeInfo<T>Source-generated serializer metadata for
T.
Returns
- T
Type Parameters
TThe structured output type.
Exceptions
- InvalidOperationException
The final text is not a
T.