From b31d822f2501a470791002ff67c905aaf5756b93 Mon Sep 17 00:00:00 2001 From: Kris Hokr Date: Tue, 24 Sep 2024 12:10:22 -0600 Subject: [PATCH] fix tool type to be TTool instead of string --- .../features/build-panel/components/create-assistant.tsx | 2 +- .../features/build-panel/components/edit-assistant.tsx | 4 ++-- .../features/build-panel/components/files-dialog.tsx | 1 - ui/src/data-provider/types.ts | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/src/components/features/build-panel/components/create-assistant.tsx b/ui/src/components/features/build-panel/components/create-assistant.tsx index 9bffa47..929cb8d 100644 --- a/ui/src/components/features/build-panel/components/create-assistant.tsx +++ b/ui/src/components/features/build-panel/components/create-assistant.tsx @@ -81,7 +81,7 @@ export function CreateAssistant() { (tool) => tool.type === RetrievalType, ); const retrievalTools = [retrievalTool]; - const containsCodeInterpreter = tools.includes("Code interpretor"); + // const containsCodeInterpreter = tools.includes("Code interpretor"); // if (containsCodeInterpreter) retrievalTools.push("Code interpreter"); form.setValue("config.configurable.tools", retrievalTools); } diff --git a/ui/src/components/features/build-panel/components/edit-assistant.tsx b/ui/src/components/features/build-panel/components/edit-assistant.tsx index 712dc3e..0242fc7 100644 --- a/ui/src/components/features/build-panel/components/edit-assistant.tsx +++ b/ui/src/components/features/build-panel/components/edit-assistant.tsx @@ -96,10 +96,10 @@ function EditAssistantForm({ const retrievalTool = availableTools?.find( (tool) => tool.type === RetrievalType, ); - const containsCodeInterpreter = tools.includes("Code interpretor"); + // const containsCodeInterpreter = tools.includes("Code interpretor"); // if (containsCodeInterpreter) retrievalTools.push("Code interpreter"); if (retrievalTool) { - form.setValue("config.configurable.tools", [retrievalTool.toString()]); + form.setValue("config.configurable.tools", [retrievalTool]); } } }, [architectureType]); diff --git a/ui/src/components/features/build-panel/components/files-dialog.tsx b/ui/src/components/features/build-panel/components/files-dialog.tsx index e29e83a..45b8ee8 100644 --- a/ui/src/components/features/build-panel/components/files-dialog.tsx +++ b/ui/src/components/features/build-panel/components/files-dialog.tsx @@ -125,7 +125,6 @@ export default function FilesDialog({ form, classNames }: TFilesDialog) { defaultValues={formattedAssistantFiles} onValueChange={(selections) => { const fileIds = getFileIds(selections); - console.log(fileIds); field.onChange(fileIds); }} /> diff --git a/ui/src/data-provider/types.ts b/ui/src/data-provider/types.ts index 3a673ec..74c903f 100644 --- a/ui/src/data-provider/types.ts +++ b/ui/src/data-provider/types.ts @@ -47,7 +47,7 @@ export type TConfigurable = { interrupt_before_action: boolean; retrieval_description: string; system_message: string; - tools: string[]; + tools: TTool[]; llm_type: string; };