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.
- 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
- Add `useDataEffect` to handle data-related side effects
- Add `useInstallComponent` to manage component installation logic
- Add `useLikeComponent` to handle like functionality
- Add `useDragStart` to manage drag start events
- Add `usePlaygroundEffect` to handle playground-related side effects
✨ (cardComponent): add custom hooks for data, install, like, drag start, and playground effects
♻️ (cardComponent): rename state variables for consistency and readability
✨ (MainPage): add CollectionCard component to handle card rendering and interactions
✨ (index.tsx): add CollectionCard component to ComponentsComponent
♻️ (index.tsx): refactor to use CollectionCard instead of inline code
* chore: Add check-format script to package.json for code formatting consistency
* chore: Update lint-js.yml to use npm run check-format instead of npm run format
* add test to decision flow
* add test to decision flow
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* chore: update linting workflows to include dev branch in merge_group
* Update README.md
Add 1.0 banner
* Update README.md
* chore: update package versions in pyproject.toml files
* Added db value to every onChange on parameters
* Refactored global variables to find variables on the first render, and to execute just one onChange to update both values and db
* Changed group recursion function to include check for global variables already applied or outdated
* Removed already inserted component check for default fields on global variables
* Fixed import error
* Added required parameters to update node on drop
* Removed check for unused hardcoded name
* Added global variables handling on nodes when adding a flow
* Fixed maximum update depth when deleting used global variable
* Fixed type error on addNewVariableButton modal
* Fixed openai api key on starter flows
* Fixed values to get the .env values by default on the starter projects
* Formatted flows
* fix erros reported by mypy
* [autofix.ci] apply automated fixes
* 🐛 (prototypes/__init__.py): fix missing comma in the list of imported components to prevent syntax error
* chore: Fix type hinting in ConditionalRouterComponent
* [autofix.ci] apply automated fixes
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* feat: Add LanguageModel to field_typing module
* chore: Fix type annotations in model build methods
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>