new feature: External guardrails/judges
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
from typing import Any
|
||||
|
||||
from .client import TimApiClient
|
||||
@@ -225,7 +227,7 @@ class ContasDomainService:
|
||||
"socialSecNo": customer.get("document") or args.get("social_sec_no") or "",
|
||||
"customerId": customer.get("customerId") or customer.get("id") or args.get("customer_id") or "",
|
||||
"invoiceNumber": args.get("invoice_id") or "",
|
||||
"userId": "AIAGENTCR",
|
||||
"userId": os.getenv("TIM_DEFAULT_CLIENT_ID"),
|
||||
"items": [{"itemName": subject, "itemType": "VAS_AVULSO", "claimedAmount": str(valor), "validatedAmount": str(valor)}],
|
||||
"description": motivo,
|
||||
}
|
||||
@@ -234,7 +236,7 @@ class ContasDomainService:
|
||||
return {"success": True, "protocol": protocol, "contestation": contestation, "tracking": tracking, "invoices": invoices, "contract": contract, "profile": profile}
|
||||
|
||||
def consultar_status_solicitacao(self, *, msisdn: str = "", protocol: str = "", **_: Any) -> Any:
|
||||
return self.client.status_sr({"msisdn": msisdn, "protocolNumber": protocol, "status": "CONSULTA", "channel": "AIAGENTCR"})
|
||||
return self.client.status_sr({"msisdn": msisdn, "protocolNumber": protocol, "status": "CONSULTA", "channel": os.getenv("TIM_DEFAULT_CHANNEL")})
|
||||
|
||||
def enviar_sms(self, *, msisdn: str, message: str, **_: Any) -> Any:
|
||||
return self.client.sms(msisdn, message)
|
||||
@@ -295,11 +297,11 @@ class ContasDomainService:
|
||||
response["service_request_status"] = self.client.status_sr({
|
||||
"protocolNumber": protocol,
|
||||
"status": "Fechado",
|
||||
"channel": "AIAGENTCR",
|
||||
"channel": os.getenv("TIM_DEFAULT_CHANNEL"),
|
||||
"notes": normalized_summary,
|
||||
})
|
||||
return response
|
||||
|
||||
|
||||
def os_source(args: dict[str, Any]) -> str:
|
||||
return str(args.get("channel") or "AIAGENTCR")
|
||||
return str(args.get("channel") or os.getenv("TIM_DEFAULT_CHANNEL"))
|
||||
|
||||
Reference in New Issue
Block a user