This commit is contained in:
2026-06-13 10:12:53 -03:00
parent a3f5e9966f
commit 42c167212a
5 changed files with 80 additions and 10 deletions

View File

@@ -245,17 +245,43 @@ async def open_siebel_sr(state: AgentState) -> AgentState:
)
# Update metadata with the SR response
sr_number = response.get("interactionProtocol")
# sr_number = response.get("interactionProtocol")
raw_response = response.get("result") or response
sr_number = (
raw_response.get("interactionProtocol")
or raw_response.get("crmProtocol")
or raw_response.get("protocol")
)
# context = dict(context)
# response["notes"] = notas
# context["siebel_sr_data"] = response
#
# state = update_state_metadata(state, request_context=context)
# await set_current_step(state, GraphStep.SIEBEL_SR_OPENED)
#
# msg = f"Siebel SR opened successfully: {sr_number}"
# logger.info(msg+'\n')
# state["final_response"] = msg
context = dict(context)
response["notes"] = notas
context["siebel_sr_data"] = response
raw_response = response.get("result") or response
raw_response["notes"] = notas
context["siebel_sr_data"] = raw_response
state = update_state_metadata(state, request_context=context)
state["crmProtocol"] = sr_number
state["fieldsToUpdate"] = raw_response.get("fieldsToUpdate")
state["transitions"] = raw_response.get("transitions") or []
await set_current_step(state, GraphStep.SIEBEL_SR_OPENED)
msg = f"Siebel SR opened successfully: {sr_number}"
logger.info(msg+'\n')
logger.info(msg + "\n")
state["final_response"] = msg
if success_tag: