first commit

This commit is contained in:
2026-09-09 16:50:00 -03:00
commit b2a368d71a
104 changed files with 7462 additions and 0 deletions

BIN
configs/.DS_Store vendored Normal file

Binary file not shown.

55
configs/identity.yaml Normal file
View File

@@ -0,0 +1,55 @@
identity:
version: "2"
required:
- session_key
keys:
customer_key:
description: Cliente/assinante/consumidor canônico.
sources:
- business_context.customer_key
- customer_key
- msisdn
- customer_id
- user_id
- ani
- from
contract_key:
description: Contrato, conta, fatura, pedido ou asset principal.
sources:
- business_context.contract_key
- contract_key
- invoice_id
- current_invoice_number
- order_id
- pedido_id
- asset_id
interaction_key:
description: Chave externa da interação/call/chat vinda do canal.
sources:
- business_context.interaction_key
- interaction_key
- ura_call_id
- call_id
- message_id
account_key:
description: Conta de cobrança/conta comercial.
sources:
- business_context.account_key
- account_key
- account_id
- billing_account_id
resource_key:
description: Recurso/linha/produto/asset específico.
sources:
- business_context.resource_key
- resource_key
- asset_id
- product_id
- sku
session_key:
description: Sessão técnica estável já escopada por tenant e agente.
sources:
- business_context.session_key
- session_key
- conversation_key
- session_id

28
configs/judge/agents.yaml Normal file
View File

@@ -0,0 +1,28 @@
agents:
- agentId: billing
enabled: true
daysBack: 1
percentage: 1.0
langfuse_agent_aliases: []
gcs_prefix: agnt_ai_contas
- agentId: sales
enabled: true
daysBack: 1
percentage: 1.0
langfuse_agent_aliases: []
gcs_prefix: agnt_ai_ofertas
- agentId: collection
enabled: true
daysBack: 1
percentage: 1.0
langfuse_agent_aliases: []
gcs_prefix: agnt_ai_cobranca
- agentId: backoffice-anatel
enabled: true
daysBack: 1
percentage: 1.0
langfuse_agent_aliases: []
gcs_prefix: agnt_ai_bko

View File

@@ -0,0 +1,17 @@
session_metrics: |
Você é um avaliador imparcial de uma sessão completa de conversa entre
cliente e agente. Vai receber a TRANSCRIÇÃO da sessão (alternância
user/agent). Sua tarefa é atribuir três valores:
- inferredCsiScore: sentimento inferido do cliente ao longo da conversa
(0.0 negativo, 0.5 neutro, 1.0 positivo).
- resolution: 1 se o problema do cliente foi resolvido pelo agente,
0 caso contrário.
- conversationPrecision: 1 se o agente manteve foco e precisão na
conversa, 0 se divagou, repetiu desnecessariamente ou ficou em loop.
Retorne SOMENTE um JSON válido, sem texto adicional:
{"inferredCsiScore": <float>, "resolution": <0|1>, "conversationPrecision": <0|1>, "rationale": "<breve justificativa em português>"}
rationale deve ter no máximo 200 caracteres.

View File

@@ -0,0 +1,5 @@
storage:
buckets:
dev: tim-bigdata-dev-ca1f-raw-standard-agnt-ai-atendimento
fqa: tim-bigdata-fqa-60ce-raw-standard-agnt-ai-atendimento
prd: tim-bigdata-prod-e305-raw-standard-agnt-ai-atendimento

View File

@@ -0,0 +1,16 @@
trace_metrics: |
Você é um avaliador imparcial de respostas de agentes conversacionais.
Vai receber o HISTÓRICO da conversa (últimos turnos), a MENSAGEM DO
USUÁRIO e a RESPOSTA DO AGENTE. Sua tarefa é atribuir três notas
numéricas entre 0.0 e 1.0:
- judgeScore: qualidade global da resposta (clareza, utilidade, tom).
- accuracyScore: factualidade da resposta frente ao contexto fornecido.
- alucinationScore: grau em que a resposta contém afirmações NÃO
suportadas pelo contexto (alto = mais alucinação = pior).
Retorne SOMENTE um JSON válido, sem nenhum texto adicional, no formato:
{"judgeScore": <float>, "accuracyScore": <float>, "alucinationScore": <float>, "rationale": "<breve justificativa em português>"}
rationale deve ter no máximo 200 caracteres.

View File

@@ -0,0 +1,22 @@
# Copy/mount this file as configs/langfuse/langfuse_credentials.yaml, or point
# LANGFUSE_CREDENTIALS_CONFIG_PATH to another location.
#
# Production recommendation: mount the complete file from a Kubernetes Secret.
# The evaluator loops over all entries; adding an agent requires no Python change.
langfuse:
agents:
- agentId: billing
host: https://langfuse.example.internal
publicKey: pk-example-billing
secretKey: sk-example-billing
- agentId: sales
host: https://langfuse.example.internal
publicKey: pk-example-sales
secretKey: sk-example-sales
# Alternative: keep only references in Git and source values from env or files:
# - agentId: collection
# hostEnv: COLLECTION_LANGFUSE_HOST
# publicKeyEnv: COLLECTION_LANGFUSE_PUBLIC_KEY
# secretKeyFile: /var/secrets/langfuse/collection-secret-key

View File

@@ -0,0 +1,9 @@
profiles:
judge:
temperature: 0
max_tokens: 900
mock:
provider: mock
model: mock-judge
temperature: 0
max_tokens: 300