mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-21 08:58:00 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99dac520cb | ||
|
|
e21e30ce8c |
No files matched your search
@@ -13,6 +13,7 @@ public partial class Changelog
|
||||
|
||||
public static readonly Log[] LOGS =
|
||||
[
|
||||
new (205, "v0.9.30, build 205 (2025-02-24 19:55 UTC)", "v0.9.30.md"),
|
||||
new (204, "v0.9.29, build 204 (2025-02-24 13:48 UTC)", "v0.9.29.md"),
|
||||
new (203, "v0.9.28, build 203 (2025-02-09 16:33 UTC)", "v0.9.28.md"),
|
||||
new (202, "v0.9.27, build 202 (2025-01-21 18:24 UTC)", "v0.9.27.md"),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Net.Http.Headers;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
@@ -87,21 +88,15 @@ public sealed class ProviderAnthropic(ILogger logger) : BaseProvider("https://ap
|
||||
/// <inheritdoc />
|
||||
public override Task<IEnumerable<Model>> GetTextModels(string? apiKeyProvisional = null, CancellationToken token = default)
|
||||
{
|
||||
return Task.FromResult(new[]
|
||||
var additionalModels = new[]
|
||||
{
|
||||
new Model("claude-3-5-sonnet-latest", "Claude 3.5 Sonnet (latest)"),
|
||||
new Model("claude-3-5-sonnet-20240620", "Claude 3.5 Sonnet (20. June 2024)"),
|
||||
new Model("claude-3-5-sonnet-20241022", "Claude 3.5 Sonnet (22. October 2024)"),
|
||||
|
||||
new Model("claude-3-5-haiku-latest", "Claude 3.5 Haiku (latest)"),
|
||||
new Model("claude-3-5-heiku-20241022", "Claude 3.5 Haiku (22. October 2024)"),
|
||||
|
||||
new Model("claude-3-opus-20240229", "Claude 3.0 Opus (29. February 2024)"),
|
||||
new Model("claude-3-opus-latest", "Claude 3.0 Opus (latest)"),
|
||||
|
||||
new Model("claude-3-sonnet-20240229", "Claude 3.0 Sonnet (29. February 2024)"),
|
||||
new Model("claude-3-haiku-20240307", "Claude 3.0 Haiku (7. March 2024)"),
|
||||
}.AsEnumerable());
|
||||
new Model("claude-3-7-sonnet-latest", "Claude 3.7 Sonnet (Latest)"),
|
||||
new Model("claude-3-5-sonnet-latest", "Claude 3.5 Sonnet (Latest)"),
|
||||
new Model("claude-3-5-haiku-latest", "Claude 3.5 Haiku (Latest)"),
|
||||
new Model("claude-3-opus-latest", "Claude 3 Opus (Latest)"),
|
||||
};
|
||||
|
||||
return this.LoadModels(token, apiKeyProvisional).ContinueWith(t => t.Result.Concat(additionalModels).OrderBy(x => x.Id).AsEnumerable(), token);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -117,4 +112,37 @@ public sealed class ProviderAnthropic(ILogger logger) : BaseProvider("https://ap
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private async Task<IEnumerable<Model>> LoadModels(CancellationToken token, string? apiKeyProvisional = null)
|
||||
{
|
||||
var secretKey = apiKeyProvisional switch
|
||||
{
|
||||
not null => apiKeyProvisional,
|
||||
_ => await RUST_SERVICE.GetAPIKey(this) switch
|
||||
{
|
||||
{ Success: true } result => await result.Secret.Decrypt(ENCRYPTION),
|
||||
_ => null,
|
||||
}
|
||||
};
|
||||
|
||||
if (secretKey is null)
|
||||
return [];
|
||||
|
||||
using var request = new HttpRequestMessage(HttpMethod.Get, "models?limit=100");
|
||||
|
||||
// Set the authorization header:
|
||||
request.Headers.Add("x-api-key", secretKey);
|
||||
|
||||
// Set the Anthropic version:
|
||||
request.Headers.Add("anthropic-version", "2023-06-01");
|
||||
|
||||
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", secretKey);
|
||||
|
||||
using var response = await this.httpClient.SendAsync(request, token);
|
||||
if(!response.IsSuccessStatusCode)
|
||||
return [];
|
||||
|
||||
var modelResponse = await response.Content.ReadFromJsonAsync<ModelsResponse>(JSON_SERIALIZER_OPTIONS, token);
|
||||
return modelResponse.Data;
|
||||
}
|
||||
}
|
||||
@@ -207,6 +207,6 @@
|
||||
"contentHash": "7WaVMHklpT3Ye2ragqRIwlFRsb6kOk63BOGADV0fan3ulVfGLUYkDi5yNUsZS/7FVNkWbtHAlDLmu4WnHGfqvQ=="
|
||||
}
|
||||
},
|
||||
"net8.0/osx-arm64": {}
|
||||
"net8.0/osx-x64": {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
# v0.9.30, build 205 (2025-02-24 19:55 UTC)
|
||||
- Implemented the new models API for the Anthropic provider. This allows you to use the latest models, like Claude 3.7 Sonnet, which were released in the last hours.
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
0.9.29
|
||||
2025-02-24 13:48:37 UTC
|
||||
204
|
||||
0.9.30
|
||||
2025-02-24 19:55:00 UTC
|
||||
205
|
||||
8.0.113 (commit 8f216348dc)
|
||||
8.0.13 (commit eba546b0f0)
|
||||
1.85.0 (commit 4d91de4e4)
|
||||
7.16.0
|
||||
1.8.1
|
||||
03431b85b48, release
|
||||
e21e30ce8c5, release
|
||||
Generated
+1
-1
@@ -2347,7 +2347,7 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
|
||||
|
||||
[[package]]
|
||||
name = "mindwork-ai-studio"
|
||||
version = "0.9.29"
|
||||
version = "0.9.30"
|
||||
dependencies = [
|
||||
"aes",
|
||||
"arboard",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "mindwork-ai-studio"
|
||||
version = "0.9.29"
|
||||
version = "0.9.30"
|
||||
edition = "2021"
|
||||
description = "MindWork AI Studio"
|
||||
authors = ["Thorsten Sommer"]
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "MindWork AI Studio",
|
||||
"version": "0.9.29"
|
||||
"version": "0.9.30"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
|
||||
Reference in new issue
Block a user