diff --git a/apps/shinkai-desktop/src/components/chat/chat-action-bar/chat-config-action-bar.tsx b/apps/shinkai-desktop/src/components/chat/chat-action-bar/chat-config-action-bar.tsx index 220cd165d..8f95653ae 100644 --- a/apps/shinkai-desktop/src/components/chat/chat-action-bar/chat-config-action-bar.tsx +++ b/apps/shinkai-desktop/src/components/chat/chat-action-bar/chat-config-action-bar.tsx @@ -4,9 +4,7 @@ import { useTranslation } from '@shinkai_network/shinkai-i18n'; import { extractJobIdFromInbox } from '@shinkai_network/shinkai-message-ts/utils/inbox_name_handler'; import { useUpdateChatConfig } from '@shinkai_network/shinkai-node-state/v2/mutations/updateChatConfig/useUpdateChatConfig'; import { useGetChatConfig } from '@shinkai_network/shinkai-node-state/v2/queries/getChatConfig/useGetChatConfig'; -import { useGetLLMProviders } from '@shinkai_network/shinkai-node-state/v2/queries/getLLMProviders/useGetLLMProviders'; import { - Alert, Button, Form, Popover, @@ -30,9 +28,7 @@ import { Switch, Textarea, } from '@shinkai_network/shinkai-ui'; -import { cn } from '@shinkai_network/shinkai-ui/utils'; import { Settings2 } from 'lucide-react'; -import { InfoCircleIcon } from 'primereact/icons/infocircle'; import { useEffect } from 'react'; import { useForm } from 'react-hook-form'; import { UseFormReturn } from 'react-hook-form'; @@ -41,7 +37,6 @@ import { toast } from 'sonner'; import { z } from 'zod'; import { useAuth } from '../../../store/auth'; -import { useSettings } from '../../../store/settings'; import { actionButtonClassnames } from '../conversation-footer'; export const chatConfigFormSchema = z.object({ @@ -59,10 +54,6 @@ interface ChatConfigFormProps { } function ChatConfigForm({ form }: ChatConfigFormProps) { - const selectedAIModel = useSelectedAIModel(); - - const isOllamaProvider = selectedAIModel?.model?.split(':')?.[0] === 'ollama'; - return (
( - {isOllamaProvider && ( - svg]:static [&>svg~*]:pl-0', - 'flex w-full items-center gap-2 rounded-lg px-3 py-2', - )} - variant="info" - > - - - Turn off stream if you want to use{' '} - Tools - - - )} -
+
{ - const defaultAgentId = useSettings((state) => state.defaultAgentId); - const auth = useAuth((state) => state.auth); - - const { llmProviders } = useGetLLMProviders({ - nodeAddress: auth?.node_address ?? '', - token: auth?.api_v2_key ?? '', - }); - const selectedProvider = llmProviders?.find( - (provider) => provider.id === defaultAgentId, - ); - return selectedProvider; -}; - export function UpdateChatConfigActionBar() { const auth = useAuth((state) => state.auth); const { inboxId: encodedInboxId = '' } = useParams(); diff --git a/apps/shinkai-desktop/src/components/chat/conversation-footer.tsx b/apps/shinkai-desktop/src/components/chat/conversation-footer.tsx index 1a59ff568..c7d0f7b8c 100644 --- a/apps/shinkai-desktop/src/components/chat/conversation-footer.tsx +++ b/apps/shinkai-desktop/src/components/chat/conversation-footer.tsx @@ -30,6 +30,7 @@ import { useGetChatConversationWithPagination } from '@shinkai_network/shinkai-n import { useGetLLMProviders } from '@shinkai_network/shinkai-node-state/v2/queries/getLLMProviders/useGetLLMProviders'; import { useGetWorkflowSearch } from '@shinkai_network/shinkai-node-state/v2/queries/getWorkflowSearch/useGetWorkflowSearch'; import { + Alert, Button, ChatInputArea, Form, @@ -55,6 +56,7 @@ import { cn } from '@shinkai_network/shinkai-ui/utils'; import { partial } from 'filesize'; import { AnimatePresence, motion } from 'framer-motion'; import { Paperclip, SendIcon, X, XIcon } from 'lucide-react'; +import { InfoCircleIcon } from 'primereact/icons/infocircle'; import { useEffect, useMemo, useState } from 'react'; import { useDropzone } from 'react-dropzone'; import { useForm, useWatch } from 'react-hook-form'; @@ -383,7 +385,10 @@ function ConversationEmptyFooter() {
- +
+ + +
- +
+ + +
{ + const defaultAgentId = useSettings((state) => state.defaultAgentId); + const auth = useAuth((state) => state.auth); + + const { llmProviders } = useGetLLMProviders({ + nodeAddress: auth?.node_address ?? '', + token: auth?.api_v2_key ?? '', + }); + const selectedProvider = llmProviders?.find( + (provider) => provider.id === defaultAgentId, + ); + return selectedProvider; +}; + +const ToolsDisabledAlert = () => { + const selectedAIModel = useSelectedAIModel(); + + const isOllamaProvider = selectedAIModel?.model?.split(':')?.[0] === 'ollama'; + + return isOllamaProvider ? ( + + + + svg]:static [&>svg~*]:pl-0', + 'flex w-full items-center gap-2 rounded-lg px-3 py-1.5', + )} + variant="info" + > + + Tools disabled + + + + +

+ Turn off streaming in chat config to allow tool usage (Ollama + limitation). +

+
+
+
+
+ ) : null; +};