mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 07:13:29 +00:00
fix(insights): default to current full-size AI models for the headline feature
The OpenAI BYOK + admin-shared fallback defaulted to a small model and Anthropic to a 2024 Sonnet, so a user on the operator's shared key got the weakest model for the Insights assessments. Bump the OpenAI default to gpt-4o and the Anthropic default to claude-sonnet-4-6; both stay overridable by user config. Sync the provider docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
437a627a66
commit
9a07a27001
2 files changed
+22
-21
No files matched your search
@@ -70,14 +70,14 @@ function buildUserProvider(row: UserAIRow): AIProvider | null {
|
||||
// to the admin key if the user hasn't supplied their own. The
|
||||
// model-default mirrors the admin path for consistency so a saved
|
||||
// user "OPENAI" without an explicit model still produces an
|
||||
// OpenAIClient with `gpt-4o-mini`.
|
||||
// OpenAIClient with the current full-size default `gpt-4o`.
|
||||
// Belt-and-braces: ignore any persisted `aiBaseUrl`. The column is
|
||||
// shared with LOCAL, so a stale LAN URL there would otherwise
|
||||
// redirect the user's OpenAI key to a private host.
|
||||
if (!row.aiOpenaiKeyEncrypted) return null;
|
||||
return new OpenAIClient({
|
||||
apiKey: decrypt(row.aiOpenaiKeyEncrypted),
|
||||
model: row.aiModel ?? "gpt-4o-mini",
|
||||
model: row.aiModel ?? "gpt-4o",
|
||||
baseUrl: "https://api.openai.com/v1",
|
||||
});
|
||||
}
|
||||
@@ -97,7 +97,7 @@ async function resolveAdminProvider(): Promise<AIProvider> {
|
||||
if (settings?.adminAiKeyEncrypted) {
|
||||
return new OpenAIClient({
|
||||
apiKey: decrypt(settings.adminAiKeyEncrypted),
|
||||
model: settings.adminAiModel ?? "gpt-4o-mini",
|
||||
model: settings.adminAiModel ?? "gpt-4o",
|
||||
baseUrl: settings.adminAiBaseUrl ?? "https://api.openai.com/v1",
|
||||
});
|
||||
}
|
||||
@@ -339,7 +339,7 @@ async function resolveProviderForType(
|
||||
if (!enc) return null;
|
||||
return new OpenAIClient({
|
||||
apiKey: decrypt(enc),
|
||||
model: ctx.userRow?.aiModel ?? "gpt-4o-mini",
|
||||
model: ctx.userRow?.aiModel ?? "gpt-4o",
|
||||
baseUrl: "https://api.openai.com/v1",
|
||||
});
|
||||
}
|
||||
@@ -348,7 +348,7 @@ async function resolveProviderForType(
|
||||
if (!enc) return null;
|
||||
return new AnthropicClient({
|
||||
apiKey: decrypt(enc),
|
||||
model: ctx.userRow?.aiModel ?? "claude-3-5-sonnet-latest",
|
||||
model: ctx.userRow?.aiModel ?? "claude-sonnet-4-6",
|
||||
});
|
||||
}
|
||||
case "local": {
|
||||
@@ -501,7 +501,7 @@ export async function resolveProviderForTest(
|
||||
if (userKey) {
|
||||
return new OpenAIClient({
|
||||
apiKey: userKey,
|
||||
model: model || "gpt-4o-mini",
|
||||
model: model || "gpt-4o",
|
||||
baseUrl: "https://api.openai.com/v1",
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user