feat: add classes to model response to get model list endpoint
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace AnthropicClient.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an Anthropic model.
|
||||
/// </summary>
|
||||
public class AnthropicModel
|
||||
{
|
||||
/// <summary>
|
||||
/// The type of the model.
|
||||
/// </summary>
|
||||
public string Type { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The id of the model.
|
||||
/// </summary>
|
||||
public string Id { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The display name of the model.
|
||||
/// </summary>
|
||||
[JsonPropertyName("display_name")]
|
||||
public string DisplayName { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The created date of the model.
|
||||
/// </summary>
|
||||
[JsonPropertyName("created_at")]
|
||||
public DateTimeOffset CreatedAt { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace AnthropicClient.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a page.
|
||||
/// </summary>
|
||||
public class Page
|
||||
{
|
||||
/// <summary>
|
||||
/// The id of the first item in the page.
|
||||
/// </summary>
|
||||
[JsonPropertyName("first_id")]
|
||||
public string FirstId { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The id of the last item in the page.
|
||||
/// </summary>
|
||||
[JsonPropertyName("last_id")]
|
||||
public string LastId { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether there is more data to be retrieved.
|
||||
/// </summary>
|
||||
[JsonPropertyName("has_more")]
|
||||
public bool HasMore { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a page with data.
|
||||
/// </summary>
|
||||
public class Page<T> : Page
|
||||
{
|
||||
/// <summary>
|
||||
/// The data in the page.
|
||||
/// </summary>
|
||||
public T[] Data { get; init; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user