Feat: Arquivos para regras/min doc

This commit is contained in:
2026-03-12 15:40:55 -03:00
parent 8c3c23c65f
commit 63a6d1b308
2 changed files with 410 additions and 9 deletions

View File

@@ -5,9 +5,9 @@ This agent demonstrates a basic ReAct-style agent with tool calling capabilities
"""
import boto3
import csv
import json
import asyncio
import yaml
from pathlib import Path
from typing import Annotated, TypedDict, Literal
from langgraph.graph import StateGraph, END
@@ -15,27 +15,25 @@ from langgraph.graph.message import add_messages
from langchain_aws import ChatBedrock
from langchain_core.messages import HumanMessage, AIMessage, ToolMessage, SystemMessage
from langchain_core.tools import tool
import os
from langfuse import Langfuse
from langfuse.langchain import CallbackHandler
from utils.secrets_manager import SECRETS
from utils.config import AWS_REGION, BEDROCK_MODEL_ARN, LANGFUSE_HOST
CODE=""
langfuse = Langfuse(
secret_key=SECRETS["LANGFUSE-SECRET-KEY"],
public_key=SECRETS["LANGFUSE-PUBLIC-KEY"],
host=LANGFUSE_HOST,
)
_RULES_PATH = Path(__file__).parent / "rules.yaml"
with open(_RULES_PATH, encoding="utf-8") as _f:
_data = yaml.safe_load(_f)
RULES: dict[str, str] = _data["rules"]
MIN_DOC: dict[str, str] = _data["min_doc"]
# Base paths
SCRIPTS_DIR = Path(__file__).parent
JSON_OUTPUT_DIR = SCRIPTS_DIR / "json_output"
TEXTRACT_OUTPUT_DIR = SCRIPTS_DIR / "textract_output"
RULES={
_DELETED_MARKER={
"40808130":"""- Mulheres acima de 45 anos ou menopausada
- Homens com mais de 70 anos;
- Osteogênese imperfeita (para esta patologia, poderá haver a liberação de (02) dois