diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3a6b5350..85619cf7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,12 +13,12 @@ repos: - repo: local hooks: - - id: eslint - name: eslint - entry: bash -c 'cd wavefront/client && pnpm lint' - language: system - files: ^wavefront/client/.*\.(js|jsx|ts|tsx)$ - pass_filenames: false # let eslint use its own ignore & config + # - id: eslint + # name: eslint + # entry: bash -c 'cd wavefront/client && pnpm lint' + # language: system + # files: ^wavefront/client/.*\.(js|jsx|ts|tsx)$ + # pass_filenames: false # let eslint use its own ignore & config - id: typescript-check name: typescript-check diff --git a/wavefront/client/.env b/wavefront/client/.env index 9f5f0aca..4ed3a408 100644 --- a/wavefront/client/.env +++ b/wavefront/client/.env @@ -1,4 +1,4 @@ -VITE_BASE_URL=https://console.dev.rootflo.ai/floconsole +VITE_BASE_URL=http://localhost:8002/floconsole VITE_APP_ENV=local VITE_FEATURE_API_SERVICES=true diff --git a/wavefront/client/src/App.tsx b/wavefront/client/src/App.tsx index 60e8ac45..e7b7b7d2 100644 --- a/wavefront/client/src/App.tsx +++ b/wavefront/client/src/App.tsx @@ -1,10 +1,12 @@ import { TOKEN_KEY } from '@app/lib/constants'; import { useEffect } from 'react'; +import Toast from './components/ui/toast'; import AppRouter from './router'; -import { useAuthStore } from './store'; +import { useAuthStore, useNotifyStore } from './store'; function App() { const { setAuthenticatedState } = useAuthStore(); + const { visible, reset, type, message } = useNotifyStore(); useEffect(() => { const token = localStorage.getItem(TOKEN_KEY); @@ -15,6 +17,7 @@ function App() { return (
+
); } diff --git a/wavefront/client/src/assets/icons/toast-icons.tsx b/wavefront/client/src/assets/icons/toast-icons.tsx new file mode 100644 index 00000000..cc1c6c39 --- /dev/null +++ b/wavefront/client/src/assets/icons/toast-icons.tsx @@ -0,0 +1,47 @@ +export const ToastSuccessIcon = () => { + return ( +
+ +
+ ); +}; + +export const ToastErrorIcon = () => { + return ( +
+ +
+ ); +}; + +export const ToastWarningIcon = () => { + return ( +
+ +
+ ); +}; diff --git a/wavefront/client/src/components/ui/toast.tsx b/wavefront/client/src/components/ui/toast.tsx new file mode 100644 index 00000000..68b07bc0 --- /dev/null +++ b/wavefront/client/src/components/ui/toast.tsx @@ -0,0 +1,70 @@ +import { TToastType } from '@app/store'; +import { ToastErrorIcon, ToastSuccessIcon, ToastWarningIcon } from '@app/assets/icons/toast-icons'; +import { useEffect } from 'react'; + +const iconMap = { + success: , + error: , + warning: , +}; + +const Toast = ({ + visible, + reset, + type, + message, + timeout = 3000, +}: { + visible: boolean; + reset: () => void; + type: TToastType; + message: string; + timeout?: number; +}) => { + useEffect(() => { + if (visible) { + const timeoutId = setTimeout(reset, timeout); + return () => clearTimeout(timeoutId); + } + }, [visible, timeout, reset]); + + if (!visible) return <>; + + return ( + <> +
+ {type && iconMap[type]} +
{message}
+ +
+ + ); +}; + +export default Toast; diff --git a/wavefront/client/src/config/llm-providers.ts b/wavefront/client/src/config/llm-providers.ts index 028d4793..6e78ca5e 100644 --- a/wavefront/client/src/config/llm-providers.ts +++ b/wavefront/client/src/config/llm-providers.ts @@ -50,22 +50,13 @@ export const LLM_PROVIDERS_CONFIG: Record = description: 'Controls randomness in responses (0-2)', placeholder: '0.7', }, - max_tokens: { - type: 'number', - default: 150, - min: 1, - max: 16000, - step: 1, - description: 'Maximum number of tokens to generate', - placeholder: '150', - }, max_completion_tokens: { type: 'number', default: undefined, min: 1, max: 16000, step: 1, - description: 'Maximum completion tokens (alternative to max_tokens)', + description: 'Maximum completion tokens', placeholder: '1000', }, top_p: { @@ -221,22 +212,13 @@ export const LLM_PROVIDERS_CONFIG: Record = description: 'Controls randomness in responses (0-2)', placeholder: '0.7', }, - max_tokens: { - type: 'number', - default: 150, - min: 1, - max: 16000, - step: 1, - description: 'Maximum number of tokens to generate', - placeholder: '150', - }, max_completion_tokens: { type: 'number', default: undefined, min: 1, max: 16000, step: 1, - description: 'Maximum completion tokens (alternative to max_tokens)', + description: 'Maximum completion tokens', placeholder: '1000', }, top_p: { @@ -293,22 +275,13 @@ export const LLM_PROVIDERS_CONFIG: Record = description: 'Controls randomness in responses (0-2)', placeholder: '0.7', }, - max_tokens: { - type: 'number', - default: 150, - min: 1, - max: 8000, - step: 1, - description: 'Maximum number of tokens to generate', - placeholder: '150', - }, max_completion_tokens: { type: 'number', default: undefined, min: 1, max: 8000, step: 1, - description: 'Maximum completion tokens (alternative to max_tokens)', + description: 'Maximum completion tokens', placeholder: '1000', }, top_p: { diff --git a/wavefront/client/src/config/voice-providers.ts b/wavefront/client/src/config/voice-providers.ts index 650cae29..af9c679d 100644 --- a/wavefront/client/src/config/voice-providers.ts +++ b/wavefront/client/src/config/voice-providers.ts @@ -157,12 +157,6 @@ export const VOICE_PROVIDERS_CONFIG: VoiceProvidersConfig = { placeholder: '1.0', step: 0.1, }, - emotion: { - type: 'array', - default: [], - description: 'Comma-separated emotion tags', - placeholder: 'happy, excited', - }, }, }, }, diff --git a/wavefront/client/src/pages/apps/[appId]/agents/CreateAgentDialog.tsx b/wavefront/client/src/pages/apps/[appId]/agents/CreateAgentDialog.tsx index 717c7ae4..b003f582 100644 --- a/wavefront/client/src/pages/apps/[appId]/agents/CreateAgentDialog.tsx +++ b/wavefront/client/src/pages/apps/[appId]/agents/CreateAgentDialog.tsx @@ -44,7 +44,7 @@ agent: name: gemini-2.5-flash settings: temperature: 0.7 -job: You are a translator. Use this tone + job: You are a translator. Use this tone `; interface CreateAgentDialogProps { diff --git a/wavefront/client/src/pages/apps/[appId]/knowledge-bases/[kbId]/index.tsx b/wavefront/client/src/pages/apps/[appId]/knowledge-bases/[kbId]/index.tsx index abe1efec..c7b1ad0f 100644 --- a/wavefront/client/src/pages/apps/[appId]/knowledge-bases/[kbId]/index.tsx +++ b/wavefront/client/src/pages/apps/[appId]/knowledge-bases/[kbId]/index.tsx @@ -53,7 +53,7 @@ const KnowledgeBaseDetailPage: React.FC = () => { // Create System Prompt Dialog state const [showCreatePromptModal, setShowCreatePromptModal] = useState(false); const [systemPrompt, setSystemPrompt] = useState(''); - const [selectedConfigId, setSelectedConfigId] = useState(''); + const [selectedConfigId, setSelectedConfigId] = useState(null); const [creatingPrompt, setCreatingPrompt] = useState(false); // Test Inference Dialog state @@ -147,7 +147,7 @@ const KnowledgeBaseDetailPage: React.FC = () => { queryClient.invalidateQueries({ queryKey: getKnowledgeBaseInferencesKey(appId || '', kbId || '') }); setShowCreatePromptModal(false); setSystemPrompt(''); - setSelectedConfigId(''); + setSelectedConfigId(null); } else { notifyError('Failed to create system prompt.'); } @@ -162,7 +162,7 @@ const KnowledgeBaseDetailPage: React.FC = () => { const handleCloseCreatePromptModal = () => { setShowCreatePromptModal(false); setSystemPrompt(''); - setSelectedConfigId(''); + setSelectedConfigId(null); }; const handleOpenTestInference = (inferenceId: string) => { @@ -488,7 +488,11 @@ const KnowledgeBaseDetailPage: React.FC = () => { - setSelectedConfigId(value ?? null)} + disabled={llmConfigs.length === 0} + > diff --git a/wavefront/client/src/store/notification-store.ts b/wavefront/client/src/store/notification-store.ts index ea839c17..19f1407b 100644 --- a/wavefront/client/src/store/notification-store.ts +++ b/wavefront/client/src/store/notification-store.ts @@ -1,6 +1,6 @@ import { create } from 'zustand'; -type TToastType = 'success' | 'error' | 'warning' | null; +export type TToastType = 'success' | 'error' | 'warning' | null; type State = { visible: boolean; diff --git a/wavefront/client/src/types/tts-config.ts b/wavefront/client/src/types/tts-config.ts index 34a2991e..26f33c12 100644 --- a/wavefront/client/src/types/tts-config.ts +++ b/wavefront/client/src/types/tts-config.ts @@ -71,5 +71,4 @@ export interface CartesiaParameters { model?: string; // default: 'sonic-2' language?: string; // Language enum speed?: number; - emotion?: string[]; }