Skip to content

Commit bdc2fd3

Browse files
authored
🔨 fix(ToolCall): Check output string type before performing .toLowerCase() (danny-avila#4324)
1 parent 5da7766 commit bdc2fd3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎client/src/components/Chat/Messages/Content/ToolCall.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export default function ToolCall({
3333

3434
const [function_name, _domain] = name.split(actionDelimiter) as [string, string | undefined];
3535
const domain = _domain?.replaceAll(actionDomainSeparator, '.') ?? null;
36-
const error = output?.toLowerCase()?.includes('error processing tool');
36+
const error =
37+
typeof output === 'string' && output.toLowerCase().includes('error processing tool');
3738

3839
const args = useMemo(() => {
3940
if (typeof _args === 'string') {

0 commit comments

Comments
 (0)