fix: handle args for function specific tool call divs
This commit is contained in:
parent
6af35548c8
commit
ae29787bd2
1 changed files with 12 additions and 7 deletions
|
|
@ -18,25 +18,30 @@ function FunctionSpecificToolCallDiv({
|
|||
case BuiltInToolNames.CreateNewFile:
|
||||
return (
|
||||
<CreateFile
|
||||
relativeFilepath={args.filepath}
|
||||
fileContents={args.contents}
|
||||
relativeFilepath={args?.filepath ?? ""}
|
||||
fileContents={args?.contents ?? ""}
|
||||
historyIndex={historyIndex}
|
||||
/>
|
||||
);
|
||||
case BuiltInToolNames.EditExistingFile:
|
||||
return (
|
||||
<EditFile
|
||||
relativeFilePath={args.filepath ?? ""}
|
||||
changes={args.changes ?? ""}
|
||||
relativeFilePath={args?.filepath ?? ""}
|
||||
changes={args?.changes ?? ""}
|
||||
toolCallId={toolCall.id}
|
||||
historyIndex={historyIndex}
|
||||
/>
|
||||
);
|
||||
case BuiltInToolNames.SearchAndReplaceInFile:
|
||||
const changes = args.diffs
|
||||
? Array.isArray(args.diffs)
|
||||
? args.diffs.join("\n\n---\n\n")
|
||||
: args.diffs
|
||||
: "";
|
||||
return (
|
||||
<EditFile
|
||||
relativeFilePath={args.filepath ?? ""}
|
||||
changes={args.diffs ? args.diffs.join("\n\n---\n\n") : ""}
|
||||
relativeFilePath={args?.filepath ?? ""}
|
||||
changes={changes}
|
||||
toolCallId={toolCall.id}
|
||||
historyIndex={historyIndex}
|
||||
/>
|
||||
|
|
@ -44,7 +49,7 @@ function FunctionSpecificToolCallDiv({
|
|||
case BuiltInToolNames.RunTerminalCommand:
|
||||
return (
|
||||
<RunTerminalCommand
|
||||
command={args.command}
|
||||
command={args?.command ?? ""}
|
||||
toolCallState={toolCallState}
|
||||
toolCallId={toolCall.id}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue