mirror of
https://github.com/lucasrcsantana/story-generator.git
synced 2025-12-16 21:37:51 +00:00
refactor: simplifica validação do JSON Schema da análise de redações - Remove limites min/max dos campos numéricos - Remove restrição minItems dos arrays - Simplifica validação para maior flexibilidade
This commit is contained in:
parent
756335f78f
commit
28ac3ef8cc
@ -264,3 +264,9 @@ e este projeto adere ao [Semantic Versioning](https://semver.org/lang/pt-BR/).
|
||||
- Adicionadas políticas para tabelas relacionadas (feedback, pontos fortes, melhorias e notas)
|
||||
- Melhorada a segurança com políticas específicas para cada operação
|
||||
- Corrigido erro de permissão na inserção de análises pela Edge Function
|
||||
|
||||
### Técnico
|
||||
- Removidas restrições de validação do JSON Schema da análise de redações:
|
||||
- Removidos limites `minimum` e `maximum` dos campos numéricos
|
||||
- Removida restrição `minItems` dos arrays de pontos fortes e melhorias
|
||||
- Simplificada a validação para maior flexibilidade na Edge Function
|
||||
|
||||
@ -213,88 +213,82 @@ Responda em formato JSON seguindo exatamente esta estrutura:
|
||||
response_format: {
|
||||
type: "json_schema",
|
||||
json_schema: {
|
||||
type: "object",
|
||||
required: ["overall_score", "suggestions", "feedback", "strengths", "improvements", "criteria_scores"],
|
||||
properties: {
|
||||
overall_score: {
|
||||
type: "number",
|
||||
minimum: 0,
|
||||
maximum: 100,
|
||||
description: "Pontuação geral da redação (0-100)"
|
||||
},
|
||||
suggestions: {
|
||||
type: "string",
|
||||
description: "Sugestões específicas para aprimoramento"
|
||||
},
|
||||
feedback: {
|
||||
type: "object",
|
||||
required: ["structure", "content", "language"],
|
||||
properties: {
|
||||
structure: {
|
||||
type: "string",
|
||||
description: "Feedback sobre estrutura e organização"
|
||||
},
|
||||
content: {
|
||||
type: "string",
|
||||
description: "Feedback sobre conteúdo e ideias"
|
||||
},
|
||||
language: {
|
||||
type: "string",
|
||||
description: "Feedback sobre linguagem e gramática"
|
||||
name: "essay_analysis",
|
||||
strict: true,
|
||||
description: "Análise detalhada da redação",
|
||||
schema: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
required: ["overall_score", "suggestions", "feedback", "strengths", "improvements", "criteria_scores"],
|
||||
properties: {
|
||||
overall_score: {
|
||||
type: "number",
|
||||
description: "Pontuação geral da redação (0-100)"
|
||||
},
|
||||
suggestions: {
|
||||
type: "string",
|
||||
description: "Sugestões específicas para aprimoramento"
|
||||
},
|
||||
feedback: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
required: ["structure", "content", "language"],
|
||||
properties: {
|
||||
structure: {
|
||||
type: "string",
|
||||
description: "Feedback sobre estrutura e organização"
|
||||
},
|
||||
content: {
|
||||
type: "string",
|
||||
description: "Feedback sobre conteúdo e ideias"
|
||||
},
|
||||
language: {
|
||||
type: "string",
|
||||
description: "Feedback sobre linguagem e gramática"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
strengths: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "string",
|
||||
description: "Ponto forte da redação"
|
||||
},
|
||||
minItems: 1,
|
||||
description: "Lista de pontos fortes da redação"
|
||||
},
|
||||
improvements: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "string",
|
||||
description: "Ponto a melhorar na redação"
|
||||
strengths: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "string",
|
||||
description: "Ponto forte da redação"
|
||||
},
|
||||
description: "Lista de pontos fortes da redação"
|
||||
},
|
||||
minItems: 1,
|
||||
description: "Lista de pontos a melhorar na redação"
|
||||
},
|
||||
criteria_scores: {
|
||||
type: "object",
|
||||
required: ["adequacy", "coherence", "cohesion", "vocabulary", "grammar"],
|
||||
properties: {
|
||||
adequacy: {
|
||||
type: "number",
|
||||
minimum: 0,
|
||||
maximum: 100,
|
||||
description: "Adequação ao tema/gênero (0-100)"
|
||||
improvements: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "string",
|
||||
description: "Ponto a melhorar na redação"
|
||||
},
|
||||
coherence: {
|
||||
type: "number",
|
||||
minimum: 0,
|
||||
maximum: 100,
|
||||
description: "Coerência textual (0-100)"
|
||||
},
|
||||
cohesion: {
|
||||
type: "number",
|
||||
minimum: 0,
|
||||
maximum: 100,
|
||||
description: "Coesão textual (0-100)"
|
||||
},
|
||||
vocabulary: {
|
||||
type: "number",
|
||||
minimum: 0,
|
||||
maximum: 100,
|
||||
description: "Vocabulário (0-100)"
|
||||
},
|
||||
grammar: {
|
||||
type: "number",
|
||||
minimum: 0,
|
||||
maximum: 100,
|
||||
description: "Gramática e ortografia (0-100)"
|
||||
description: "Lista de pontos a melhorar na redação"
|
||||
},
|
||||
criteria_scores: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
required: ["adequacy", "coherence", "cohesion", "vocabulary", "grammar"],
|
||||
properties: {
|
||||
adequacy: {
|
||||
type: "number",
|
||||
description: "Adequação ao tema/gênero (0-100)"
|
||||
},
|
||||
coherence: {
|
||||
type: "number",
|
||||
description: "Coerência textual (0-100)"
|
||||
},
|
||||
cohesion: {
|
||||
type: "number",
|
||||
description: "Coesão textual (0-100)"
|
||||
},
|
||||
vocabulary: {
|
||||
type: "number",
|
||||
description: "Vocabulário (0-100)"
|
||||
},
|
||||
grammar: {
|
||||
type: "number",
|
||||
description: "Gramática e ortografia (0-100)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user