diff --git a/application/agents/base.py b/application/agents/base.py index adebc125..c9cc579d 100644 --- a/application/agents/base.py +++ b/application/agents/base.py @@ -197,7 +197,9 @@ class BaseAgent(ABC): else: print(f"Executing tool: {action_name} with args: {call_args}") result = tool.execute_action(action_name, **parameters) - tool_call_data["result"] = result + tool_call_data["result"] = ( + f"{str(result)[:50]}..." if len(str(result)) > 50 else result + ) yield {"type": "tool_call", "data": {**tool_call_data, "status": "completed"}} self.tool_calls.append(tool_call_data) @@ -213,6 +215,7 @@ class BaseAgent(ABC): if len(str(tool_call["result"])) > 50 else tool_call["result"] ), + "status": "completed", } for tool_call in self.tool_calls ] diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 920005e3..c1c1f553 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -26,7 +26,9 @@ import UserIcon from '../assets/user.svg'; import Accordion from '../components/Accordion'; import Avatar from '../components/Avatar'; import CopyButton from '../components/CopyButton'; +import MermaidRenderer from '../components/MermaidRenderer'; import Sidebar from '../components/Sidebar'; +import Spinner from '../components/Spinner'; import SpeakButton from '../components/TextToSpeechButton'; import { useDarkTheme, useOutsideAlerter } from '../hooks'; import { @@ -36,7 +38,6 @@ import { import classes from './ConversationBubble.module.css'; import { FEEDBACK, MESSAGE_TYPE } from './conversationModels'; import { ToolCallsType } from './types'; -import MermaidRenderer from '../components/MermaidRenderer'; const DisableSourceFE = import.meta.env.VITE_DISABLE_SOURCE_FE || false; @@ -741,7 +742,7 @@ function ToolCalls({ toolCalls }: { toolCalls: ToolCallsType[] }) { {isToolCallsOpen && ( -
-
- {JSON.stringify(toolCall.result, null, 2)}
+ {toolCall.status === 'pending' && (
+
+
+ + {JSON.stringify(toolCall.result, null, 2)} + +
+ )}