akseljoonas HF Staff commited on
Commit
cbb69a2
·
1 Parent(s): 07a657b

Show fun placeholder instead of raw args for running tools

Browse files

When clicking a tool that's still executing, the output panel was
showing the tool's input arguments as JSON. Now shows a random
playful message while the tool runs.

frontend/src/components/Chat/ToolCallGroup.tsx CHANGED
@@ -697,7 +697,18 @@ export default function ToolCallGroup({ tools, approveTools }: ToolCallGroupProp
697
  setPanel({ title: displayName, output: { content, language: 'markdown' }, input: inputSection }, 'output');
698
  setRightPanelOpen(true);
699
  } else if (args) {
700
- setPanel({ title: displayName, output: { content: JSON.stringify(args, null, 2), language: 'json' }, input: inputSection }, 'output');
 
 
 
 
 
 
 
 
 
 
 
701
  setRightPanelOpen(true);
702
  }
703
  },
 
697
  setPanel({ title: displayName, output: { content, language: 'markdown' }, input: inputSection }, 'output');
698
  setRightPanelOpen(true);
699
  } else if (args) {
700
+ const runningMessages = [
701
+ 'Crunching numbers and herding tensors...',
702
+ 'Teaching the model some new tricks...',
703
+ 'Consulting the GPU oracle...',
704
+ 'Wrangling data into submission...',
705
+ 'Brewing a fresh batch of predictions...',
706
+ 'Negotiating with the transformer heads...',
707
+ 'Polishing the attention weights...',
708
+ 'Aligning the embedding stars...',
709
+ ];
710
+ const funMsg = runningMessages[Math.floor(Math.random() * runningMessages.length)];
711
+ setPanel({ title: displayName, output: { content: funMsg, language: 'text' }, input: inputSection }, 'output');
712
  setRightPanelOpen(true);
713
  }
714
  },