Feat: Desacoplamento

This commit is contained in:
2026-03-12 15:02:26 -03:00
parent 08be8e314d
commit 8c3c23c65f
11 changed files with 231 additions and 163 deletions

View File

@@ -17,15 +17,16 @@ from langchain_core.messages import HumanMessage, AIMessage, ToolMessage, System
from langchain_core.tools import tool
import os
from langfuse import Langfuse
from langfuse.langchain import CallbackHandler
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=os.environ.get("LANGFUSE_HOST", ""),
host=LANGFUSE_HOST,
)
@@ -436,14 +437,14 @@ class AgentState(TypedDict):
def get_bedrock_client():
"""Initialize and return AWS Bedrock runtime client."""
return boto3.client("bedrock-runtime", region_name="us-east-2")
return boto3.client("bedrock-runtime", region_name=AWS_REGION)
def create_llm():
"""Create and return the Bedrock LLM."""
return ChatBedrock(
model_id="arn:aws:bedrock:us-east-2:232048051668:application-inference-profile/uy4xskop19zn",
region_name="us-east-2",
model_id=BEDROCK_MODEL_ARN,
region_name=AWS_REGION,
provider="anthropic"
)