Commit graph

11,136 commits

Author SHA1 Message Date
Rodrigo
4de1a3afd9 add temporary fix for message["type"] 2024-06-09 23:08:15 -03:00
Gabriel Luiz Freitas Almeida
df57570852
refactor: migrate from Record to Message (#2113)
* chore: Update launch.json to use debugpy instead of python for debugging

* refactor: Update import statements for Record in langflow components

* feat: Add image handling functionality to langflow schema

* update projects

* 📝 (constants.py): Add 'output_types' to NODE_FORMAT_ATTRIBUTES for consistency and completeness

♻️ (setup.py): Refactor imports to improve readability and maintainability
♻️ (setup.py): Update code to remove fields that are not in the latest template for consistency

* refactor: Update schema from Record to Message

* refactor: Remove print statement in MonitorService

* refactor: Remove fields not in the latest template for consistency

* refactor: Update code to handle Record objects in utils.py

* update projects

* 📝 (monitor.py): Add type hint for message_id parameter in update_message function
📝 (parse.py): Rename ParsedContext to ParsedArgs for clarity
📝 (chat.py): Remove unused imports and methods in ChatComponent class
📝 (StoreMessage.py): Change return type of store_message method from list[Record] to list[Message]
📝 (base.py): Change type hint from Dict[str, str | list[str]] to Mapping[str, str | list[str]] in update_raw_params method
📝 (loading.py): Add condition to check if raw is not None before accessing its attributes in instantiate_custom_component function
📝 (memory.py): Change return type of get_messages function from list[Record] to list[Message]
📝 (memory.py): Change parameter type of add_messages function from Message to Message | list[Message]
📝 (image.py): Add type hint for image_prompt_value variable in Message class

🐛 (record.py): fix type hint for image_prompt_value variable to ImagePromptValue to improve code clarity and maintainability

* chore: Add orjson options for serialization

* chore: Update orjson options for serialization in setup.py

* chore: Update input_value options for models

This commit updates the input_value options for the models in the `OpenAIModel.py`, `MistralModel.py`, `CohereModel.py`, `VertexAiModel.py`, `ChatLiteLLMModel.py`, `OllamaModel.py`, `HuggingFaceModel.py`, `AnthropicModel.py`, and `AmazonBedrockModel.py` files. The `input_value` now supports the additional input type "Prompt". This change allows for more flexibility in the input data that can be provided to the models.

Fixes #<issue_number>

* chore: Update edges with latest component versions

This commit updates the edges in the project data with the latest component versions. It ensures that the source and target nodes are correctly updated based on their corresponding nodes in the project. The commit also includes escaping of JSON dumps for the source and target handles in the edges.

* 📝 (utils.py): Remove unnecessary async keyword from dict_values_to_string function to improve code readability and consistency
🔧 (utils.py): Simplify handling of Message objects by directly accessing the text property instead of calling to_lc_message() method

* chore: Refactor PromptComponent to use updated Prompt class and remove unused imports

* feat: Add support for image files in Message model

This commit modifies the Message model to support image files as attachments. It introduces the `is_image_file` function to check if a file is an image, and the `to_content_dict` method in the Image class to convert the image object to a content dictionary. Additionally, the `get_file_content_dicts` method is added to generate content dictionaries for all files in the message, including images. This enhancement improves the handling of image attachments in the messaging system.

Fixes #<issue_number>

* update projects and lock

* chore: Update LCModelComponent to use Prompt instead of Record

* refactor: Update artifact type to include message in utils.py

* fix: Add check for input_value to only pass if string

*  (switchOutputView/index.tsx): introduce constant RECORD_TYPES to store valid record types for better readability and maintainability
🔧 (switchOutputView/index.tsx): refactor switch cases to use RECORD_TYPES constant for checking valid record types and simplify the logic for handling different types of result messages

* feat: Enable loading from database for openai_api_key field in Langflow starter projects

This commit updates the Langflow starter projects by enabling the loading of the `openai_api_key` field from the database. Previously, the field was not being loaded from the database, but now it will be loaded and used in the projects. This change improves the functionality and flexibility of the projects.

Fixes #<issue_number>

* ♻️ (constants.py): remove unnecessary import statement and clean up code formatting in ORJSON_OPTIONS constant definition

* refactor: Update MemoryComponent to use messages instead of records

This commit updates the MemoryComponent class in the langflow/components/helpers/MemoryComponent.py file to use the term "messages" instead of "records" for better clarity and consistency. It also updates the get_messages method to return a list of Message objects instead of Record objects. This change improves the naming and readability of the code.

* refactor: Update Message model to include timestamp conversion function

This commit updates the Message model in the langflow/schema/message.py file to include a new function `_timestamp_to_str` that converts the timestamp to a string format. This function is used as a BeforeValidator for the `timestamp` field, ensuring that it is always formatted correctly. This change improves the consistency and reliability of the timestamp handling in the messaging system.

* refactor: Update test_data_components.py to improve directory component loading

This commit updates the test_data_components.py file to improve the loading of the directory component. It ensures that the directory component can load mdx files from the ../docs/docs/components directory. This change enhances the functionality and reliability of the directory component.

Fixes #<issue_number>

* refactor: Update .gitattributes to specify working-tree-encoding for .mdx and .json files

This commit updates the .gitattributes file to specify the working-tree-encoding for .mdx and .json files. It sets the encoding to UTF-8 for both file types, ensuring consistent handling of character encoding. This change improves the reliability and compatibility of the repository.

Fixes #<issue_number>

* fix: 🐛 corrects encoding error

* refactor: Update toolkits.mdx to improve documentation and fix formatting

* refactor: Add dictdiffer library as a dependency

This commit adds the dictdiffer library as a dependency in the poetry.lock file. The dictdiffer library is a useful tool for diffing and patching dictionaries. It will enhance the functionality and flexibility of the project.
2024-06-09 18:00:48 -07:00
Rodrigo
3ddd42b127 chore: Update display name for input field in ChatComponent 2024-06-09 17:17:16 -03:00
italojohnny
565df927dc add exception to Credentials vars in session_id fields 2024-06-09 16:01:42 -03:00
italojohnny
d738f4ca78 fix: Prevent params overwrite for session_id key 2024-06-09 09:42:30 -03:00
anovazzi1
ea2f1c54e8 chore: Update outputModal size prop to "medium-tall" 2024-06-08 16:31:49 -03:00
anovazzi1
a6026944a8 make readonly edit record table on outputPreview 2024-06-08 16:19:35 -03:00
anovazzi1
0c5e054985 chore: Update cardComponent and button styles
This commit updates the styles of the cardComponent and button components.

In the cardComponent, the height of the card is changed to a fixed value of 11rem, which improves the consistency of the card layout.

In the button component, the "gap-2" class is removed from the button variants, which removes the gap between the button icon and label. This change enhances the visual appearance of the buttons.

These style updates improve the overall user experience and visual consistency of the application.

Fixes #<issue_number>
2024-06-08 15:32:17 -03:00
anovazzi1
2202540a06 remove rows animation 2024-06-08 15:19:37 -03:00
anovazzi1
6917bf66a2 add default profile pic 2024-06-08 15:19:20 -03:00
anovazzi1
719c031212 feat: Add drag and drop file upload functionality to chat input
This commit adds the drag and drop file upload functionality to the chat input component in the IOModal. It allows users to drag and drop files into the chat input area for uploading. The files are then processed and added to the chat message.

Files are validated to ensure they have the correct file extensions (png, jpg, jpeg, gif, bmp, webp) before uploading. If an invalid file is dropped, an error message is displayed.

This feature improves the user experience by providing a convenient way to upload files in the chat input.

Fixes #2115
2024-06-08 13:41:29 -03:00
anovazzi1
770dff7075 chore: Update tab label in IOModal component 2024-06-08 13:06:52 -03:00
Rodrigo
e5f404e863 chore: Update selected color in index.css 2024-06-08 13:05:06 -03:00
anovazzi1
e02195024b chore: Update connection color in index.css 2024-06-08 12:55:39 -03:00
anovazzi1
8d9808d58e fix edge selection state 2024-06-08 12:51:04 -03:00
anovazzi1
740cb874c9 update CheckCodeValidity 2024-06-08 12:01:15 -03:00
anovazzi1
2055be160a chore: Add early return for CustomComponent in useCheckCodeValidity hook 2024-06-08 11:55:05 -03:00
anovazzi1
c9e591a492 Refactor profile picture chooser component to support dark mode 2024-06-08 11:40:19 -03:00
Lucas Oliveira
8fba139bfa
Added updatable components and avatar (#2115)
## Features:

- Avatar Selection within certain images
- Update more obvious and appearing only when component is not edited by
user
2024-06-08 01:08:36 +02:00
Lucas Oliveira
98dcadc797 Merge remote-tracking branch 'origin/cz/mergeAll' into fix/edited_component 2024-06-07 20:06:50 -03:00
Lucas Oliveira
b801689f32 Implemented image at header and implemented horizontal scroll 2024-06-07 20:05:52 -03:00
anovazzi1
5e07d99cc6 Refactor: Improve column state change handling in TableComponent 2024-06-07 20:02:41 -03:00
anovazzi1
98175bc72c Merge branch 'cz/mergeAll' of personal:langflow-ai/langflow into cz/mergeAll 2024-06-07 19:56:49 -03:00
anovazzi1
d46f7ab708 remove tooltip 2024-06-07 19:56:36 -03:00
cristhianzl
b3a3e7b8e5 ♻️ (schema.py): remove unnecessary blank line to improve code readability
♻️ (service.py): reformat SQL query string for better readability
♻️ (utils.py): remove unnecessary blank line to clean up code
2024-06-07 19:53:40 -03:00
cristhianzl
817f85cfaf Merge branch 'cz/mergeAll' of https://github.com/langflow-ai/langflow into cz/mergeAll 2024-06-07 19:53:29 -03:00
cristhianzl
37193b0031 (monitor.py): enhance transaction response with additional fields
♻️ (base.py): refactor log_transaction to include flow_id for better traceability
♻️ (vertex/base.py): refactor log_transaction to include flow_id for better traceability
 (schema.py): add flow_id and make outputs optional in TransactionModel
♻️ (service.py): update SQL query to include new fields and order by timestamp
♻️ (utils.py): update log_transaction to include flow_id and handle optional outputs
💄 (index.tsx): fix linting issues and update button component
 (chatInputOutputUser.spec.ts): add additional steps to end-to-end test for chat functionality
2024-06-07 19:53:04 -03:00
anovazzi1
a6d51567b7 chore: Update TableAutoCellRender to handle object rendering in ArrayReader component 2024-06-07 19:47:56 -03:00
igorrCarvalho
5e28f2d005 Refactor: Block user from sending files that are not images extensions 2024-06-07 19:15:39 -03:00
Lucas Oliveira
79e3321a85 Added cancelling handle 2024-06-07 19:15:26 -03:00
Lucas Oliveira
73511c72ca Added stop signal to not let the request happen twice 2024-06-07 19:15:26 -03:00
Lucas Oliveira
a2485d1797 Added a Loading component and added a border to the current image 2024-06-07 19:15:26 -03:00
italojohnny
08a259da86 add endpoint to download profile picture 2024-06-07 18:49:28 -03:00
italojohnny
c467cc649a add endpoint to list all profile pictures 2024-06-07 18:49:20 -03:00
italojohnny
7e84cf8ec7 add function to copy profile pictures 2024-06-07 18:49:11 -03:00
igorrCarvalho
44fbc4ebdc Fix: Image files displaying as normal files 2024-06-07 18:47:19 -03:00
igorrCarvalho
bf61c339e1 Fix: disable file paste when chat are locked 2024-06-07 18:28:58 -03:00
igorrCarvalho
0d3780826d Fix: block file clip input when chat input are blocked 2024-06-07 17:50:15 -03:00
igorrCarvalho
7f616aec8b Fix: Download Button trigger chat 2024-06-07 17:31:22 -03:00
ogabrielluiz
c4cdb186b8 chore: Update import statement for CustomComponent in validate.py 2024-06-07 16:35:28 -03:00
ogabrielluiz
4e104b7c12 fix: Correct flow retrieval by endpoint name instead of flow name 2024-06-07 16:32:37 -03:00
ogabrielluiz
a96a02d0c1 chore: Update Dockerfile to remove frontend build artifacts 2024-06-07 16:32:37 -03:00
ogabrielluiz
982c33b476 chore: Update package versions in pyproject.toml files 2024-06-07 16:32:37 -03:00
cristhianzl
d7fef29fa3 Merge branch 'cz/mergeAll' of https://github.com/langflow-ai/langflow into cz/mergeAll 2024-06-07 16:22:09 -03:00
cristhianzl
ef6d39c14d (tests): add end-to-end test for sending an image in chat
 (tests): introduce chain.png asset for image upload test
2024-06-07 16:21:39 -03:00
ogabrielluiz
64e5eaf99d refactor: Update log_transaction function to include target vertex in transaction data 2024-06-07 16:21:20 -03:00
ogabrielluiz
d0ae3835b4 refactor: Update build_and_cache_graph_from_db function to use truthiness check for session_id 2024-06-07 16:21:07 -03:00
cristhianzl
c7851a8ed4 Merge branch 'cz/mergeAll' of https://github.com/langflow-ai/langflow into cz/mergeAll 2024-06-07 16:10:25 -03:00
cristhianzl
84a87a3c39 ♻️ (chatView, flowStore): refactor message handling for consistency 2024-06-07 16:10:05 -03:00
anovazzi1
48a429e033 Merge branch 'cz/mergeAll' of personal:langflow-ai/langflow into cz/mergeAll 2024-06-07 15:59:38 -03:00