Read the context window from four more model lists

This commit is contained in:
Thorsten Sommer committed 2026-09-13 10:59:41 +02:00
1 parent 1c03a46e2f
commit caf2aba4b9
16 files changed
+415 -28

No files matched your search

@@ -1,3 +1,13 @@
using System.Text.Json.Serialization;
namespace AIStudio.Provider.Mistral;
public readonly record struct Model(string Id, string Object, int Created, string OwnedBy);
/// <summary>
/// One model as Mistral lists it.
/// </summary>
/// <param name="Id">The model's ID.</param>
/// <param name="Object">What kind of thing the entry is. Known value: "model".</param>
/// <param name="Created">When the model was published, as seconds since the epoch.</param>
/// <param name="OwnedBy">Who Mistral names as the owner of the model.</param>
/// <param name="ContextWindowTokens">How much the model reads and writes in one conversation, in tokens.</param>
public readonly record struct Model(string Id, string Object, int Created, string OwnedBy, [property: JsonPropertyName("max_context_length")] int? ContextWindowTokens);
@@ -1,6 +1,7 @@
using System.Runtime.CompilerServices;
using AIStudio.Chat;
using AIStudio.Models.Live;
using AIStudio.Provider.OpenAI;
using AIStudio.Settings;
@@ -139,6 +140,8 @@ public sealed class ProviderMistral() : BaseProvider(LLMProviders.MISTRAL, new U
storeType,
"models",
modelResponse => modelResponse.Data.Select(n => new Provider.Model(n.Id, null)),
apiKeyProvisional, token: token);
apiKeyProvisional,
listingFactory: modelResponse => modelResponse.Data.Select(n => ModelListing.For(n.Id, n.ContextWindowTokens)),
token: token);
}
}