chore(settings): align default ai model handling
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { SystemRole } from "@capakraken/shared";
|
||||
import { DEFAULT_OPENAI_MODEL, SystemRole } from "@capakraken/shared";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const {
|
||||
@@ -90,7 +90,7 @@ describe("settings procedure support", () => {
|
||||
},
|
||||
}), {
|
||||
aiProvider: "openai",
|
||||
azureOpenAiDeployment: "gpt-4o-mini",
|
||||
azureOpenAiDeployment: DEFAULT_OPENAI_MODEL,
|
||||
azureOpenAiApiKey: "should-be-ignored",
|
||||
smtpPassword: "also-ignored",
|
||||
});
|
||||
@@ -105,11 +105,11 @@ describe("settings procedure support", () => {
|
||||
create: {
|
||||
id: "singleton",
|
||||
aiProvider: "openai",
|
||||
azureOpenAiDeployment: "gpt-4o-mini",
|
||||
azureOpenAiDeployment: DEFAULT_OPENAI_MODEL,
|
||||
},
|
||||
update: {
|
||||
aiProvider: "openai",
|
||||
azureOpenAiDeployment: "gpt-4o-mini",
|
||||
azureOpenAiDeployment: DEFAULT_OPENAI_MODEL,
|
||||
},
|
||||
});
|
||||
expect(createAuditEntry).toHaveBeenCalledWith(expect.objectContaining({
|
||||
@@ -117,7 +117,7 @@ describe("settings procedure support", () => {
|
||||
action: "UPDATE",
|
||||
after: expect.objectContaining({
|
||||
aiProvider: "openai",
|
||||
azureOpenAiDeployment: "gpt-4o-mini",
|
||||
azureOpenAiDeployment: DEFAULT_OPENAI_MODEL,
|
||||
}),
|
||||
}));
|
||||
});
|
||||
@@ -182,7 +182,7 @@ describe("settings procedure support", () => {
|
||||
systemSettings: {
|
||||
findUnique: vi.fn().mockResolvedValue({
|
||||
aiProvider: "openai",
|
||||
azureOpenAiDeployment: "gpt-4o-mini",
|
||||
azureOpenAiDeployment: DEFAULT_OPENAI_MODEL,
|
||||
azureOpenAiApiKey: null,
|
||||
}),
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { VALUE_SCORE_WEIGHTS } from "@capakraken/shared";
|
||||
import { DEFAULT_OPENAI_MODEL, VALUE_SCORE_WEIGHTS } from "@capakraken/shared";
|
||||
import { z } from "zod";
|
||||
import {
|
||||
isAiConfigured,
|
||||
@@ -238,7 +238,7 @@ export async function testRuntimeAiConnection(settings: {
|
||||
});
|
||||
}
|
||||
|
||||
const model = configuredSettings.azureOpenAiDeployment ?? "gpt-4o-mini";
|
||||
const model = configuredSettings.azureOpenAiDeployment ?? DEFAULT_OPENAI_MODEL;
|
||||
return performAiConnectionFetch(
|
||||
provider,
|
||||
"https://api.openai.com/v1/chat/completions",
|
||||
|
||||
Reference in New Issue
Block a user