feat: enhance translator functionality and UI

This commit is contained in:
decolua
2026-03-06 16:26:33 +07:00
parent 3b847c485f
commit d347de8092
10 changed files with 2950 additions and 565 deletions
@@ -54,13 +54,17 @@ function convertMessages(messages, tools, model) {
description = `Tool: ${name}`;
}
const schema = t.function?.parameters || t.parameters || t.input_schema || {};
// Normalize schema: Kiro requires required[] and proper type/properties
const normalizedSchema = Object.keys(schema).length === 0
? { type: "object", properties: {}, required: [] }
: { ...schema, required: schema.required ?? [] };
return {
toolSpecification: {
name,
description,
inputSchema: {
json: t.function?.parameters || t.parameters || t.input_schema || {}
}
inputSchema: { json: normalizedSchema }
}
};
});