-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathModelCatalogContracts.cs
More file actions
109 lines (84 loc) · 3.08 KB
/
ModelCatalogContracts.cs
File metadata and controls
109 lines (84 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// -----------------------------------------------------------------------
// <copyright file="ModelCatalogContracts.cs" company="Petabridge, LLC">
// Copyright (C) 2026 - 2026 Petabridge, LLC <https://petabridge.com>
// </copyright>
// -----------------------------------------------------------------------
namespace Netclaw.Configuration;
/// <summary>
/// A single model entry returned from the catalog.
/// <para>
/// <c>InputModalities</c> and <c>OutputModalities</c> are arrays of modality
/// strings (e.g. <c>["Text", "Image"]</c>).
/// </para>
/// </summary>
public sealed record ModelCatalogEntry
{
public required string Provider { get; init; }
public required string ModelId { get; init; }
public required string DisplayName { get; init; }
public int? ContextWindow { get; init; }
public string[] InputModalities { get; init; } = [];
public string[] OutputModalities { get; init; } = [];
/// <summary>UI category badges such as "frontier", "fast", "local".</summary>
public string[] Badges { get; init; } = [];
public string? Notes { get; init; }
}
/// <summary>
/// Response for <c>GET /api/models</c>.
/// </summary>
public sealed record GetModelCatalogResponse
{
public required IReadOnlyList<ModelCatalogEntry> Models { get; init; }
public string? Warning { get; init; }
}
/// <summary>
/// A model reference projected onto the wire — omits internal types.
/// </summary>
public sealed record ModelSelectionReference
{
public required string Provider { get; init; }
public required string ModelId { get; init; }
public int? ContextWindow { get; init; }
public string? Provenance { get; init; }
public string? InputModalities { get; init; }
public string? OutputModalities { get; init; }
}
/// <summary>
/// Response for <c>GET /api/model/selection</c>.
/// </summary>
public sealed record GetModelSelectionResponse
{
public required ModelSelectionReference Main { get; init; }
public ModelSelectionReference? Fallback { get; init; }
public ModelSelectionReference? Compaction { get; init; }
}
/// <summary>
/// Request for <c>PUT /api/model/selection</c>. <see cref="Role"/> must be
/// "Main", "Fallback", or "Compaction".
/// </summary>
public sealed record PutModelSelectionRequest
{
public required string Role { get; init; }
public required ModelSelectionReference Reference { get; init; }
}
/// <summary>
/// Response for <c>PUT /api/model/selection</c>.
/// </summary>
public sealed record PutModelSelectionResponse
{
public required string ConfigPath { get; init; }
/// <summary>
/// Always true: model selection is bound at daemon startup. The daemon
/// must be restarted before the new selection takes effect.
/// </summary>
public bool RestartRequired { get; init; } = true;
}
/// <summary>
/// Error response for <c>PUT /api/model/selection</c> when the request fails
/// validation or schema checks.
/// </summary>
public sealed record PutModelSelectionErrorResponse
{
public required string Message { get; init; }
public string[] ValidationErrors { get; init; } = [];
}