Files
anthropic-client/src/AnthropicClient/Models/AnthropicError.cs
T

34 lines
804 B
C#
Raw Normal View History

2024-06-27 23:26:53 -05:00
using System.Text.Json.Serialization;
namespace AnthropicClient.Models;
/// <summary>
/// Represents an error response from the Anthropic API.
/// </summary>
public class AnthropicError
{
/// <summary>
/// The type of the error.
/// </summary>
public string Type { get; init; } = "error";
/// <summary>
/// The error object.
/// </summary>
2024-07-03 16:57:27 -05:00
public Error Error { get; init; } = new ApiError();
2024-06-27 23:26:53 -05:00
[JsonConstructor]
internal AnthropicError()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="AnthropicError"/> class.
/// </summary>
/// <param name="error">The error as an <see cref="Error"/> object.</param>
/// <returns>A new instance of the <see cref="AnthropicError"/> class.</returns>
public AnthropicError(Error error)
{
Error = error;
}
}