🔨 fix(ToolCall): Check output string type before performing .toLowerCase() (#4324)

This commit is contained in:
Hanna Daoud 2024-10-08 09:26:03 +04:00 committed by GitHub
parent 5da7766fad
commit bdc2fd307f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,7 +33,8 @@ export default function ToolCall({
const [function_name, _domain] = name.split(actionDelimiter) as [string, string | undefined];
const domain = _domain?.replaceAll(actionDomainSeparator, '.') ?? null;
const error = output?.toLowerCase()?.includes('error processing tool');
const error =
typeof output === 'string' && output.toLowerCase().includes('error processing tool');
const args = useMemo(() => {
if (typeof _args === 'string') {