fix: align moonshot detail config key
This commit is contained in:
parent
aa9abff5af
commit
a2de2c6d6d
@ -19,6 +19,7 @@ import {
|
|||||||
normalizeRealtimeCanvasConfigForStorage,
|
normalizeRealtimeCanvasConfigForStorage,
|
||||||
resolveRealtimeProviders,
|
resolveRealtimeProviders,
|
||||||
} from "@/lib/realtime/config";
|
} from "@/lib/realtime/config";
|
||||||
|
import { DETAIL_AGENT_LOCAL_MOONSHOT_SETTING_KEY } from "@/lib/ai/detail-agent-model-config";
|
||||||
import { db } from "@/lib/db";
|
import { db } from "@/lib/db";
|
||||||
import { siteSettings } from "@/lib/db/schema";
|
import { siteSettings } from "@/lib/db/schema";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
@ -86,7 +87,7 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
let nextValue = value;
|
let nextValue = value;
|
||||||
|
|
||||||
if (key === "moonshot_detail_agent_config") {
|
if (key === DETAIL_AGENT_LOCAL_MOONSHOT_SETTING_KEY) {
|
||||||
const config = moonshotDetailAgentConfigSchema.parse(value || {});
|
const config = moonshotDetailAgentConfigSchema.parse(value || {});
|
||||||
const normalizedBaseUrl = String(config.baseUrl || "").trim() || MOONSHOT_OFFICIAL_BASE_URL;
|
const normalizedBaseUrl = String(config.baseUrl || "").trim() || MOONSHOT_OFFICIAL_BASE_URL;
|
||||||
const normalizedModelId = String(config.modelId || "").trim() || MOONSHOT_KIMI_K25_MODEL_ID;
|
const normalizedModelId = String(config.modelId || "").trim() || MOONSHOT_KIMI_K25_MODEL_ID;
|
||||||
@ -197,7 +198,7 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
return Response.json({
|
return Response.json({
|
||||||
setting: {
|
setting: {
|
||||||
key: "moonshot_detail_agent_config",
|
key: DETAIL_AGENT_LOCAL_MOONSHOT_SETTING_KEY,
|
||||||
value: {
|
value: {
|
||||||
providerId: provider.id,
|
providerId: provider.id,
|
||||||
modelEntryId: model.id,
|
modelEntryId: model.id,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user