NoObjectGeneratedException
Namespace: Vercel.AI.GenerateObject
public sealed class NoObjectGeneratedException : AiSdkError, ISerializable, IErrorMarkersThrown when a model response cannot produce the requested object. Maps to NoObjectGeneratedError.
Inheritance: object → Exception → AiSdkError
Implements: ISerializable, IErrorMarkers
Constructors
Section titled “Constructors”NoObjectGeneratedException(string, Exception?, string?, StepResponse, LanguageModelUsage, FinishReason)
Section titled “NoObjectGeneratedException(string, Exception?, string?, StepResponse, LanguageModelUsage, FinishReason)”public NoObjectGeneratedException(string message, Exception? cause, string? text, StepResponse response, LanguageModelUsage usage, FinishReason finishReason)Creates the exception and preserves the failed generation details.
Parameters
| Name | Type | Description |
|---|---|---|
message |
string | |
cause |
Exception | |
text |
string | |
response |
StepResponse | |
usage |
LanguageModelUsage | |
finishReason |
FinishReason |
Fields
Section titled “Fields”ErrorMarker
Section titled “ErrorMarker”public const string ErrorMarker = "vercel.ai.error.AI_NoObjectGeneratedError"Marker for IsInstance(object).
Value: string
Properties
Section titled “Properties”FinishReason
Section titled “FinishReason”public FinishReason FinishReason { get; }Why the model finished generating.
Value: FinishReason
Response
Section titled “Response”public StepResponse Response { get; }Response metadata from the model call.
Value: StepResponse
public string? Text { get; }The selected text that failed to parse or validate.
Value: string
public LanguageModelUsage Usage { get; }Token usage from the model call.
Value: LanguageModelUsage
Methods
Section titled “Methods”IsInstance(object?)
Section titled “IsInstance(object?)”public static bool IsInstance(object? error)Returns whether <code class=“paramref”>error</code> carries this error’s marker.
Parameters
| Name | Type | Description |
|---|---|---|
error |
object |
Returns: bool
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product