import { Fragment, useCallback } from 'react' import { Tooltip, TooltipTrigger, TooltipPortal, TooltipContent, TooltipArrow, Switch, Input, } from '@janhq/uikit' import { useAtomValue } from 'jotai' import { InfoIcon } from 'lucide-react' import CardSidebar from '@/containers/CardSidebar' import { selectedModelAtom } from '@/containers/DropdownListSidebar' import { useCreateNewThread } from '@/hooks/useCreateNewThread' import { getConfigurationsData } from '@/utils/componentSettings' import AssistantSetting from '../../AssistantSetting' import { experimentalFeatureEnabledAtom } from '@/helpers/atoms/AppConfig.atom' import { activeThreadAtom } from '@/helpers/atoms/Thread.atom' const AssistantTool: React.FC = () => { const experimentalFeature = useAtomValue(experimentalFeatureEnabledAtom) const activeThread = useAtomValue(activeThreadAtom) const selectedModel = useAtomValue(selectedModelAtom) const { updateThreadMetadata } = useCreateNewThread() const componentDataAssistantSetting = getConfigurationsData( (activeThread?.assistants[0]?.tools && activeThread?.assistants[0]?.tools[0]?.settings) ?? {} ) const onRetrievalSwitchUpdate = useCallback( (enabled: boolean) => { if (!activeThread) return updateThreadMetadata({ ...activeThread, assistants: [ { ...activeThread.assistants[0], tools: [ { type: 'retrieval', enabled: enabled, settings: (activeThread.assistants[0].tools && activeThread.assistants[0].tools[0]?.settings) ?? {}, }, ], }, ], }) }, [activeThread, updateThreadMetadata] ) if (!experimentalFeature) return null return ( {activeThread?.assistants[0]?.tools && componentDataAssistantSetting.length > 0 && (
{activeThread?.assistants[0]?.tools[0].enabled && (
Embedding model is crucial for understanding and processing the input text effectively by converting text to numerical representations. Align the model choice with your task, evaluate its performance, and consider factors like resource availability. Experiment to find the best fit for your specific use case.
Vector Database is crucial for efficient storage and retrieval of embeddings. Consider your specific task, available resources, and language requirements. Experiment to find the best fit for your specific use case.
)}
)}
) } export default AssistantTool