refactor: tool classification and calling logic

This commit is contained in:
Danny Avila 2025-12-08 14:57:14 -05:00
parent c7ddaaf298
commit d4bdb3be00
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
6 changed files with 26 additions and 17 deletions

View file

@ -91,7 +91,11 @@ const Part = memo(
const isToolCall =
'args' in toolCall && (!toolCall.type || toolCall.type === ToolCallTypes.TOOL_CALL);
if (isToolCall && toolCall.name === Tools.execute_code) {
if (
isToolCall &&
(toolCall.name === Tools.execute_code ||
toolCall.name === Constants.PROGRAMMATIC_TOOL_CALLING)
) {
return (
<ExecuteCode
attachments={attachments}

View file

@ -67,7 +67,7 @@ export default function ExecuteCode({
const [contentHeight, setContentHeight] = useState<number | undefined>(0);
const prevShowCodeRef = useRef<boolean>(showCode);
const { lang, code } = useParseArgs(args) ?? ({} as ParsedArgs);
const { lang = 'py', code } = useParseArgs(args) ?? ({} as ParsedArgs);
const progress = useProgress(initialProgress);
useEffect(() => {

View file

@ -702,7 +702,7 @@
"com_ui_agents_allow_use": "Allow using Agents",
"com_ui_all": "all",
"com_ui_all_proper": "All",
"com_ui_analyzing": "Analyzing",
"com_ui_analyzing": "Running tools with code",
"com_ui_analyzing_finished": "Finished analyzing",
"com_ui_api_key": "API Key",
"com_ui_archive": "Archive",