Spaces:
Runtime error
Runtime error
Revert "ParaAIV3.1"
Browse filesThis reverts commit 9ee6e33a28e612e5d10c17296b5fb27a657095c8.
- api/config.py +2 -2
- config/specialists_v13_6.yaml +7 -7
- core/base_specialist.py +6 -6
- core/context_builder.py +3 -3
- core/orchestrator.py +9 -9
- core/specialist_wrapper.py +2 -2
- core/validator.py +1 -1
- llm/clients/groq_client.py +5 -2
- requirements.txt +1 -0
- schemas/protocolo_v13_6_schema.json +192 -758
api/config.py
CHANGED
|
@@ -108,7 +108,7 @@ class Settings(BaseSettings):
|
|
| 108 |
# ========================================================================
|
| 109 |
LOG_LEVEL: str = Field(default="DEBUG", env="LOG_LEVEL")
|
| 110 |
LOG_FORMAT: str = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
| 111 |
-
LOG_FILE_ENABLED: bool = Field(default=
|
| 112 |
LOG_FILE_PATH: str = Field(default="./logs", env="LOG_FILE_PATH")
|
| 113 |
LOG_FILE_MAX_BYTES: int = Field(default=5242880, env="LOG_FILE_MAX_BYTES")
|
| 114 |
LOG_FILE_BACKUP_COUNT: int = Field(default=3, env="LOG_FILE_BACKUP_COUNT")
|
|
@@ -152,7 +152,7 @@ class Settings(BaseSettings):
|
|
| 152 |
# ========================================================================
|
| 153 |
DEV_MODE: bool = Field(default=True, env="DEV_MODE")
|
| 154 |
MOCK_LLM_RESPONSES: bool = Field(default=False, env="MOCK_LLM_RESPONSES")
|
| 155 |
-
SAVE_DEBUG_FILES: bool = Field(default=
|
| 156 |
|
| 157 |
# ========================================================================
|
| 158 |
# ADVANCED
|
|
|
|
| 108 |
# ========================================================================
|
| 109 |
LOG_LEVEL: str = Field(default="DEBUG", env="LOG_LEVEL")
|
| 110 |
LOG_FORMAT: str = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
| 111 |
+
LOG_FILE_ENABLED: bool = Field(default=False, env="LOG_FILE_ENABLED")
|
| 112 |
LOG_FILE_PATH: str = Field(default="./logs", env="LOG_FILE_PATH")
|
| 113 |
LOG_FILE_MAX_BYTES: int = Field(default=5242880, env="LOG_FILE_MAX_BYTES")
|
| 114 |
LOG_FILE_BACKUP_COUNT: int = Field(default=3, env="LOG_FILE_BACKUP_COUNT")
|
|
|
|
| 152 |
# ========================================================================
|
| 153 |
DEV_MODE: bool = Field(default=True, env="DEV_MODE")
|
| 154 |
MOCK_LLM_RESPONSES: bool = Field(default=False, env="MOCK_LLM_RESPONSES")
|
| 155 |
+
SAVE_DEBUG_FILES: bool = Field(default=False, env="SAVE_DEBUG_FILES")
|
| 156 |
|
| 157 |
# ========================================================================
|
| 158 |
# ADVANCED
|
config/specialists_v13_6.yaml
CHANGED
|
@@ -13,7 +13,7 @@ specialists:
|
|
| 13 |
schema_file: "schemas/specialist_schemas/fase1_segmentacao.json"
|
| 14 |
system_prompt: "Você é um especialista em segmentação de acórdãos do TJPR."
|
| 15 |
llm_config:
|
| 16 |
-
model: "groq/
|
| 17 |
temperature: 0.2
|
| 18 |
max_tokens: 3000
|
| 19 |
max_retries: 3
|
|
@@ -27,7 +27,7 @@ specialists:
|
|
| 27 |
schema_file: "schemas/specialist_schemas/fase2_metadados.json"
|
| 28 |
system_prompt: "Você é um especialista em extração de metadados jurídicos do TJPR."
|
| 29 |
llm_config:
|
| 30 |
-
model: "groq/
|
| 31 |
temperature: 0.1
|
| 32 |
max_tokens: 1500
|
| 33 |
max_retries: 3
|
|
@@ -41,7 +41,7 @@ specialists:
|
|
| 41 |
schema_file: "schemas/specialist_schemas/fase3_classificacao.json"
|
| 42 |
system_prompt: "Você é um especialista em classificação de ramos do direito."
|
| 43 |
llm_config:
|
| 44 |
-
model: "groq/
|
| 45 |
temperature: 0.2
|
| 46 |
max_tokens: 1000
|
| 47 |
max_retries: 3
|
|
@@ -55,7 +55,7 @@ specialists:
|
|
| 55 |
schema_file: "schemas/specialist_schemas/fase4_relatorio.json"
|
| 56 |
system_prompt: "Você é um especialista em análise de RELATÓRIOS de acórdãos."
|
| 57 |
llm_config:
|
| 58 |
-
model: "groq/
|
| 59 |
temperature: 0.3
|
| 60 |
max_tokens: 2500
|
| 61 |
max_retries: 3
|
|
@@ -69,7 +69,7 @@ specialists:
|
|
| 69 |
schema_file: "schemas/specialist_schemas/fase4_fundamentacao.json"
|
| 70 |
system_prompt: "Você é um especialista em análise de FUNDAMENTAÇÃO de acórdãos."
|
| 71 |
llm_config:
|
| 72 |
-
model: "groq/
|
| 73 |
temperature: 0.3
|
| 74 |
max_tokens: 3000
|
| 75 |
max_retries: 3
|
|
@@ -83,7 +83,7 @@ specialists:
|
|
| 83 |
schema_file: "schemas/specialist_schemas/fase4_dispositivo.json"
|
| 84 |
system_prompt: "Você é um especialista em análise de DISPOSITIVOS de acórdãos."
|
| 85 |
llm_config:
|
| 86 |
-
model: "groq/
|
| 87 |
temperature: 0.2
|
| 88 |
max_tokens: 2000
|
| 89 |
max_retries: 3
|
|
@@ -97,7 +97,7 @@ specialists:
|
|
| 97 |
schema_file: "schemas/specialist_schemas/fase5_arquivista.json"
|
| 98 |
system_prompt: "Você é um arquivista especializado em análise meta-cognitiva de acórdãos."
|
| 99 |
llm_config:
|
| 100 |
-
model: "groq/
|
| 101 |
temperature: 0.4
|
| 102 |
max_tokens: 1500
|
| 103 |
max_retries: 3
|
|
|
|
| 13 |
schema_file: "schemas/specialist_schemas/fase1_segmentacao.json"
|
| 14 |
system_prompt: "Você é um especialista em segmentação de acórdãos do TJPR."
|
| 15 |
llm_config:
|
| 16 |
+
model: "groq/openai/gpt-oss-20b"
|
| 17 |
temperature: 0.2
|
| 18 |
max_tokens: 3000
|
| 19 |
max_retries: 3
|
|
|
|
| 27 |
schema_file: "schemas/specialist_schemas/fase2_metadados.json"
|
| 28 |
system_prompt: "Você é um especialista em extração de metadados jurídicos do TJPR."
|
| 29 |
llm_config:
|
| 30 |
+
model: "groq/openai/gpt-oss-20b"
|
| 31 |
temperature: 0.1
|
| 32 |
max_tokens: 1500
|
| 33 |
max_retries: 3
|
|
|
|
| 41 |
schema_file: "schemas/specialist_schemas/fase3_classificacao.json"
|
| 42 |
system_prompt: "Você é um especialista em classificação de ramos do direito."
|
| 43 |
llm_config:
|
| 44 |
+
model: "groq/openai/gpt-oss-20b"
|
| 45 |
temperature: 0.2
|
| 46 |
max_tokens: 1000
|
| 47 |
max_retries: 3
|
|
|
|
| 55 |
schema_file: "schemas/specialist_schemas/fase4_relatorio.json"
|
| 56 |
system_prompt: "Você é um especialista em análise de RELATÓRIOS de acórdãos."
|
| 57 |
llm_config:
|
| 58 |
+
model: "groq/openai/gpt-oss-20b"
|
| 59 |
temperature: 0.3
|
| 60 |
max_tokens: 2500
|
| 61 |
max_retries: 3
|
|
|
|
| 69 |
schema_file: "schemas/specialist_schemas/fase4_fundamentacao.json"
|
| 70 |
system_prompt: "Você é um especialista em análise de FUNDAMENTAÇÃO de acórdãos."
|
| 71 |
llm_config:
|
| 72 |
+
model: "groq/openai/gpt-oss-20b"
|
| 73 |
temperature: 0.3
|
| 74 |
max_tokens: 3000
|
| 75 |
max_retries: 3
|
|
|
|
| 83 |
schema_file: "schemas/specialist_schemas/fase4_dispositivo.json"
|
| 84 |
system_prompt: "Você é um especialista em análise de DISPOSITIVOS de acórdãos."
|
| 85 |
llm_config:
|
| 86 |
+
model: "groq/openai/gpt-oss-20b"
|
| 87 |
temperature: 0.2
|
| 88 |
max_tokens: 2000
|
| 89 |
max_retries: 3
|
|
|
|
| 97 |
schema_file: "schemas/specialist_schemas/fase5_arquivista.json"
|
| 98 |
system_prompt: "Você é um arquivista especializado em análise meta-cognitiva de acórdãos."
|
| 99 |
llm_config:
|
| 100 |
+
model: "groq/openai/gpt-oss-20b"
|
| 101 |
temperature: 0.4
|
| 102 |
max_tokens: 1500
|
| 103 |
max_retries: 3
|
core/base_specialist.py
CHANGED
|
@@ -27,7 +27,7 @@ class BaseSpecialist(ABC):
|
|
| 27 |
1. NUNCA pedir mais de 10 campos por especialista
|
| 28 |
2. SEMPRE exibir JSON parcial no prompt (context injection)
|
| 29 |
3. SEMPRE validar output com jsonschema
|
| 30 |
-
4. SEMPRE logar input + output (
|
| 31 |
5. NUNCA usar placeholders ou dados simulados
|
| 32 |
"""
|
| 33 |
|
|
@@ -63,7 +63,7 @@ class BaseSpecialist(ABC):
|
|
| 63 |
self.max_retries = self.config.get('max_retries', 3)
|
| 64 |
self.retry_delay = self.config.get('retry_delay', 2)
|
| 65 |
|
| 66 |
-
|
| 67 |
|
| 68 |
def _load_config(self, specialist_id: int, config_path: str) -> Dict[str, Any]:
|
| 69 |
"""Carrega configuração do especialista do YAML"""
|
|
@@ -112,15 +112,15 @@ class BaseSpecialist(ABC):
|
|
| 112 |
Returns:
|
| 113 |
Resultado parcial (apenas os campos deste especialista)
|
| 114 |
"""
|
| 115 |
-
|
| 116 |
|
| 117 |
for attempt in range(self.max_retries):
|
| 118 |
try:
|
| 119 |
# 1. Construir prompt com context injection
|
| 120 |
prompt = self._build_prompt(input_data, context)
|
| 121 |
|
| 122 |
-
# 2. Log do prompt (
|
| 123 |
-
|
| 124 |
|
| 125 |
# 3. Chamar LLM
|
| 126 |
response = await self._call_llm(prompt)
|
|
@@ -137,7 +137,7 @@ class BaseSpecialist(ABC):
|
|
| 137 |
continue # Retry
|
| 138 |
|
| 139 |
# 6. Log de sucesso
|
| 140 |
-
|
| 141 |
|
| 142 |
return result
|
| 143 |
|
|
|
|
| 27 |
1. NUNCA pedir mais de 10 campos por especialista
|
| 28 |
2. SEMPRE exibir JSON parcial no prompt (context injection)
|
| 29 |
3. SEMPRE validar output com jsonschema
|
| 30 |
+
4. SEMPRE logar input + output (info)
|
| 31 |
5. NUNCA usar placeholders ou dados simulados
|
| 32 |
"""
|
| 33 |
|
|
|
|
| 63 |
self.max_retries = self.config.get('max_retries', 3)
|
| 64 |
self.retry_delay = self.config.get('retry_delay', 2)
|
| 65 |
|
| 66 |
+
print(f"✅ {self.name} (ID {self.id}) inicializado")
|
| 67 |
|
| 68 |
def _load_config(self, specialist_id: int, config_path: str) -> Dict[str, Any]:
|
| 69 |
"""Carrega configuração do especialista do YAML"""
|
|
|
|
| 112 |
Returns:
|
| 113 |
Resultado parcial (apenas os campos deste especialista)
|
| 114 |
"""
|
| 115 |
+
print(f"🤖 {self.name} processando...")
|
| 116 |
|
| 117 |
for attempt in range(self.max_retries):
|
| 118 |
try:
|
| 119 |
# 1. Construir prompt com context injection
|
| 120 |
prompt = self._build_prompt(input_data, context)
|
| 121 |
|
| 122 |
+
# 2. Log do prompt (info)
|
| 123 |
+
print(f" 📝 Prompt ({len(prompt)} chars): {prompt[:200]}...")
|
| 124 |
|
| 125 |
# 3. Chamar LLM
|
| 126 |
response = await self._call_llm(prompt)
|
|
|
|
| 137 |
continue # Retry
|
| 138 |
|
| 139 |
# 6. Log de sucesso
|
| 140 |
+
print(f" ✅ {self.name} completou: {len(result)} campos")
|
| 141 |
|
| 142 |
return result
|
| 143 |
|
core/context_builder.py
CHANGED
|
@@ -8,7 +8,7 @@ from typing import Dict, Any, Optional
|
|
| 8 |
|
| 9 |
from api.utils.logger import setup_logger
|
| 10 |
|
| 11 |
-
|
| 12 |
|
| 13 |
|
| 14 |
class ContextBuilder:
|
|
@@ -65,14 +65,14 @@ class ContextBuilder:
|
|
| 65 |
if field in current_result:
|
| 66 |
context[field] = current_result[field]
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
return context if context else None
|
| 71 |
|
| 72 |
def add_context_rule(self, specialist_id: int, fields: list):
|
| 73 |
"""Adiciona/modifica regra de contexto para um especialista"""
|
| 74 |
self.context_rules[specialist_id] = fields
|
| 75 |
-
|
| 76 |
|
| 77 |
def get_context_rules(self) -> Dict[int, list]:
|
| 78 |
"""Retorna todas as regras de contexto"""
|
|
|
|
| 8 |
|
| 9 |
from api.utils.logger import setup_logger
|
| 10 |
|
| 11 |
+
printr = setup_printr(__name__)
|
| 12 |
|
| 13 |
|
| 14 |
class ContextBuilder:
|
|
|
|
| 65 |
if field in current_result:
|
| 66 |
context[field] = current_result[field]
|
| 67 |
|
| 68 |
+
print(f"📦 Contexto para Especialista {specialist_id}: {list(context.keys())}")
|
| 69 |
|
| 70 |
return context if context else None
|
| 71 |
|
| 72 |
def add_context_rule(self, specialist_id: int, fields: list):
|
| 73 |
"""Adiciona/modifica regra de contexto para um especialista"""
|
| 74 |
self.context_rules[specialist_id] = fields
|
| 75 |
+
print(f"✅ Regra de contexto atualizada para Especialista {specialist_id}")
|
| 76 |
|
| 77 |
def get_context_rules(self) -> Dict[int, list]:
|
| 78 |
"""Retorna todas as regras de contexto"""
|
core/orchestrator.py
CHANGED
|
@@ -44,7 +44,7 @@ class PipelineOrchestrator:
|
|
| 44 |
# Organizar fases
|
| 45 |
self.phases = self._organize_phases()
|
| 46 |
|
| 47 |
-
|
| 48 |
f"✅ PipelineOrchestrator inicializado: "
|
| 49 |
f"{len(self.phases)} fases, {len(self.specialists)} especialistas"
|
| 50 |
)
|
|
@@ -94,7 +94,7 @@ class PipelineOrchestrator:
|
|
| 94 |
}
|
| 95 |
}
|
| 96 |
|
| 97 |
-
|
| 98 |
|
| 99 |
# Executar fases
|
| 100 |
fase_final = fase_final or len(self.phases)
|
|
@@ -105,7 +105,7 @@ class PipelineOrchestrator:
|
|
| 105 |
phase_name = phase['name']
|
| 106 |
is_parallel = phase.get('parallel', False)
|
| 107 |
|
| 108 |
-
|
| 109 |
|
| 110 |
try:
|
| 111 |
if is_parallel and len(phase.get('specialists', [])) > 1:
|
|
@@ -123,7 +123,7 @@ class PipelineOrchestrator:
|
|
| 123 |
input_data=acordao_bruto
|
| 124 |
)
|
| 125 |
|
| 126 |
-
|
| 127 |
|
| 128 |
except Exception as e:
|
| 129 |
logger.error(f"❌ Erro na FASE {phase_id} ({phase_name}): {e}")
|
|
@@ -141,7 +141,7 @@ class PipelineOrchestrator:
|
|
| 141 |
end_time = datetime.now()
|
| 142 |
resultado['metadados_processamento']['tempo_processamento_segundos'] = (end_time - start_time).total_seconds()
|
| 143 |
|
| 144 |
-
|
| 145 |
f"✅ Pipeline completa: {resultado['metadados_processamento']['tempo_processamento_segundos']:.2f}s"
|
| 146 |
)
|
| 147 |
|
|
@@ -168,7 +168,7 @@ class PipelineOrchestrator:
|
|
| 168 |
specialist_id=spec_id
|
| 169 |
)
|
| 170 |
|
| 171 |
-
|
| 172 |
|
| 173 |
# Executar especialista
|
| 174 |
try:
|
|
@@ -184,7 +184,7 @@ class PipelineOrchestrator:
|
|
| 184 |
campos_novos = list(partial_result.keys())
|
| 185 |
current_result['metadados_processamento']['campos_enriquecidos'].extend(campos_novos)
|
| 186 |
|
| 187 |
-
|
| 188 |
|
| 189 |
except Exception as e:
|
| 190 |
logger.error(f" ❌ Erro no Especialista {spec_id}: {e}")
|
|
@@ -215,7 +215,7 @@ class PipelineOrchestrator:
|
|
| 215 |
specialist_id=spec_id
|
| 216 |
)
|
| 217 |
|
| 218 |
-
|
| 219 |
|
| 220 |
# Criar tarefa async
|
| 221 |
task = specialist.process(input_data=input_data, context=context)
|
|
@@ -235,7 +235,7 @@ class PipelineOrchestrator:
|
|
| 235 |
campos_novos = list(result.keys())
|
| 236 |
current_result['metadados_processamento']['campos_enriquecidos'].extend(campos_novos)
|
| 237 |
|
| 238 |
-
|
| 239 |
|
| 240 |
return current_result
|
| 241 |
|
|
|
|
| 44 |
# Organizar fases
|
| 45 |
self.phases = self._organize_phases()
|
| 46 |
|
| 47 |
+
print(
|
| 48 |
f"✅ PipelineOrchestrator inicializado: "
|
| 49 |
f"{len(self.phases)} fases, {len(self.specialists)} especialistas"
|
| 50 |
)
|
|
|
|
| 94 |
}
|
| 95 |
}
|
| 96 |
|
| 97 |
+
print(f"🚀 Iniciando pipeline para acórdão ID {resultado['id_manifestacao']}")
|
| 98 |
|
| 99 |
# Executar fases
|
| 100 |
fase_final = fase_final or len(self.phases)
|
|
|
|
| 105 |
phase_name = phase['name']
|
| 106 |
is_parallel = phase.get('parallel', False)
|
| 107 |
|
| 108 |
+
print(f"📍 FASE {phase_id}: {phase_name} (parallel={is_parallel})")
|
| 109 |
|
| 110 |
try:
|
| 111 |
if is_parallel and len(phase.get('specialists', [])) > 1:
|
|
|
|
| 123 |
input_data=acordao_bruto
|
| 124 |
)
|
| 125 |
|
| 126 |
+
print(f"✅ FASE {phase_id} concluída")
|
| 127 |
|
| 128 |
except Exception as e:
|
| 129 |
logger.error(f"❌ Erro na FASE {phase_id} ({phase_name}): {e}")
|
|
|
|
| 141 |
end_time = datetime.now()
|
| 142 |
resultado['metadados_processamento']['tempo_processamento_segundos'] = (end_time - start_time).total_seconds()
|
| 143 |
|
| 144 |
+
print(
|
| 145 |
f"✅ Pipeline completa: {resultado['metadados_processamento']['tempo_processamento_segundos']:.2f}s"
|
| 146 |
)
|
| 147 |
|
|
|
|
| 168 |
specialist_id=spec_id
|
| 169 |
)
|
| 170 |
|
| 171 |
+
print(f" 🤖 Executando Especialista {spec_id}: {specialist.__class__.__name__}")
|
| 172 |
|
| 173 |
# Executar especialista
|
| 174 |
try:
|
|
|
|
| 184 |
campos_novos = list(partial_result.keys())
|
| 185 |
current_result['metadados_processamento']['campos_enriquecidos'].extend(campos_novos)
|
| 186 |
|
| 187 |
+
print(f" ✅ Especialista {spec_id} completou: {len(campos_novos)} campos")
|
| 188 |
|
| 189 |
except Exception as e:
|
| 190 |
logger.error(f" ❌ Erro no Especialista {spec_id}: {e}")
|
|
|
|
| 215 |
specialist_id=spec_id
|
| 216 |
)
|
| 217 |
|
| 218 |
+
print(f" 🤖 Agendando Especialista {spec_id} (paralelo)")
|
| 219 |
|
| 220 |
# Criar tarefa async
|
| 221 |
task = specialist.process(input_data=input_data, context=context)
|
|
|
|
| 235 |
campos_novos = list(result.keys())
|
| 236 |
current_result['metadados_processamento']['campos_enriquecidos'].extend(campos_novos)
|
| 237 |
|
| 238 |
+
print(f" ✅ Especialista {spec_id} completou: {len(campos_novos)} campos")
|
| 239 |
|
| 240 |
return current_result
|
| 241 |
|
core/specialist_wrapper.py
CHANGED
|
@@ -48,7 +48,7 @@ class SpecialistWrapper:
|
|
| 48 |
Returns:
|
| 49 |
Resultado do processador V13.1
|
| 50 |
"""
|
| 51 |
-
logger.
|
| 52 |
|
| 53 |
# ADAPTAÇÃO: V13.1 espera apenas acordao_data como argumento posicional
|
| 54 |
try:
|
|
@@ -57,7 +57,7 @@ class SpecialistWrapper:
|
|
| 57 |
|
| 58 |
# Processar resultado
|
| 59 |
if result:
|
| 60 |
-
logger.
|
| 61 |
return result
|
| 62 |
else:
|
| 63 |
logger.warning(f"⚠️ {self.name} retornou None")
|
|
|
|
| 48 |
Returns:
|
| 49 |
Resultado do processador V13.1
|
| 50 |
"""
|
| 51 |
+
logger.info(f"🔄 Wrapper adaptando chamada para {self.name}")
|
| 52 |
|
| 53 |
# ADAPTAÇÃO: V13.1 espera apenas acordao_data como argumento posicional
|
| 54 |
try:
|
|
|
|
| 57 |
|
| 58 |
# Processar resultado
|
| 59 |
if result:
|
| 60 |
+
logger.info(f"✅ {self.name} retornou resultado")
|
| 61 |
return result
|
| 62 |
else:
|
| 63 |
logger.warning(f"⚠️ {self.name} retornou None")
|
core/validator.py
CHANGED
|
@@ -108,7 +108,7 @@ class SchemaValidator:
|
|
| 108 |
partial_schema = json.load(f)
|
| 109 |
|
| 110 |
validate(instance=data, schema=partial_schema)
|
| 111 |
-
logger.
|
| 112 |
return True, []
|
| 113 |
|
| 114 |
except FileNotFoundError:
|
|
|
|
| 108 |
partial_schema = json.load(f)
|
| 109 |
|
| 110 |
validate(instance=data, schema=partial_schema)
|
| 111 |
+
logger.info(f"✅ Validação parcial ({partial_schema_path}): SUCESSO")
|
| 112 |
return True, []
|
| 113 |
|
| 114 |
except FileNotFoundError:
|
llm/clients/groq_client.py
CHANGED
|
@@ -29,7 +29,7 @@ class GroqClient:
|
|
| 29 |
|
| 30 |
self.base_url = "https://api.groq.com/openai/v1/chat/completions"
|
| 31 |
self.default_timeout = int(os.getenv('GROQ_TIMEOUT', '120'))
|
| 32 |
-
|
| 33 |
|
| 34 |
async def chat_completion(
|
| 35 |
self,
|
|
@@ -67,6 +67,9 @@ class GroqClient:
|
|
| 67 |
|
| 68 |
if max_tokens:
|
| 69 |
payload["max_tokens"] = max_tokens
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
if response_format:
|
| 72 |
payload["response_format"] = response_format
|
|
@@ -98,7 +101,7 @@ class GroqClient:
|
|
| 98 |
tokens_output = usage.get('completion_tokens', 0)
|
| 99 |
total_tokens = usage.get('total_tokens', tokens_input + tokens_output)
|
| 100 |
|
| 101 |
-
|
| 102 |
|
| 103 |
# Retorna dict simples (compatível com LLMManager)
|
| 104 |
return {
|
|
|
|
| 29 |
|
| 30 |
self.base_url = "https://api.groq.com/openai/v1/chat/completions"
|
| 31 |
self.default_timeout = int(os.getenv('GROQ_TIMEOUT', '120'))
|
| 32 |
+
print("✅ GroqClient inicializado (HTTP requests)")
|
| 33 |
|
| 34 |
async def chat_completion(
|
| 35 |
self,
|
|
|
|
| 67 |
|
| 68 |
if max_tokens:
|
| 69 |
payload["max_tokens"] = max_tokens
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
print(payload)
|
| 73 |
|
| 74 |
if response_format:
|
| 75 |
payload["response_format"] = response_format
|
|
|
|
| 101 |
tokens_output = usage.get('completion_tokens', 0)
|
| 102 |
total_tokens = usage.get('total_tokens', tokens_input + tokens_output)
|
| 103 |
|
| 104 |
+
print(f"✅ Groq response: {total_tokens} tokens, finish={finish_reason}")
|
| 105 |
|
| 106 |
# Retorna dict simples (compatível com LLMManager)
|
| 107 |
return {
|
requirements.txt
CHANGED
|
@@ -9,6 +9,7 @@ fastapi==0.109.0
|
|
| 9 |
uvicorn[standard]==0.27.0
|
| 10 |
python-multipart==0.0.6
|
| 11 |
requests
|
|
|
|
| 12 |
aiohttp
|
| 13 |
|
| 14 |
# Pydantic (validação)
|
|
|
|
| 9 |
uvicorn[standard]==0.27.0
|
| 10 |
python-multipart==0.0.6
|
| 11 |
requests
|
| 12 |
+
jsonschema
|
| 13 |
aiohttp
|
| 14 |
|
| 15 |
# Pydantic (validação)
|
schemas/protocolo_v13_6_schema.json
CHANGED
|
@@ -1,812 +1,246 @@
|
|
| 1 |
{
|
| 2 |
"$schema": "http://json-schema.org/draft-07/schema#",
|
| 3 |
-
"title": "Protocolo
|
| 4 |
-
"
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
"
|
| 8 |
-
"
|
| 9 |
-
"
|
| 10 |
-
"
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
-
"
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
},
|
| 22 |
-
"
|
| 23 |
-
"type": "
|
| 24 |
-
"
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
},
|
| 27 |
-
"
|
| 28 |
-
"
|
| 29 |
-
"description": "NOVO V13.6: Hashes SHA-256 para deduplicação e integridade",
|
| 30 |
-
"required": [
|
| 31 |
-
"hash_numero_processo",
|
| 32 |
-
"hash_ementa"
|
| 33 |
-
],
|
| 34 |
"properties": {
|
| 35 |
-
"
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
"description": "SHA-256 do número do processo principal"
|
| 39 |
-
},
|
| 40 |
-
"hash_ementa": {
|
| 41 |
-
"type": "string",
|
| 42 |
-
"pattern": "^[a-f0-9]{64}$",
|
| 43 |
-
"description": "SHA-256 do texto da ementa"
|
| 44 |
-
},
|
| 45 |
-
"hash_inteiro_teor": {
|
| 46 |
-
"type": [
|
| 47 |
-
"string",
|
| 48 |
-
"null"
|
| 49 |
-
],
|
| 50 |
-
"pattern": "^[a-f0-9]{64}$",
|
| 51 |
-
"description": "SHA-256 do inteiro teor (quando disponível)"
|
| 52 |
-
}
|
| 53 |
}
|
| 54 |
},
|
| 55 |
-
"
|
| 56 |
-
"
|
| 57 |
-
"description": "Metadados básicos da manifestação judicial",
|
| 58 |
-
"required": [
|
| 59 |
-
"tribunal",
|
| 60 |
-
"orgao_julgador",
|
| 61 |
-
"numeros_processo",
|
| 62 |
-
"data_julgamento"
|
| 63 |
-
],
|
| 64 |
"properties": {
|
| 65 |
-
"
|
| 66 |
-
"type": "string",
|
| 67 |
-
"const": "TJPR",
|
| 68 |
-
"description": "Tribunal de origem"
|
| 69 |
-
},
|
| 70 |
-
"orgao_julgador": {
|
| 71 |
-
"type": "string",
|
| 72 |
-
"description": "Câmara, Turma ou Órgão julgador"
|
| 73 |
-
},
|
| 74 |
-
"classe_processual": {
|
| 75 |
-
"type": "string",
|
| 76 |
-
"description": "Classe do processo"
|
| 77 |
-
},
|
| 78 |
-
"numeros_processo": {
|
| 79 |
"type": "array",
|
| 80 |
-
"
|
| 81 |
"minItems": 1,
|
| 82 |
-
"
|
| 83 |
-
"type": "string"
|
| 84 |
-
}
|
| 85 |
-
},
|
| 86 |
-
"relator": {
|
| 87 |
-
"type": "string",
|
| 88 |
-
"description": "Nome do relator"
|
| 89 |
-
},
|
| 90 |
-
"data_julgamento": {
|
| 91 |
-
"type": "string",
|
| 92 |
-
"format": "date",
|
| 93 |
-
"description": "Data do julgamento (YYYY-MM-DD)"
|
| 94 |
-
},
|
| 95 |
-
"data_publicacao": {
|
| 96 |
-
"type": [
|
| 97 |
-
"string",
|
| 98 |
-
"null"
|
| 99 |
-
],
|
| 100 |
-
"format": "date"
|
| 101 |
},
|
| 102 |
-
"
|
| 103 |
-
|
| 104 |
-
"string",
|
| 105 |
-
"null"
|
| 106 |
-
],
|
| 107 |
-
"format": "uri"
|
| 108 |
-
}
|
| 109 |
}
|
| 110 |
-
}
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
],
|
| 117 |
"properties": {
|
| 118 |
-
"
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
"relevancia_para_caso"
|
| 123 |
-
],
|
| 124 |
"properties": {
|
| 125 |
-
"
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
"Direito Processual Civil",
|
| 132 |
-
"Direito Processual Penal",
|
| 133 |
-
"Direito Tributário",
|
| 134 |
-
"Direito Administrativo",
|
| 135 |
-
"Direito de Família",
|
| 136 |
-
"Direito do Trabalho",
|
| 137 |
-
"Direito Empresarial",
|
| 138 |
-
"Direito Constitucional",
|
| 139 |
-
"Direito Ambiental",
|
| 140 |
-
"Outros"
|
| 141 |
-
]
|
| 142 |
-
},
|
| 143 |
-
"relevancia_para_caso": {
|
| 144 |
-
"type": "integer",
|
| 145 |
-
"minimum": 1,
|
| 146 |
-
"maximum": 100
|
| 147 |
-
}
|
| 148 |
}
|
| 149 |
},
|
| 150 |
-
"
|
| 151 |
-
"
|
| 152 |
-
"
|
| 153 |
-
"
|
| 154 |
-
|
| 155 |
-
"descricao": {
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
"
|
| 159 |
-
|
| 160 |
-
"
|
| 161 |
-
"maximum": 100
|
| 162 |
-
}
|
| 163 |
-
}
|
| 164 |
-
}
|
| 165 |
-
}
|
| 166 |
-
}
|
| 167 |
-
},
|
| 168 |
-
"RELATORIO": {
|
| 169 |
-
"type": "object",
|
| 170 |
-
"description": "Narrativa dos fatos e teses das partes",
|
| 171 |
-
"required": [
|
| 172 |
-
"teses_fragmentadas",
|
| 173 |
-
"etiquetas_relatorio"
|
| 174 |
-
],
|
| 175 |
-
"properties": {
|
| 176 |
-
"sintese_conectora_narrativa": {
|
| 177 |
-
"type": "string",
|
| 178 |
-
"maxLength": 80
|
| 179 |
-
},
|
| 180 |
-
"teses_fragmentadas": {
|
| 181 |
-
"type": "array",
|
| 182 |
-
"items": {
|
| 183 |
-
"type": "object",
|
| 184 |
-
"required": [
|
| 185 |
-
"parte",
|
| 186 |
-
"nucleo_logico_argumentativo"
|
| 187 |
-
],
|
| 188 |
-
"properties": {
|
| 189 |
-
"parte": {
|
| 190 |
-
"type": "string",
|
| 191 |
-
"enum": [
|
| 192 |
-
"autor",
|
| 193 |
-
"reu",
|
| 194 |
-
"recorrente",
|
| 195 |
-
"recorrido",
|
| 196 |
-
"apelante",
|
| 197 |
-
"apelado",
|
| 198 |
-
"agravante",
|
| 199 |
-
"agravado",
|
| 200 |
-
"ministerio_publico",
|
| 201 |
-
"terceiro_interessado"
|
| 202 |
-
]
|
| 203 |
-
},
|
| 204 |
-
"nucleo_logico_argumentativo": {
|
| 205 |
-
"type": "string",
|
| 206 |
-
"maxLength": 120
|
| 207 |
-
},
|
| 208 |
-
"peso_merito": {
|
| 209 |
-
"type": "integer",
|
| 210 |
-
"minimum": 0,
|
| 211 |
-
"maximum": 100
|
| 212 |
-
},
|
| 213 |
-
"elementos_factuais": {
|
| 214 |
-
"type": "array",
|
| 215 |
-
"items": {
|
| 216 |
-
"type": "string",
|
| 217 |
-
"maxLength": 80
|
| 218 |
-
}
|
| 219 |
-
},
|
| 220 |
-
"etiquetas_semanticas": {
|
| 221 |
-
"type": "array",
|
| 222 |
-
"items": {
|
| 223 |
-
"type": "string",
|
| 224 |
-
"pattern": "^#[a-z_]+$"
|
| 225 |
-
}
|
| 226 |
-
},
|
| 227 |
-
"correlacao_positiva": {
|
| 228 |
-
"type": [
|
| 229 |
-
"object",
|
| 230 |
-
"null"
|
| 231 |
-
],
|
| 232 |
-
"properties": {
|
| 233 |
-
"sintese_conectora": {
|
| 234 |
-
"type": "string",
|
| 235 |
-
"maxLength": 80
|
| 236 |
-
},
|
| 237 |
-
"etiquetas_ativadas": {
|
| 238 |
-
"type": "array",
|
| 239 |
-
"items": {
|
| 240 |
-
"type": "string"
|
| 241 |
-
}
|
| 242 |
-
}
|
| 243 |
-
}
|
| 244 |
-
},
|
| 245 |
-
"correlacao_negativa": {
|
| 246 |
-
"type": [
|
| 247 |
-
"object",
|
| 248 |
-
"null"
|
| 249 |
-
],
|
| 250 |
"properties": {
|
| 251 |
-
"
|
| 252 |
-
|
| 253 |
-
"maxLength": 80
|
| 254 |
-
},
|
| 255 |
-
"etiquetas_ativadas": {
|
| 256 |
-
"type": "array",
|
| 257 |
-
"items": {
|
| 258 |
-
"type": "string"
|
| 259 |
-
}
|
| 260 |
-
}
|
| 261 |
}
|
| 262 |
}
|
| 263 |
}
|
| 264 |
}
|
| 265 |
},
|
| 266 |
-
"
|
| 267 |
-
"
|
| 268 |
-
"
|
| 269 |
-
"
|
| 270 |
-
"
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
"type": "array",
|
| 287 |
-
"items": {
|
| 288 |
-
"type": "object",
|
| 289 |
-
"required": [
|
| 290 |
-
"nucleo_logico_argumentativo"
|
| 291 |
-
],
|
| 292 |
-
"properties": {
|
| 293 |
-
"nucleo_logico_argumentativo": {
|
| 294 |
-
"type": "string",
|
| 295 |
-
"maxLength": 120
|
| 296 |
-
},
|
| 297 |
-
"peso_merito": {
|
| 298 |
-
"type": "integer",
|
| 299 |
-
"minimum": 0,
|
| 300 |
-
"maximum": 100
|
| 301 |
-
},
|
| 302 |
-
"fundamentos_legal": {
|
| 303 |
-
"type": "array",
|
| 304 |
-
"items": {
|
| 305 |
-
"type": "object",
|
| 306 |
-
"required": [
|
| 307 |
-
"tipo",
|
| 308 |
-
"citacao_fonte"
|
| 309 |
-
],
|
| 310 |
-
"properties": {
|
| 311 |
-
"tipo": {
|
| 312 |
-
"type": "string",
|
| 313 |
-
"enum": [
|
| 314 |
-
"lei",
|
| 315 |
-
"jurisprudencia",
|
| 316 |
-
"principio",
|
| 317 |
-
"doutrina",
|
| 318 |
-
"sumula",
|
| 319 |
-
"entendimento_consolidado"
|
| 320 |
-
]
|
| 321 |
-
},
|
| 322 |
-
"citacao_fonte": {
|
| 323 |
-
"type": "string",
|
| 324 |
-
"maxLength": 200
|
| 325 |
-
},
|
| 326 |
-
"nucleo_logico": {
|
| 327 |
-
"type": "string",
|
| 328 |
-
"maxLength": 120
|
| 329 |
-
},
|
| 330 |
-
"resumo_transcricao": {
|
| 331 |
-
"type": [
|
| 332 |
-
"string",
|
| 333 |
-
"null"
|
| 334 |
-
]
|
| 335 |
-
}
|
| 336 |
-
}
|
| 337 |
-
}
|
| 338 |
-
},
|
| 339 |
-
"etiquetas_semanticas": {
|
| 340 |
-
"type": "array",
|
| 341 |
-
"items": {
|
| 342 |
-
"type": "string",
|
| 343 |
-
"pattern": "^#[a-z_]+$"
|
| 344 |
}
|
| 345 |
}
|
| 346 |
}
|
| 347 |
}
|
| 348 |
},
|
| 349 |
-
"
|
| 350 |
-
"
|
| 351 |
-
"items": {
|
| 352 |
-
"type": "string",
|
| 353 |
-
"pattern": "^#[a-z_]+$"
|
| 354 |
-
}
|
| 355 |
-
}
|
| 356 |
-
}
|
| 357 |
-
},
|
| 358 |
-
"DECISAO": {
|
| 359 |
-
"type": "object",
|
| 360 |
-
"required": [
|
| 361 |
-
"resultado",
|
| 362 |
-
"mapa_pedidos"
|
| 363 |
-
],
|
| 364 |
-
"properties": {
|
| 365 |
-
"resultado": {
|
| 366 |
-
"type": "string",
|
| 367 |
-
"enum": [
|
| 368 |
-
"PROVIDO",
|
| 369 |
-
"IMPROVIDO",
|
| 370 |
-
"PARCIALMENTE_PROVIDO",
|
| 371 |
-
"NAO_CONHECIDO",
|
| 372 |
-
"EXTINTO_SEM_RESOLUCAO_MERITO",
|
| 373 |
-
"PREJUDICADO",
|
| 374 |
-
"DESISTENCIA_HOMOLOGADA"
|
| 375 |
-
]
|
| 376 |
-
},
|
| 377 |
-
"sintese_decisao": {
|
| 378 |
-
"type": "string",
|
| 379 |
-
"maxLength": 80
|
| 380 |
-
},
|
| 381 |
-
"mapa_pedidos": {
|
| 382 |
-
"type": "array",
|
| 383 |
-
"items": {
|
| 384 |
-
"type": "object",
|
| 385 |
-
"required": [
|
| 386 |
-
"pedido",
|
| 387 |
-
"parte"
|
| 388 |
-
],
|
| 389 |
-
"properties": {
|
| 390 |
-
"pedido": {
|
| 391 |
-
"type": "string"
|
| 392 |
-
},
|
| 393 |
-
"parte": {
|
| 394 |
-
"type": "string"
|
| 395 |
-
},
|
| 396 |
-
"foi_conhecido": {
|
| 397 |
-
"type": "boolean"
|
| 398 |
-
},
|
| 399 |
-
"resultado_pedido": {
|
| 400 |
-
"type": [
|
| 401 |
-
"string",
|
| 402 |
-
"null"
|
| 403 |
-
],
|
| 404 |
-
"enum": [
|
| 405 |
-
"deferido",
|
| 406 |
-
"indeferido",
|
| 407 |
-
"parcialmente_deferido",
|
| 408 |
-
"nao_conhecido",
|
| 409 |
-
null
|
| 410 |
-
]
|
| 411 |
-
},
|
| 412 |
-
"valor_pedido": {
|
| 413 |
-
"type": [
|
| 414 |
-
"number",
|
| 415 |
-
"null"
|
| 416 |
-
]
|
| 417 |
-
},
|
| 418 |
-
"valor_concedido": {
|
| 419 |
-
"type": [
|
| 420 |
-
"number",
|
| 421 |
-
"null"
|
| 422 |
-
]
|
| 423 |
-
},
|
| 424 |
-
"fundamento_decisivo": {
|
| 425 |
-
"type": [
|
| 426 |
-
"string",
|
| 427 |
-
"null"
|
| 428 |
-
],
|
| 429 |
-
"maxLength": 120
|
| 430 |
-
}
|
| 431 |
-
}
|
| 432 |
-
}
|
| 433 |
-
},
|
| 434 |
-
"etiquetas_decisao": {
|
| 435 |
-
"type": "array",
|
| 436 |
-
"items": {
|
| 437 |
-
"type": "string",
|
| 438 |
-
"pattern": "^#[a-z_]+$"
|
| 439 |
-
}
|
| 440 |
-
},
|
| 441 |
-
"votacao": {
|
| 442 |
-
"type": [
|
| 443 |
-
"object",
|
| 444 |
-
"null"
|
| 445 |
-
],
|
| 446 |
"properties": {
|
| 447 |
-
"
|
| 448 |
-
"type": "
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
"minimum": 0
|
| 453 |
-
},
|
| 454 |
-
"votos_contrarios": {
|
| 455 |
-
"type": "integer",
|
| 456 |
-
"minimum": 0
|
| 457 |
-
},
|
| 458 |
-
"voto_vencido": {
|
| 459 |
-
"type": [
|
| 460 |
-
"string",
|
| 461 |
-
"null"
|
| 462 |
-
]
|
| 463 |
-
}
|
| 464 |
-
}
|
| 465 |
-
}
|
| 466 |
-
}
|
| 467 |
-
},
|
| 468 |
-
"analise_arquivista": {
|
| 469 |
-
"type": "object",
|
| 470 |
-
"description": "Análise meta-cognitiva da manifestação pelo LLM",
|
| 471 |
-
"required": [
|
| 472 |
-
"grau_confianca"
|
| 473 |
-
],
|
| 474 |
-
"properties": {
|
| 475 |
-
"grau_confianca": {
|
| 476 |
-
"type": "string",
|
| 477 |
-
"enum": [
|
| 478 |
-
"alta",
|
| 479 |
-
"media",
|
| 480 |
-
"baixa",
|
| 481 |
-
"muito_baixa"
|
| 482 |
-
]
|
| 483 |
-
},
|
| 484 |
-
"justificativa_confianca": {
|
| 485 |
-
"type": [
|
| 486 |
-
"string",
|
| 487 |
-
"null"
|
| 488 |
-
]
|
| 489 |
-
},
|
| 490 |
-
"partes": {
|
| 491 |
-
"type": "array",
|
| 492 |
-
"description": "NOVO V13.6: Análise dialética expandida (incorpora V11)",
|
| 493 |
-
"items": {
|
| 494 |
-
"type": "object",
|
| 495 |
-
"required": [
|
| 496 |
-
"parte"
|
| 497 |
-
],
|
| 498 |
-
"properties": {
|
| 499 |
-
"parte": {
|
| 500 |
-
"type": "string"
|
| 501 |
-
},
|
| 502 |
-
"arquetipo_simbolico_carl_young": {
|
| 503 |
-
"type": "array",
|
| 504 |
-
"items": {
|
| 505 |
-
"type": "string",
|
| 506 |
-
"enum": [
|
| 507 |
-
"#heroi",
|
| 508 |
-
"#inocente",
|
| 509 |
-
"#sabio",
|
| 510 |
-
"#explorador",
|
| 511 |
-
"#rebelde",
|
| 512 |
-
"#mago",
|
| 513 |
-
"#amante",
|
| 514 |
-
"#bobo",
|
| 515 |
-
"#cuidador",
|
| 516 |
-
"#criador",
|
| 517 |
-
"#governante",
|
| 518 |
-
"#humorista"
|
| 519 |
-
]
|
| 520 |
-
}
|
| 521 |
-
},
|
| 522 |
-
"resumo_positivo": {
|
| 523 |
-
"type": [
|
| 524 |
-
"object",
|
| 525 |
-
"null"
|
| 526 |
-
],
|
| 527 |
"properties": {
|
| 528 |
-
"
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
},
|
| 532 |
-
"
|
|
|
|
| 533 |
"type": "array",
|
|
|
|
| 534 |
"items": {
|
| 535 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 536 |
}
|
| 537 |
},
|
| 538 |
-
"
|
| 539 |
-
"type": [
|
| 540 |
-
"string",
|
| 541 |
-
"null"
|
| 542 |
-
],
|
| 543 |
-
"description": "NOVO V13.6: do V11"
|
| 544 |
-
}
|
| 545 |
-
}
|
| 546 |
-
},
|
| 547 |
-
"resumo_negativo": {
|
| 548 |
-
"type": [
|
| 549 |
-
"object",
|
| 550 |
-
"null"
|
| 551 |
-
],
|
| 552 |
-
"properties": {
|
| 553 |
-
"sintese_conectora": {
|
| 554 |
-
"type": "string",
|
| 555 |
-
"maxLength": 80
|
| 556 |
-
},
|
| 557 |
-
"etiquetas_ativadas": {
|
| 558 |
"type": "array",
|
|
|
|
| 559 |
"items": {
|
| 560 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 561 |
}
|
| 562 |
},
|
| 563 |
-
"
|
| 564 |
-
"
|
| 565 |
-
|
| 566 |
-
"
|
| 567 |
-
|
| 568 |
-
|
|
|
|
|
|
|
| 569 |
}
|
| 570 |
}
|
| 571 |
}
|
| 572 |
-
}
|
| 573 |
-
}
|
| 574 |
-
},
|
| 575 |
-
"complexidade_caso": {
|
| 576 |
-
"type": [
|
| 577 |
-
"string",
|
| 578 |
-
"null"
|
| 579 |
-
],
|
| 580 |
-
"enum": [
|
| 581 |
-
"baixa",
|
| 582 |
-
"media",
|
| 583 |
-
"alta",
|
| 584 |
-
"muito_alta",
|
| 585 |
-
null
|
| 586 |
-
]
|
| 587 |
-
},
|
| 588 |
-
"relevancia_jurisprudencial": {
|
| 589 |
-
"type": [
|
| 590 |
-
"string",
|
| 591 |
-
"null"
|
| 592 |
-
],
|
| 593 |
-
"enum": [
|
| 594 |
-
"baixa",
|
| 595 |
-
"media",
|
| 596 |
-
"alta",
|
| 597 |
-
"leading_case",
|
| 598 |
-
null
|
| 599 |
-
]
|
| 600 |
-
},
|
| 601 |
-
"alertas_qualidade": {
|
| 602 |
-
"type": "array",
|
| 603 |
-
"items": {
|
| 604 |
-
"type": "string",
|
| 605 |
-
"enum": [
|
| 606 |
-
"texto_incompleto",
|
| 607 |
-
"citacoes_imprecisas",
|
| 608 |
-
"inconsistencia_logica",
|
| 609 |
-
"falta_fundamentacao",
|
| 610 |
-
"erro_processual",
|
| 611 |
-
"contradicao_interna"
|
| 612 |
-
]
|
| 613 |
-
}
|
| 614 |
-
}
|
| 615 |
-
}
|
| 616 |
-
},
|
| 617 |
-
"secoes_originais": {
|
| 618 |
-
"type": "object",
|
| 619 |
-
"description": "NOVO V13.6: Preservação de textos completos originais (para embeddings/RAG)",
|
| 620 |
-
"properties": {
|
| 621 |
-
"ementa": {
|
| 622 |
-
"type": [
|
| 623 |
-
"string",
|
| 624 |
-
"null"
|
| 625 |
-
]
|
| 626 |
-
},
|
| 627 |
-
"RELATORIO_texto_completo": {
|
| 628 |
-
"type": [
|
| 629 |
-
"string",
|
| 630 |
-
"null"
|
| 631 |
-
]
|
| 632 |
-
},
|
| 633 |
-
"FUNDAMENTACAO_texto_completo": {
|
| 634 |
-
"type": [
|
| 635 |
-
"string",
|
| 636 |
-
"null"
|
| 637 |
-
]
|
| 638 |
-
},
|
| 639 |
-
"DISPOSITIVO_texto_completo": {
|
| 640 |
-
"type": [
|
| 641 |
-
"string",
|
| 642 |
-
"null"
|
| 643 |
-
]
|
| 644 |
-
},
|
| 645 |
-
"inteiro_teor_bruto": {
|
| 646 |
-
"type": [
|
| 647 |
-
"string",
|
| 648 |
-
"null"
|
| 649 |
-
]
|
| 650 |
-
}
|
| 651 |
-
}
|
| 652 |
-
},
|
| 653 |
-
"metadados_processamento": {
|
| 654 |
-
"type": "object",
|
| 655 |
-
"description": "NOVO V13.6: Metadados sobre o processamento deste registro",
|
| 656 |
-
"required": [
|
| 657 |
-
"protocolo_origem",
|
| 658 |
-
"data_processamento"
|
| 659 |
-
],
|
| 660 |
-
"properties": {
|
| 661 |
-
"protocolo_origem": {
|
| 662 |
-
"type": "string",
|
| 663 |
-
"enum": [
|
| 664 |
-
"v11",
|
| 665 |
-
"v13.5",
|
| 666 |
-
"v13.6",
|
| 667 |
-
"v11_merged_v13.5"
|
| 668 |
-
]
|
| 669 |
-
},
|
| 670 |
-
"data_processamento": {
|
| 671 |
-
"type": "string",
|
| 672 |
-
"format": "date-time"
|
| 673 |
-
},
|
| 674 |
-
"versao_preprocessador": {
|
| 675 |
-
"type": [
|
| 676 |
-
"string",
|
| 677 |
-
"null"
|
| 678 |
-
]
|
| 679 |
-
},
|
| 680 |
-
"modelo_llm_utilizado": {
|
| 681 |
-
"type": [
|
| 682 |
-
"string",
|
| 683 |
-
"null"
|
| 684 |
-
]
|
| 685 |
-
},
|
| 686 |
-
"inteiro_teor_estruturado": {
|
| 687 |
-
"type": "boolean"
|
| 688 |
-
},
|
| 689 |
-
"confianca_estruturacao": {
|
| 690 |
-
"type": [
|
| 691 |
-
"number",
|
| 692 |
-
"null"
|
| 693 |
-
],
|
| 694 |
-
"minimum": 0.0,
|
| 695 |
-
"maximum": 1.0
|
| 696 |
-
},
|
| 697 |
-
"campos_enriquecidos": {
|
| 698 |
-
"type": "array",
|
| 699 |
-
"items": {
|
| 700 |
-
"type": "string"
|
| 701 |
-
}
|
| 702 |
-
},
|
| 703 |
-
"tempo_processamento_segundos": {
|
| 704 |
-
"type": [
|
| 705 |
-
"number",
|
| 706 |
-
"null"
|
| 707 |
-
]
|
| 708 |
-
},
|
| 709 |
-
"custo_tokens": {
|
| 710 |
-
"type": [
|
| 711 |
-
"object",
|
| 712 |
-
"null"
|
| 713 |
-
],
|
| 714 |
-
"properties": {
|
| 715 |
-
"input_tokens": {
|
| 716 |
-
"type": "integer"
|
| 717 |
-
},
|
| 718 |
-
"output_tokens": {
|
| 719 |
-
"type": "integer"
|
| 720 |
},
|
| 721 |
-
"
|
| 722 |
-
"type": "integer"
|
| 723 |
-
}
|
| 724 |
}
|
| 725 |
-
}
|
| 726 |
-
}
|
| 727 |
-
},
|
| 728 |
-
"campos_futuros": {
|
| 729 |
-
"type": "object",
|
| 730 |
-
"description": "Campos reservados para preenchimento em fases posteriores",
|
| 731 |
-
"properties": {
|
| 732 |
-
"relatorio_transcript_exato": {
|
| 733 |
-
"type": [
|
| 734 |
-
"string",
|
| 735 |
-
"null"
|
| 736 |
-
]
|
| 737 |
-
},
|
| 738 |
-
"fundamentacao_transcript_exato": {
|
| 739 |
-
"type": [
|
| 740 |
-
"string",
|
| 741 |
-
"null"
|
| 742 |
-
]
|
| 743 |
-
},
|
| 744 |
-
"dispositivo_transcript_exato": {
|
| 745 |
-
"type": [
|
| 746 |
-
"string",
|
| 747 |
-
"null"
|
| 748 |
-
]
|
| 749 |
},
|
| 750 |
-
"
|
| 751 |
-
"
|
| 752 |
-
"object",
|
| 753 |
-
"null"
|
| 754 |
-
],
|
| 755 |
"properties": {
|
| 756 |
-
"
|
| 757 |
-
|
| 758 |
-
|
| 759 |
-
|
| 760 |
-
|
| 761 |
-
|
| 762 |
-
|
| 763 |
-
|
| 764 |
-
|
| 765 |
-
|
| 766 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 767 |
},
|
| 768 |
-
"
|
| 769 |
-
|
| 770 |
-
|
| 771 |
-
|
| 772 |
-
|
| 773 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 774 |
}
|
| 775 |
}
|
| 776 |
},
|
| 777 |
-
"
|
| 778 |
-
"
|
| 779 |
-
|
| 780 |
-
"
|
| 781 |
-
|
| 782 |
-
|
| 783 |
-
|
| 784 |
-
|
| 785 |
-
|
| 786 |
-
|
| 787 |
-
"type": "string",
|
| 788 |
-
"enum": [
|
| 789 |
-
"relatorio",
|
| 790 |
-
"fundamentacao",
|
| 791 |
-
"dispositivo",
|
| 792 |
-
"arquivista",
|
| 793 |
-
"ementa"
|
| 794 |
]
|
| 795 |
-
}
|
| 796 |
-
|
| 797 |
-
|
| 798 |
-
|
| 799 |
-
|
| 800 |
-
|
| 801 |
-
|
| 802 |
-
|
| 803 |
-
|
| 804 |
-
|
| 805 |
-
|
| 806 |
-
|
| 807 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 808 |
}
|
| 809 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 810 |
}
|
| 811 |
}
|
| 812 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"$schema": "http://json-schema.org/draft-07/schema#",
|
| 3 |
+
"title": "Protocolo v13.5 - Extração Jurisprudencial TJPR",
|
| 4 |
+
"definitions": {
|
| 5 |
+
"etiqueta": {"type": "string", "pattern": "^#[a-z_]+$"},
|
| 6 |
+
"tags_7": {"type": "array", "items": {"$ref": "#/definitions/etiqueta"}, "minItems": 1, "maxItems": 7},
|
| 7 |
+
"tags_10": {"type": "array", "items": {"$ref": "#/definitions/etiqueta"}, "minItems": 1, "maxItems": 10},
|
| 8 |
+
"tags_3": {"type": "array", "items": {"$ref": "#/definitions/etiqueta"}, "minItems": 3, "maxItems": 7},
|
| 9 |
+
"str_120": {"type": "string", "maxLength": 120},
|
| 10 |
+
"str_80": {"type": "string", "maxLength": 80},
|
| 11 |
+
"str_60": {"type": "string", "maxLength": 60},
|
| 12 |
+
"parte": {"type": "string", "enum": ["autor", "reu", "recorrente", "recorrido", "terceiro", "ministerio_publico"]},
|
| 13 |
+
"peso": {"type": "integer", "minimum": 0, "maximum": 100},
|
| 14 |
+
"nivel": {"type": "string", "enum": ["alta", "media", "baixa"]},
|
| 15 |
+
"correlacao": {
|
| 16 |
+
"required": ["sintese_argumento", "tags_conectivas"],
|
| 17 |
+
"properties": {
|
| 18 |
+
"sintese_argumento": {"type": "string"},
|
| 19 |
+
"tags_conectivas": {"$ref": "#/definitions/tags_3"}
|
| 20 |
+
}
|
| 21 |
},
|
| 22 |
+
"provas": {
|
| 23 |
+
"type": "array",
|
| 24 |
+
"items": {
|
| 25 |
+
"required": ["descricao", "existe", "tipo_prova"],
|
| 26 |
+
"properties": {
|
| 27 |
+
"descricao": {"type": "string"},
|
| 28 |
+
"existe": {"type": "boolean"},
|
| 29 |
+
"tipo_prova": {"type": ["string", "null"], "enum": ["documental", "testemunhal", "pericial", "admissao", null]}
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
},
|
| 33 |
+
"resumo": {
|
| 34 |
+
"required": ["sintese_conectora", "etiquetas_ativadas", "texto_completo"],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
"properties": {
|
| 36 |
+
"sintese_conectora": {"$ref": "#/definitions/str_80"},
|
| 37 |
+
"etiquetas_ativadas": {"$ref": "#/definitions/tags_7"},
|
| 38 |
+
"texto_completo": {"type": "string", "minLength": 200}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
}
|
| 40 |
},
|
| 41 |
+
"analise": {
|
| 42 |
+
"required": ["arquetipo_simbolico_carl_young", "resumo_positivo", "resumo_negativo"],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
"properties": {
|
| 44 |
+
"arquetipo_simbolico_carl_young": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
"type": "array",
|
| 46 |
+
"items": {"$ref": "#/definitions/etiqueta"},
|
| 47 |
"minItems": 1,
|
| 48 |
+
"maxItems": 3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
},
|
| 50 |
+
"resumo_positivo": {"$ref": "#/definitions/resumo"},
|
| 51 |
+
"resumo_negativo": {"$ref": "#/definitions/resumo"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
}
|
| 53 |
+
}
|
| 54 |
+
},
|
| 55 |
+
"required": ["manifestacoes_autos"],
|
| 56 |
+
"properties": {
|
| 57 |
+
"manifestacoes_autos": {
|
| 58 |
+
"required": ["id_manifestacao", "data_extracao", "metadados", "classificacao_tematica", "RELATORIO", "FUNDAMENTACAO", "DECISAO", "analise_arquivista"],
|
|
|
|
| 59 |
"properties": {
|
| 60 |
+
"id_manifestacao": {"type": "integer", "minimum": 1},
|
| 61 |
+
"data_extracao": {"type": "string", "format": "date-time"},
|
| 62 |
+
"metadados": {
|
| 63 |
+
"required": ["tribunal", "orgao_julgador", "classe_processual", "numeros_processo", "relator", "data_julgamento"],
|
|
|
|
|
|
|
| 64 |
"properties": {
|
| 65 |
+
"tribunal": {"type": ["string", "null"]},
|
| 66 |
+
"orgao_julgador": {"type": ["string", "null"]},
|
| 67 |
+
"classe_processual": {"type": ["string", "null"]},
|
| 68 |
+
"numeros_processo": {"type": "array", "items": {"type": "string"}, "minItems": 1},
|
| 69 |
+
"relator": {"type": ["string", "null"]},
|
| 70 |
+
"data_julgamento": {"type": ["string", "null"], "format": "date"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
}
|
| 72 |
},
|
| 73 |
+
"classificacao_tematica": {
|
| 74 |
+
"required": ["RAMO_EXPECIALIZACAO_DIREITO", "ramos_secundarios"],
|
| 75 |
+
"properties": {
|
| 76 |
+
"RAMO_EXPECIALIZACAO_DIREITO": {
|
| 77 |
+
"required": ["descricao"],
|
| 78 |
+
"properties": {"descricao": {"type": "string"}}
|
| 79 |
+
},
|
| 80 |
+
"ramos_secundarios": {
|
| 81 |
+
"type": "array",
|
| 82 |
+
"items": {
|
| 83 |
+
"required": ["descricao", "relevancia"],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
"properties": {
|
| 85 |
+
"descricao": {"type": "string"},
|
| 86 |
+
"relevancia": {"$ref": "#/definitions/nivel"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
}
|
| 88 |
}
|
| 89 |
}
|
| 90 |
}
|
| 91 |
},
|
| 92 |
+
"RELATORIO": {
|
| 93 |
+
"required": ["Sintaxe_logica_argumentativa", "etiquetas_relatorio", "teses_fragmentadas"],
|
| 94 |
+
"properties": {
|
| 95 |
+
"Sintaxe_logica_argumentativa": {"$ref": "#/definitions/str_120"},
|
| 96 |
+
"etiquetas_relatorio": {"$ref": "#/definitions/tags_10"},
|
| 97 |
+
"teses_fragmentadas": {
|
| 98 |
+
"type": "array",
|
| 99 |
+
"minItems": 1,
|
| 100 |
+
"items": {
|
| 101 |
+
"required": ["parte", "nucleo_logico_argumentativo", "etiquetas_semanticas", "correlacao_positiva", "correlacao_negativa", "elementos_factuais", "peso_merito", "confianca_llm"],
|
| 102 |
+
"properties": {
|
| 103 |
+
"parte": {"$ref": "#/definitions/parte"},
|
| 104 |
+
"nucleo_logico_argumentativo": {"$ref": "#/definitions/str_120"},
|
| 105 |
+
"etiquetas_semanticas": {"$ref": "#/definitions/tags_7"},
|
| 106 |
+
"correlacao_positiva": {"$ref": "#/definitions/correlacao"},
|
| 107 |
+
"correlacao_negativa": {"$ref": "#/definitions/correlacao"},
|
| 108 |
+
"elementos_factuais": {"$ref": "#/definitions/provas"},
|
| 109 |
+
"contra_argumentos": {"type": "array", "items": {"$ref": "#/definitions/str_120"}},
|
| 110 |
+
"peso_merito": {"$ref": "#/definitions/peso"},
|
| 111 |
+
"confianca_llm": {"$ref": "#/definitions/peso"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
}
|
| 113 |
}
|
| 114 |
}
|
| 115 |
}
|
| 116 |
},
|
| 117 |
+
"FUNDAMENTACAO": {
|
| 118 |
+
"required": ["teses_relator", "temas_nao_conhecidos_omitidos"],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
"properties": {
|
| 120 |
+
"teses_relator": {
|
| 121 |
+
"type": "array",
|
| 122 |
+
"minItems": 1,
|
| 123 |
+
"items": {
|
| 124 |
+
"required": ["Sintaxe_logica_argumentativa", "etiquetas_relatorio", "nucleo_logico_argumentativo", "etiquetas_semanticas", "correlacao_positiva", "correlacao_negativa", "elementos_factuais", "fundamentos_legal", "causalidade_merito", "relacao_com_tese_relatorio"],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
"properties": {
|
| 126 |
+
"nucleo_logico_argumentativo": {"$ref": "#/definitions/str_120"},
|
| 127 |
+
"etiquetas_semanticas": {"$ref": "#/definitions/tags_7"},
|
| 128 |
+
"correlacao_positiva": {"$ref": "#/definitions/correlacao"},
|
| 129 |
+
"correlacao_negativa": {"$ref": "#/definitions/correlacao"},
|
| 130 |
+
"elementos_factuais": {"$ref": "#/definitions/provas"},
|
| 131 |
+
"fundamentos_legal": {
|
| 132 |
"type": "array",
|
| 133 |
+
"minItems": 1,
|
| 134 |
"items": {
|
| 135 |
+
"required": ["tipo", "nucleo_logico_argumentativo", "etiquetas_semanticas", "citacao_fonte", "resumo_transcricao"],
|
| 136 |
+
"properties": {
|
| 137 |
+
"tipo": {"type": "string", "enum": ["lei", "principio", "jurisprudencia", "entendimento", "prova", "indicacao"]},
|
| 138 |
+
"nucleo_logico_argumentativo": {"$ref": "#/definitions/str_120"},
|
| 139 |
+
"etiquetas_semanticas": {"$ref": "#/definitions/tags_7"},
|
| 140 |
+
"citacao_fonte": {"type": ["string", "null"]},
|
| 141 |
+
"resumo_transcricao": {"type": "string"}
|
| 142 |
+
}
|
| 143 |
}
|
| 144 |
},
|
| 145 |
+
"causalidade_merito": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
"type": "array",
|
| 147 |
+
"minItems": 1,
|
| 148 |
"items": {
|
| 149 |
+
"required": ["resultado", "nucleo_logico", "etiquetas_semanticas"],
|
| 150 |
+
"properties": {
|
| 151 |
+
"resultado": {"type": "string", "enum": ["deferir", "indeferir"]},
|
| 152 |
+
"nucleo_logico": {"$ref": "#/definitions/str_60"},
|
| 153 |
+
"etiquetas_semanticas": {"$ref": "#/definitions/tags_7"}
|
| 154 |
+
}
|
| 155 |
}
|
| 156 |
},
|
| 157 |
+
"relacao_com_tese_relatorio": {
|
| 158 |
+
"required": ["parte", "nucleo_argumento_acolhido", "etiquetas_argumento", "juntou_prova"],
|
| 159 |
+
"properties": {
|
| 160 |
+
"parte": {"$ref": "#/definitions/parte"},
|
| 161 |
+
"nucleo_argumento_acolhido": {"type": "string"},
|
| 162 |
+
"etiquetas_argumento": {"$ref": "#/definitions/tags_7"},
|
| 163 |
+
"juntou_prova": {"type": "boolean"}
|
| 164 |
+
}
|
| 165 |
}
|
| 166 |
}
|
| 167 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
},
|
| 169 |
+
"temas_nao_conhecidos_omitidos": {"type": "array", "items": {"$ref": "#/definitions/str_120"}}
|
|
|
|
|
|
|
| 170 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
},
|
| 172 |
+
"DECISAO": {
|
| 173 |
+
"required": ["resultado", "mapa_pedidos_resultado", "fundamentos_decisivos", "causalidade_decisao", "valores_condenacao"],
|
|
|
|
|
|
|
|
|
|
| 174 |
"properties": {
|
| 175 |
+
"resultado": {"type": "string", "enum": ["PROVIDO", "PARCIALMENTE_PROVIDO", "IMPROVIDO", "EXTINTO", "ANULADO", "NAO_CONHECIDO"]},
|
| 176 |
+
"mapa_pedidos_resultado": {
|
| 177 |
+
"type": "array",
|
| 178 |
+
"minItems": 1,
|
| 179 |
+
"items": {
|
| 180 |
+
"required": ["pedido", "parte", "etiquetas_pedido", "foi_conhecido", "resultado_pedido", "valor_pedido", "valor_concedido", "fundamento_decisivo", "etiquetas_fundamento", "observacao"],
|
| 181 |
+
"properties": {
|
| 182 |
+
"pedido": {"type": "string"},
|
| 183 |
+
"parte": {"$ref": "#/definitions/parte"},
|
| 184 |
+
"etiquetas_pedido": {"$ref": "#/definitions/tags_7"},
|
| 185 |
+
"foi_conhecido": {"type": "boolean"},
|
| 186 |
+
"resultado_pedido": {"type": "string", "enum": ["deferido", "deferido_parcialmente", "indeferido", "nao_conhecido"]},
|
| 187 |
+
"fundamento_decisivo": {"type": ["string", "null"]},
|
| 188 |
+
"etiquetas_fundamento": {"type": "array", "items": {"$ref": "#/definitions/etiqueta"}},
|
| 189 |
+
"observacao": {"type": ["string", "null"]}
|
| 190 |
+
}
|
| 191 |
+
}
|
| 192 |
},
|
| 193 |
+
"fundamentos_decisivos": {"type": "array", "items": {"type": "string"}, "minItems": 1, "maxItems": 5},
|
| 194 |
+
"causalidade_decisao": {
|
| 195 |
+
"type": "array",
|
| 196 |
+
"items": {
|
| 197 |
+
"required": ["resultado", "nucleo_logico", "etiquetas_semanticas"],
|
| 198 |
+
"properties": {
|
| 199 |
+
"resultado": {"type": "string", "enum": ["PROVIDO_PARCIALMENTE", "MODIFICADO", "ADEQUADO", "MANTIDO", "NAO_PROVIDO"]},
|
| 200 |
+
"nucleo_logico": {"$ref": "#/definitions/str_120"},
|
| 201 |
+
"etiquetas_semanticas": {"$ref": "#/definitions/tags_7"}
|
| 202 |
+
}
|
| 203 |
+
}
|
| 204 |
}
|
| 205 |
}
|
| 206 |
},
|
| 207 |
+
"analise_arquivista": {
|
| 208 |
+
"required": ["partes", "relator", "decisao", "grau_confianca", "analise_omissoes", "consistencia_logica", "adequacao_precedentes"],
|
| 209 |
+
"properties": {
|
| 210 |
+
"partes": {
|
| 211 |
+
"type": "array",
|
| 212 |
+
"minItems": 1,
|
| 213 |
+
"items": {
|
| 214 |
+
"allOf": [
|
| 215 |
+
{"$ref": "#/definitions/analise"},
|
| 216 |
+
{"required": ["parte"], "properties": {"parte": {"type": "string"}}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
]
|
| 218 |
+
}
|
| 219 |
+
},
|
| 220 |
+
"relator": {"$ref": "#/definitions/analise"},
|
| 221 |
+
"decisao": {"$ref": "#/definitions/analise"},
|
| 222 |
+
"grau_confianca": {"$ref": "#/definitions/nivel"},
|
| 223 |
+
"analise_omissoes": {
|
| 224 |
+
"type": "array",
|
| 225 |
+
"items": {
|
| 226 |
+
"required": ["descricao", "nucleo_pedido_omitido", "etiquetas_omissao", "tipo_omissao", "peso_confiabilidade_llm", "influencia_merito", "risco_recurso"],
|
| 227 |
+
"properties": {
|
| 228 |
+
"descricao": {"type": "string"},
|
| 229 |
+
"nucleo_pedido_omitido": {"$ref": "#/definitions/str_60"},
|
| 230 |
+
"etiquetas_omissao": {"$ref": "#/definitions/tags_7"},
|
| 231 |
+
"tipo_omissao": {"type": "string", "enum": ["silencio_total", "fundamentacao_generica", "contradicao"]},
|
| 232 |
+
"peso_confiabilidade_llm": {"$ref": "#/definitions/peso"},
|
| 233 |
+
"influencia_merito": {"$ref": "#/definitions/nivel"},
|
| 234 |
+
"risco_recurso": {"type": "string", "enum": ["alto", "medio", "baixo"]}
|
| 235 |
}
|
| 236 |
}
|
| 237 |
+
},
|
| 238 |
+
"consistencia_logica": {
|
| 239 |
+
"required": ["coerente", "contradicoes_detectadas"],
|
| 240 |
+
"properties": {
|
| 241 |
+
"coerente": {"type": "boolean"},
|
| 242 |
+
"contradicoes_detectadas": {"type": "array", "items": {"type": "string"}}
|
| 243 |
+
}
|
| 244 |
}
|
| 245 |
}
|
| 246 |
}
|