diff --git a/application/llm/openai.py b/application/llm/openai.py index 36861584..b8f311b0 100644 --- a/application/llm/openai.py +++ b/application/llm/openai.py @@ -85,7 +85,6 @@ class OpenAILLM(BaseLLM): **kwargs, ): messages = self._clean_messages_openai(messages) - print(messages) if tools: response = self.client.chat.completions.create( model=model, diff --git a/frontend/src/components/SkeletonLoader.tsx b/frontend/src/components/SkeletonLoader.tsx index b73c5835..2433110a 100644 --- a/frontend/src/components/SkeletonLoader.tsx +++ b/frontend/src/components/SkeletonLoader.tsx @@ -91,18 +91,18 @@ const SkeletonLoader: React.FC = ({ ); const renderLogs = () => ( -
+
{[...Array(8)].map((_, idx) => (
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index d60b531a..305c4973 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -634,47 +634,46 @@ function ToolCalls({ toolCalls }: { toolCalls: ToolCallsType[] }) { title={`${toolCall.tool_name} - ${toolCall.action_name.substring(0, toolCall.action_name.lastIndexOf('_'))}`} className="w-full rounded-[20px] bg-gray-1000 dark:bg-gun-metal hover:bg-[#F1F1F1] dark:hover:bg-[#2C2E3C]" titleClassName="px-6 py-2 text-sm font-semibold" - children={ -
-
-

- - Arguments - {' '} - -

-

- - {JSON.stringify(toolCall.arguments, null, 2)} - -

-
-
-

- - Response - {' '} - -

-

- - {JSON.stringify(toolCall.result, null, 2)} - -

-
+ > +
+
+

+ + Arguments + {' '} + +

+

+ + {JSON.stringify(toolCall.arguments, null, 2)} + +

- } - /> +
+

+ + Response + {' '} + +

+

+ + {JSON.stringify(toolCall.result, null, 2)} + +

+
+
+ ))}
diff --git a/frontend/src/modals/AddActionModal.tsx b/frontend/src/modals/AddActionModal.tsx index a2160146..c7c813c3 100644 --- a/frontend/src/modals/AddActionModal.tsx +++ b/frontend/src/modals/AddActionModal.tsx @@ -1,21 +1,21 @@ import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; -import WrapperModal from './WrapperModal'; import Input from '../components/Input'; import { ActiveState } from '../models/misc'; +import WrapperModal from './WrapperModal'; + +type AddActionModalProps = { + modalState: ActiveState; + setModalState: (state: ActiveState) => void; + handleSubmit: (actionName: string) => void; +}; const isValidFunctionName = (name: string): boolean => { const pattern = /^[a-zA-Z0-9_-]+$/; return pattern.test(name); }; -interface AddActionModalProps { - modalState: ActiveState; - setModalState: (state: ActiveState) => void; - handleSubmit: (actionName: string) => void; -} - export default function AddActionModal({ modalState, setModalState, @@ -23,21 +23,20 @@ export default function AddActionModal({ }: AddActionModalProps) { const { t } = useTranslation(); const [actionName, setActionName] = React.useState(''); - const [functionNameError, setFunctionNameError] = useState(false); // New error state + const [functionNameError, setFunctionNameError] = useState(false); const handleAddAction = () => { if (!isValidFunctionName(actionName)) { - setFunctionNameError(true); // Set error state if invalid + setFunctionNameError(true); return; } - setFunctionNameError(false); // Clear error state if valid + setFunctionNameError(false); handleSubmit(actionName); + setActionName(''); setModalState('INACTIVE'); }; - // Only render when modal is active if (modalState !== 'ACTIVE') return null; - return ( setModalState('INACTIVE')} @@ -47,27 +46,32 @@ export default function AddActionModal({

New Action

-
+
+ + Action Name + setActionName(e.target.value)} + onChange={(e) => { + const value = e.target.value; + setActionName(value); + setFunctionNameError(!isValidFunctionName(value)); + }} borderVariant="thin" - placeholder="Enter name" - label="Action Name" + placeholder={'Enter name'} /> -

- Use only letters, numbers, underscores, and hyphens (e.g., - `get_user_data`, `send-report`). +

+ {functionNameError + ? 'Invalid function name format. Use only letters, numbers, underscores, and hyphens.' + : 'Use only letters, numbers, underscores, and hyphens (e.g., `get_data`, `send_report`, etc.)'}

- {functionNameError && ( -

- Invalid function name format. Use only letters, numbers, - underscores, and hyphens. -

- )}
-
+
-
- {userTools.filter((tool) => - tool.displayName - .toLowerCase() - .includes(searchTerm.toLowerCase()), - ).length === 0 ? ( -
- No tools found - {t('settings.tools.noToolsFound')} + {loading ? ( +
+
+
- ) : ( - userTools - .filter((tool) => - tool.displayName - .toLowerCase() - .includes(searchTerm.toLowerCase()), - ) - .map((tool, index) => ( -
-
-
- {`${tool.displayName} -
+ ) : ( +
+ {userTools.filter((tool) => + tool.displayName + .toLowerCase() + .includes(searchTerm.toLowerCase()), + ).length === 0 ? ( +
+ No tools found + {t('settings.tools.noToolsFound')} +
+ ) : ( + userTools + .filter((tool) => + tool.displayName + .toLowerCase() + .includes(searchTerm.toLowerCase()), + ) + .map((tool, index) => ( +
+
+
{t('settings.tools.settingsIconAlt')} - + +
+
+

+ {tool.displayName} +

+

+ {tool.description} +

+
-
-

- {tool.displayName} -

-

- {tool.description} -

+
+
-
- -
-
- )) - )} -
+ )) + )} +
+ )}