ToolChoiceViolationException
Namespace: Vercel.AI.GenerateText
public sealed class ToolChoiceViolationException : AiSdkException, ISerializableThe model response did not satisfy toolChoice. Maps to ToolChoiceViolationError.
Inheritance: object → Exception → AiSdkException
Implements: ISerializable
Constructors
Section titled “Constructors”ToolChoiceViolationException(string, ToolChoice, FinishReason, string, string, IReadOnlyList<GeneratedContent>)
Section titled “ToolChoiceViolationException(string, ToolChoice, FinishReason, string, string, IReadOnlyList<GeneratedContent>)”public ToolChoiceViolationException(string message, ToolChoice toolChoice, FinishReason finishReason, string provider, string modelId, IReadOnlyList<GeneratedContent> content)Creates the exception.
Parameters
| Name | Type | Description |
|---|---|---|
message |
string | |
toolChoice |
ToolChoice | |
finishReason |
FinishReason | |
provider |
string | |
modelId |
string | |
content |
IReadOnlyList<GeneratedContent> |
Properties
Section titled “Properties”Content
Section titled “Content”public IReadOnlyList<GeneratedContent> Content { get; }Content from the rejected model call.
Value: IReadOnlyList<GeneratedContent>
FinishReason
Section titled “FinishReason”public FinishReason FinishReason { get; }Finish reason from the model call.
Value: FinishReason
ModelId
Section titled “ModelId”public string ModelId { get; }Model id.
Value: string
public string Name { get; }Stable error name.
Value: string
Provider
Section titled “Provider”public string Provider { get; }Model provider id.
Value: string
ToolChoice
Section titled “ToolChoice”public ToolChoice ToolChoice { get; }Tool choice that was violated.
Value: ToolChoice
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product