feat: Corrigindo analyze-essay

This commit is contained in:
Lucas Santana 2025-02-06 21:59:18 -03:00
parent 1c6aa56b32
commit 4609217fb7

View File

@ -155,7 +155,52 @@ Responda em formato JSON seguindo exatamente esta estrutura:
content: prompt
}
],
response_format: { type: "json_object" }
response_format: {
type: "json_schema",
json_schema: {
type: "object",
name: "EssayAnalysis",
schema: {
type: "object",
schema: {
type: "object",
additionalProperties: false,
properties: {
overall_score: { type: "number" },
feedback: {
type: "object",
additionalProperties: false,
properties: {
structure: { type: "string" },
content: { type: "string" },
language: { type: "string" }
}
},
strengths: {
type: "array",
items: { type: "string" }
},
improvements: {
type: "array",
items: { type: "string" }
},
suggestions: { type: "string" },
criteria_scores: {
type: "object",
additionalProperties: false,
properties: {
adequacy: { type: "number" },
coherence: { type: "number" },
cohesion: { type: "number" },
vocabulary: { type: "number" },
grammar: { type: "number" }
}
}
}
}
}
}
}
});
const analysis: EssayAnalysisResponse = JSON.parse(completion.choices[0].message.content)