diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx index 75fb48c4b..c3e8ac512 100644 --- a/gui/src/pages/gui/Chat.tsx +++ b/gui/src/pages/gui/Chat.tsx @@ -333,17 +333,16 @@ export function Chat() { "assistant" && item.message.toolCalls && item.toolCallState ? ( -
{tool.displayTitle ?? tool.function.name} tool
- >
- );
+ const toolName = tool.displayTitle ?? tool.function.name;
+ const defaultToolDescription = `${toolName} tool`;
- const futureMessage = tool.wouldLikeTo ? (
- Mustache.render(tool.wouldLikeTo, toolCallState.parsedArgs)
- ) : (
- <>
- use the {defaultToolDescription}
- >
- );
+ const futureMessage: string = tool.wouldLikeTo
+ ? Mustache.render(tool.wouldLikeTo, toolCallState.parsedArgs)
+ : `use the ${defaultToolDescription}`;
+ // TODO go back and replace arg string values and tool names with tags
+ // to make them more readable
let intro = "";
- let message: ReactNode = "";
+ let message = "";
if (
toolCallState.status === "done" ||
(tool.isInstant && toolCallState.status === "calling")
) {
intro = "";
- message = tool.hasAlready ? (
- Mustache.render(tool.hasAlready, toolCallState.parsedArgs)
- ) : (
- <>
- used the {defaultToolDescription}
- >
- );
+ message = tool.hasAlready
+ ? Mustache.render(tool.hasAlready, toolCallState.parsedArgs)
+ : `used the ${defaultToolDescription}`;
} else if (toolCallState.status === "generating") {
intro = "is generating output to";
message = futureMessage;
@@ -53,13 +42,9 @@ export function ToolCallStatusMessage({
message = futureMessage;
} else if (toolCallState.status === "calling") {
intro = "is";
- message = tool.isCurrently ? (
- Mustache.render(tool.isCurrently, toolCallState.parsedArgs)
- ) : (
- <>
- calling the {defaultToolDescription}
- >
- );
+ message = tool.isCurrently
+ ? Mustache.render(tool.isCurrently, toolCallState.parsedArgs)
+ : `calling the ${defaultToolDescription}`;
} else if (
toolCallState.status === "canceled" ||
toolCallState.status === "errored"
@@ -68,8 +53,12 @@ export function ToolCallStatusMessage({
message = futureMessage;
}
return (
-
- Continue {intro} {message}
+
+ {`Continue ${intro} ${message}`}
);
}
diff --git a/gui/src/pages/gui/ToolCallDiv/index.tsx b/gui/src/pages/gui/ToolCallDiv/index.tsx
index 39d14cd0a..c919c0ca1 100644
--- a/gui/src/pages/gui/ToolCallDiv/index.tsx
+++ b/gui/src/pages/gui/ToolCallDiv/index.tsx
@@ -80,16 +80,14 @@ export function ToolCallDiv(props: ToolCallDivProps) {
if (icon) {
return (
-
-
-
+
);
}