From 5f710060be27a2342df65d7e810f5e955c6f2bec Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Fri, 31 Jul 2026 18:24:45 -0400 Subject: [PATCH] refac --- cptr/routers/gateway.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cptr/routers/gateway.py b/cptr/routers/gateway.py index 4876980..f8e0907 100644 --- a/cptr/routers/gateway.py +++ b/cptr/routers/gateway.py @@ -67,7 +67,10 @@ def _format_tool_call(item: dict) -> str | None: if item.get("type") != "function_call" or item.get("status") != "in_progress": return None - return f"\n\n`{item.get('name', 'tool')}`\n\n" + arguments = item.get("arguments") + title = arguments.get("title") if isinstance(arguments, dict) else None + name = str(title or item.get("name") or "tool").strip() or "tool" + return f"\n\n`{name}`\n\n" async def _authenticate(request: Request) -> str: