This commit refactors the migrate_messages_from_monitor_service_to_database function in utils.py to correctly handle the session_id parameter. The session_id is now included in the key used to filter out messages that already exist in the database, ensuring that duplicate messages are not inserted. This improves the data integrity and consistency of the database.
This commit adds field validation for the `flow_id` attribute in the `MessageTable` model. The `validate_flow_id` class method is implemented to ensure that the `flow_id` value is either `None` or a valid UUID. This validation helps maintain data integrity and consistency when working with the `MessageTable` model.
This commit adds the `serialize_flow_id` method to the `Message` class in the `message.py` file. This method serializes the `flow_id` attribute of a `Message` object, converting it to a UUID if it is a string. This ensures consistent serialization of the `flow_id` attribute when working with the `Message` class.
This commit migrates messages from the monitor service to the database. It adds a new function `migrate_messages_from_monitor_service_to_database` in the `utils.py` file, which retrieves messages from the monitor service, adds them to the database, and deletes them from the monitor service. This migration ensures that messages are stored in the database for better reliability and retrieval.
The auto-update workflow has been added to the repository. This workflow will automatically trigger on pushes to the `dev` and `main` branches. It runs on the latest version of Ubuntu and uses the `tibdex/auto-update@v2` action to perform the auto-update process.
- Changed base class from CustomComponent to Component
- Added multiple input fields: message, sender, sender_name, session_id
- Included output field for stored messages
- Improved logic to handle both string and Message types
- Enhanced error handling and validation for message storage
📝 (memory.py): Refactor delete_messages function to use SQLAlchemy delete statement for better performance and readability
📝 (monitor/schema.py): Update MessageModel to use UUID type for id and flow_id for consistency and better data handling
This commit refactors the add_messages function in memory.py to use a database session for adding messages to the monitor service. Instead of directly calling the monitor_service.add_message method, the messages are now added using a session object. This change ensures that the messages are properly persisted in the database and improves the reliability of the application.
This commit adds a new table called "message" to the database. The table includes columns for timestamp, sender, sender_name, session_id, text, id, flow_id, and files. The "message" table is created using Alembic migration. This addition allows for storing and retrieving messages in the application.
💡 (use-dropdown-options.tsx): add TypeScript types to function parameters
💡 (use-api-keys.tsx): add TypeScript types to function parameters
💡 (use-handle-delete-key.tsx): add TypeScript types to function parameters
💡 (use-preload-images.tsx): add TypeScript types to function parameters
💡 (use-patch-password.tsx): add TypeScript types to function parameters
💡 (use-patch-profile-picture.tsx): add TypeScript types to function parameters
💡 (use-save-key.tsx): add TypeScript types to function parameters
💡 (use-scroll-to-element.tsx): add TypeScript types to function parameters
💡 (use-messages-table.tsx): add TypeScript types to function parameters
💡 (use-remove-messages.tsx): add TypeScript types to function parameters
💡 (use-updateMessage.tsx): add type annotations to setSuccessData and setErrorData for better type safety and code clarity
💡 (index.tsx): add non-null assertion operator to playground variable
♻️ (use-on-file-drop.tsx): add type annotations for folderId and folderChangeCallback
♻️ (use-auto-resize-text-area.tsx): add type annotations for value and inputRef
♻️ (use-drag-and-drop.tsx): add type annotations for setIsDragging, setFiles, currentFlowId, and setErrorData
♻️ (use-focus-unlock.tsx): add type annotations for lockChat and inputRef
♻️ (use-upload.tsx): add type annotations for uploadFile, currentFlowId, setFiles, and lockChat
♻️ (use-column-defs.tsx): add type annotation for myData
♻️ (use-row-data.tsx): add type annotations for myData and open
♻️ (index.tsx): remove commented-out code
♻️ (use-filtered-flows.tsx): add type annotations for flowsFromFolder, searchFlowsComponents, and setAllFlows
💡 (index.tsx): add non-null assertion operator to flowsFromFolder variable