Table of Contents

Class StructuredOutputException

Namespace
Mythosia.AI.Exceptions
Assembly
Mythosia.AI.Abstractions.dll

Exception thrown when structured output deserialization fails after all retry attempts. Contains rich diagnostic context: raw LLM responses, parse errors, attempt count, and schema.

public class StructuredOutputException : AIServiceException, ISerializable
Inheritance
StructuredOutputException
Implements
Inherited Members

Constructors

StructuredOutputException(string, string, string, string, int, string)

public StructuredOutputException(string targetTypeName, string firstRawResponse, string lastRawResponse, string parseError, int attemptCount, string schemaJson)

Parameters

targetTypeName string
firstRawResponse string
lastRawResponse string
parseError string
attemptCount int
schemaJson string

Properties

AttemptCount

Total number of attempts made (1 initial + retries).

public int AttemptCount { get; }

Property Value

int

FirstRawResponse

The raw LLM response from the first attempt.

public string FirstRawResponse { get; }

Property Value

string

LastRawResponse

The raw LLM response from the last attempt.

public string LastRawResponse { get; }

Property Value

string

ParseError

The last JSON parse/deserialization error message.

public string ParseError { get; }

Property Value

string

SchemaJson

The JSON schema that the LLM was instructed to follow.

public string SchemaJson { get; }

Property Value

string

TargetTypeName

The target type name that deserialization was attempted for.

public string TargetTypeName { get; }

Property Value

string