fix: Render tool calls with no args
This commit is contained in:
@@ -18,8 +18,7 @@ export function ToolCalls({
|
||||
<div className="space-y-4">
|
||||
{toolCalls.map((tc, idx) => {
|
||||
const args = tc.args as Record<string, any>;
|
||||
if (!tc.args || Object.keys(args).length === 0) return null;
|
||||
|
||||
const hasArgs = Object.keys(args).length > 0;
|
||||
return (
|
||||
<div
|
||||
key={idx}
|
||||
@@ -35,6 +34,7 @@ export function ToolCalls({
|
||||
)}
|
||||
</h3>
|
||||
</div>
|
||||
{hasArgs ? (
|
||||
<table className="min-w-full divide-y divide-gray-200">
|
||||
<tbody className="divide-y divide-gray-200">
|
||||
{Object.entries(args).map(([key, value], argIdx) => (
|
||||
@@ -55,6 +55,9 @@ export function ToolCalls({
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
) : (
|
||||
<code className="text-sm block p-3">{"{}"}</code>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user