fciannella commited on
Commit
b38ed38
·
1 Parent(s): 41b6e84

changed the name of the banking fees client

Browse files
examples/voice_agent_webrtc_langgraph/pipeline.py CHANGED
@@ -152,6 +152,11 @@ async def list_assistants(request: Request):
152
  """
153
  import requests
154
 
 
 
 
 
 
155
  base_url = os.getenv("LANGGRAPH_BASE_URL", "http://127.0.0.1:2024").rstrip("/")
156
 
157
  inbound_auth = request.headers.get("authorization")
@@ -228,12 +233,19 @@ async def list_assistants(request: Request):
228
  except Exception:
229
  pass
230
  md = (detail.get("metadata") or {}) if isinstance(detail.get("metadata"), dict) else {}
 
 
 
 
 
 
231
  display_name = (
232
- detail.get("name")
 
233
  or md.get("display_name")
234
  or md.get("friendly_name")
235
- or detail.get("graph_id")
236
- or detail.get("assistant_id")
237
  )
238
  detail["display_name"] = display_name
239
  enriched.append(detail)
@@ -249,7 +261,7 @@ async def list_assistants(request: Request):
249
  enriched.append({
250
  "assistant_id": graph_id,
251
  "graph_id": graph_id,
252
- "display_name": graph_id,
253
  })
254
  except Exception as exc: # noqa: BLE001
255
  logger.error(f"Failed to read local agents/langgraph.json: {exc}")
 
152
  """
153
  import requests
154
 
155
+ # Custom display name mappings for specific agents
156
+ DISPLAY_NAME_OVERRIDES = {
157
+ "rbc-fees-agent": "Banking Fees Assistant",
158
+ }
159
+
160
  base_url = os.getenv("LANGGRAPH_BASE_URL", "http://127.0.0.1:2024").rstrip("/")
161
 
162
  inbound_auth = request.headers.get("authorization")
 
233
  except Exception:
234
  pass
235
  md = (detail.get("metadata") or {}) if isinstance(detail.get("metadata"), dict) else {}
236
+
237
+ # Check for custom display name override first
238
+ assistant_id = detail.get("assistant_id")
239
+ graph_id = detail.get("graph_id")
240
+ override_name = DISPLAY_NAME_OVERRIDES.get(assistant_id) or DISPLAY_NAME_OVERRIDES.get(graph_id)
241
+
242
  display_name = (
243
+ override_name
244
+ or detail.get("name")
245
  or md.get("display_name")
246
  or md.get("friendly_name")
247
+ or graph_id
248
+ or assistant_id
249
  )
250
  detail["display_name"] = display_name
251
  enriched.append(detail)
 
261
  enriched.append({
262
  "assistant_id": graph_id,
263
  "graph_id": graph_id,
264
+ "display_name": DISPLAY_NAME_OVERRIDES.get(graph_id) or graph_id,
265
  })
266
  except Exception as exc: # noqa: BLE001
267
  logger.error(f"Failed to read local agents/langgraph.json: {exc}")