Feat : tts

This commit is contained in:
decolua
2026-04-10 10:17:53 +07:00
parent 39545cf4c8
commit 3c96e8d6d1
40 changed files with 1896 additions and 147 deletions

View File

@@ -109,7 +109,7 @@ export async function GET() {
// POST - Update 9Router settings (merge with existing config)
export async function POST(request) {
try {
const { baseUrl, apiKey, model } = await request.json();
const { baseUrl, apiKey, model, subagentModel } = await request.json();
if (!baseUrl || !apiKey || !model) {
return NextResponse.json({ error: "baseUrl, apiKey and model are required" }, { status: 400 });
@@ -141,6 +141,12 @@ export async function POST(request) {
wire_api: "responses",
});
// Add subagent configuration
const effectiveSubagentModel = subagentModel || model;
setNestedSection(parsed, "agents.subagent", {
model: effectiveSubagentModel,
});
// Write merged config
const configContent = stringifyTOML(parsed);
await fs.writeFile(configPath, configContent);
@@ -196,6 +202,9 @@ export async function DELETE() {
// Remove 9router provider section
deleteNestedSection(parsed, "model_providers.9router");
// Remove subagent configuration
deleteNestedSection(parsed, "agents.subagent");
// Write updated config
const configContent = stringifyTOML(parsed);
await fs.writeFile(configPath, configContent);