Feat : tts
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user