From 4129d8ab61c3ef52ef4ad5a9e54bc9034779fb31 Mon Sep 17 00:00:00 2001 From: paulclindo Date: Tue, 3 Dec 2024 11:27:03 -0500 Subject: [PATCH 1/5] fix: set use_tools false --- apps/shinkai-desktop/src/components/agent/add-agent.tsx | 2 +- libs/shinkai-node-state/src/v2/constants.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/shinkai-desktop/src/components/agent/add-agent.tsx b/apps/shinkai-desktop/src/components/agent/add-agent.tsx index f064971bd..d10db3e0f 100644 --- a/apps/shinkai-desktop/src/components/agent/add-agent.tsx +++ b/apps/shinkai-desktop/src/components/agent/add-agent.tsx @@ -93,7 +93,7 @@ function AddAgentPage() { custom_prompt: '', custom_system_prompt: '', other_model_params: {}, - use_tools: DEFAULT_CHAT_CONFIG.use_tools, + use_tools: true, }, llmProviderId: defaultAgentId, }, diff --git a/libs/shinkai-node-state/src/v2/constants.ts b/libs/shinkai-node-state/src/v2/constants.ts index 914c91ec7..a989dc34a 100644 --- a/libs/shinkai-node-state/src/v2/constants.ts +++ b/libs/shinkai-node-state/src/v2/constants.ts @@ -43,7 +43,7 @@ export const DEFAULT_CHAT_CONFIG = { top_k: 40, top_p: 0.9, stream: true, - use_tools: true, + use_tools: false, } as const; export const OPTIMISTIC_USER_MESSAGE_ID = 'OPTIMISTIC_USER_MESSAGE_ID'; From e4f78ea917122e4818950366a759c845edad8de7 Mon Sep 17 00:00:00 2001 From: paulclindo Date: Tue, 3 Dec 2024 11:35:50 -0500 Subject: [PATCH 2/5] fix: update duckduckgo --- apps/shinkai-desktop/src/pages/chat/empty-message.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/shinkai-desktop/src/pages/chat/empty-message.tsx b/apps/shinkai-desktop/src/pages/chat/empty-message.tsx index 20d945b06..1883048ec 100644 --- a/apps/shinkai-desktop/src/pages/chat/empty-message.tsx +++ b/apps/shinkai-desktop/src/pages/chat/empty-message.tsx @@ -111,8 +111,8 @@ const EmptyMessage = () => { {[ { - text: 'Search in Perplexity', - prompt: 'Search in Perplexity for: ', + text: 'Search in DuckDuckGo', + prompt: 'Search in DuckDuckGo for: ', }, { text: 'Summarize a Youtube video', From a5762eeb0ff105cf11babbf4a34a7892c114c442 Mon Sep 17 00:00:00 2001 From: paulclindo Date: Tue, 3 Dec 2024 11:49:39 -0500 Subject: [PATCH 3/5] fix: search tools --- libs/shinkai-message-ts/src/api/tools/index.ts | 5 ++++- libs/shinkai-message-ts/src/api/tools/types.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/shinkai-message-ts/src/api/tools/index.ts b/libs/shinkai-message-ts/src/api/tools/index.ts index 52c77ef6e..dc2ed2ef5 100644 --- a/libs/shinkai-message-ts/src/api/tools/index.ts +++ b/libs/shinkai-message-ts/src/api/tools/index.ts @@ -17,6 +17,7 @@ import { GetPlaygroundToolsResponse, GetToolResponse, GetToolsResponse, + GetToolsSearchResponse, PayInvoiceRequest, SaveToolCodeRequest, SaveToolCodeResponse, @@ -86,7 +87,9 @@ export const searchTools = async ( responseType: 'json', }, ); - return response.data as GetToolsResponse; + const data = response.data as GetToolsSearchResponse; + const formattedData = data.map(([header]) => header); + return formattedData as GetToolsResponse; }; export const updateTool = async ( diff --git a/libs/shinkai-message-ts/src/api/tools/types.ts b/libs/shinkai-message-ts/src/api/tools/types.ts index 6ba955390..0f36a3f82 100644 --- a/libs/shinkai-message-ts/src/api/tools/types.ts +++ b/libs/shinkai-message-ts/src/api/tools/types.ts @@ -92,6 +92,7 @@ export type GetToolResponse = { type: ShinkaiToolType; }; export type GetToolsResponse = ShinkaiToolHeader[]; +export type GetToolsSearchResponse = [ShinkaiToolHeader, number][]; export type AddToolRequest = { type: ShinkaiToolType; From 74007dfa1dd38820fd4ec1aaa3575eba6c52b5c2 Mon Sep 17 00:00:00 2001 From: paulclindo Date: Tue, 3 Dec 2024 11:56:51 -0500 Subject: [PATCH 4/5] fix: needs reset popup --- apps/shinkai-desktop/src/pages/layout/main-layout.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/shinkai-desktop/src/pages/layout/main-layout.tsx b/apps/shinkai-desktop/src/pages/layout/main-layout.tsx index cee899f44..29b0cbf23 100644 --- a/apps/shinkai-desktop/src/pages/layout/main-layout.tsx +++ b/apps/shinkai-desktop/src/pages/layout/main-layout.tsx @@ -627,6 +627,8 @@ const MainLayout = () => { } if (isSuccess && nodeInfo?.update_requires_reset) { setNeedsResetApp(true); + } else { + setNeedsResetApp(false); } }, [isSuccess, nodeInfo?.status, isFetching]); From a7a90b7dc33986a4ec6e0acde44fb34bd4095e86 Mon Sep 17 00:00:00 2001 From: paulclindo Date: Tue, 3 Dec 2024 14:04:13 -0500 Subject: [PATCH 5/5] fix: disable reset button while pending --- .../src/pages/layout/main-layout.tsx | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/apps/shinkai-desktop/src/pages/layout/main-layout.tsx b/apps/shinkai-desktop/src/pages/layout/main-layout.tsx index 29b0cbf23..60e08c815 100644 --- a/apps/shinkai-desktop/src/pages/layout/main-layout.tsx +++ b/apps/shinkai-desktop/src/pages/layout/main-layout.tsx @@ -183,8 +183,12 @@ const ResetConnectionDialog = ({ isOpen: boolean; onOpenChange: (open: boolean) => void; }) => { - const { mutateAsync: shinkaiNodeKill } = useShinkaiNodeKillMutation(); - const { mutateAsync: shinkaiNodeSpawn } = useShinkaiNodeSpawnMutation({ + const { mutateAsync: shinkaiNodeKill, isPending: isShinkaiNodeKillPending } = + useShinkaiNodeKillMutation(); + const { + mutateAsync: shinkaiNodeSpawn, + isPending: isShinkaiNodeSpawnPending, + } = useShinkaiNodeSpawnMutation({ onSuccess: async () => { if (!encryptionKeys) return; await submitRegistrationNoCode({ @@ -195,13 +199,20 @@ const ResetConnectionDialog = ({ }); }, }); - const { mutateAsync: shinkaiNodeRemoveStorage } = - useShinkaiNodeRemoveStorageMutation(); + const { + mutateAsync: shinkaiNodeRemoveStorage, + isPending: isShinkaiNodeRemoveStoragePending, + } = useShinkaiNodeRemoveStorageMutation(); const { setShinkaiNodeOptions } = useShinkaiNodeManager(); const { encryptionKeys } = useGetEncryptionKeys(); const setAuth = useAuth((state) => state.setAuth); const navigate = useNavigate(); + const isResetLoading = + isShinkaiNodeKillPending || + isShinkaiNodeRemoveStoragePending || + isShinkaiNodeSpawnPending; + const { mutateAsync: submitRegistrationNoCode } = useSubmitRegistrationNoCode( { onSuccess: (response, setupPayload) => { @@ -254,6 +265,8 @@ const ResetConnectionDialog = ({