Commit graph

580 commits

Author SHA1 Message Date
ogabrielluiz
2dddfe4aea refactor: Update import statements in CassandraMessageReader and CassandraMessageWriter 2024-06-11 10:15:02 -03:00
ogabrielluiz
0014d8e50a Merge remote-tracking branch 'origin/dev' into two_edges 2024-06-11 09:52:41 -03:00
YAMON.IO
11b5aad3bd
add PythonCodeStructuredTool (#1747)
* Create PythonStructuredTool

This draft involves receiving two 'Code' types as inputs and creating a structured tool.

* Delete src/backend/base/langflow/components/experimental/PythonStructuredTool

* Create PythonCodeStructuredTool.py
2024-06-11 05:42:49 -07:00
Gabriel Luiz Freitas Almeida
e28962cbc4
Update Couchbase component and package versions (#2138)
* feat: Update Couchbase component to handle import errors

* chore: Update package versions in pyproject.toml and poetry.lock

* refactor: Fix encoding issue in read_text_file function

* 🐛 (parse.py): fix issue where method was always set to "post" when data or data binary was provided in curl command

* refactor: Fix string formatting in MonitorService delete_messages method

* fix: Update Couchbase import instructions in CouchbaseComponent

* refactor: Fix encoding issue in read_text_file function
2024-06-11 05:33:23 -07:00
ogabrielluiz
f6fabac477 update projects 2024-06-10 21:24:43 -03:00
ogabrielluiz
6d51386b83 Merge remote-tracking branch 'origin/dev' into two_edges 2024-06-10 21:07:02 -03:00
Jordan Frazier
11ef216c0a
feat: add cassandra components (#2056)
* Add cassandra store component

* Add cassandra search component

* revert poetry changes

* fix type

* Add cassandra icon

* Add Cassandra Message Writer

* Add cassandra message reader

* poetry

* Fix init of cass reader

* move cassio import to base project and inline imports in backend

* running make format

* remove file

* remove cassio import

* update lockfile

* Actually update lockfile:

* merge fixes
2024-06-10 15:04:24 -07:00
ogabrielluiz
b5ead60ac9 update projects 2024-06-10 19:00:44 -03:00
ogabrielluiz
108514b734 refactor: Update langflow/custom/custom_component/component.py to cache output values for improved performance 2024-06-10 19:00:31 -03:00
ogabrielluiz
4d11c76476 refactor: Update ChatInput and ChatOutput to use Message instead of Record for input and output 2024-06-10 19:00:09 -03:00
ogabrielluiz
cf99a5ffa7 refactor: Update setup.py to handle new output types in source node 2024-06-10 18:59:07 -03:00
ogabrielluiz
af38ec4580 refactor: Add log method to CustomComponent for logging messages 2024-06-10 16:16:50 -03:00
ogabrielluiz
bde49ba286 refactor: Remove unused imports and update artifact type handling 2024-06-10 16:16:27 -03:00
ogabrielluiz
921250cbe1 Merge branch 'cz/mergeAll' into two_edges 2024-06-10 15:57:46 -03:00
ogabrielluiz
1726561f39 format 2024-06-10 15:16:49 -03:00
ogabrielluiz
f872a3e753 refactor: Update SelfQueryRetrieverComponent build method to handle different input types 2024-06-10 14:30:05 -03:00
ogabrielluiz
24e8da5086 refactor: Update ChromaComponent build method to allow duplicates in the Vector Store 2024-06-10 14:30:05 -03:00
ogabrielluiz
becdb49661 refactor: Rename 'document' variable to 'text' in chroma_collection_to_records function 2024-06-10 14:30:05 -03:00
ogabrielluiz
6c27964edd 🐛 (custom_component.py): fix resolving path logic to handle empty path input and check if path parts exist before accessing the first part 2024-06-10 14:12:50 -03:00
ogabrielluiz
0de6c2a88f feat: Update Prompt class to assign formatted prompt to self.text 2024-06-10 14:12:32 -03:00
ogabrielluiz
f8aa1274fc (record.py): add __eq__ method to compare Record instances based on their data attribute 2024-06-10 14:12:24 -03:00
ogabrielluiz
6eac507eb9 feat: Update RecordsOutput build method to set status 2024-06-10 14:11:43 -03:00
ogabrielluiz
65037a43a5 refactor: Update session_id parameter in build_and_cache_graph_from_db function 2024-06-10 14:11:04 -03:00
ogabrielluiz
23b2bf2358 feat: Add SelfQueryRetrieverComponent to langflow retrievers 2024-06-10 12:59:06 -03:00
ogabrielluiz
7557c7979c refactor: add utility function for converting chroma collection to records 2024-06-10 12:02:53 -03:00
ogabrielluiz
8848360845 refactor: Update output types in setup.py
The output types in the setup.py file have been updated to reflect the changes made in the source node's output types. This ensures consistency and accuracy in the data flow.

Note: The commit message has been generated based on the provided code changes and recent commits.
2024-06-10 11:39:49 -03:00
ogabrielluiz
2ab49133fa refactor: Remove unused BranchComponent and Decision classes
The BranchComponent and Decision classes in langchain_utilities/Branch.py and schema/decision.py respectively have been removed as they are no longer needed in the codebase.

Note: The commit message has been generated based on the provided code changes and recent commits.
2024-06-10 11:39:40 -03:00
ogabrielluiz
b255a0cae1 📝 (types.py): Update import statements to include log_transaction function for better code organization and readability 2024-06-10 11:38:42 -03:00
ogabrielluiz
802b624621 refactor: Update import statement for Record in component.py
The import statement for the Record class in component.py has been updated to reflect the correct module path after a recent refactoring.

Note: The commit message has been generated based on the provided code changes and recent commits.
2024-06-10 11:38:16 -03:00
ogabrielluiz
735a7e3780 Merge cz/mergeAll to two_edges 2024-06-10 11:31:02 -03:00
italojohnny
05fd2ff67b fix: freeze 2024-06-10 09:13:30 -03:00
Lucas Oliveira
666815f996 Fixed formatting of jsons 2024-06-10 08:09:31 -03:00
Rodrigo
ec3c2b3ab7 refactor: Update display names for input fields in ChatComponent and TextInput
This commit updates the display names for the input fields in the ChatComponent and TextInput classes. The display name for the "Message" input field in ChatComponent is changed to "Text", and the display name for the "Value" input field in TextInput is changed to "Text". These updates improve the clarity and consistency of the input field labels.

Fixes #<issue_number>
2024-06-09 23:09:01 -03:00
Rodrigo
4de1a3afd9 add temporary fix for message["type"] 2024-06-09 23:08:15 -03:00
YAMON.IO
b40bb95909
refactor: Include Missing Field in Tool Status (#2118)
Modified the status to include args_schema when the tool has it.

You can use this translation in your commit message.
2024-06-09 18:01:27 -07: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
Nicolò Boschi
87e2ccdb37
openai model spec openai_api_base should be an advanced option (#2091) 2024-06-09 06:19:07 -07:00
ming
7ebaf2914c
fix lint - type mismatch (#2117)
* fix lint

* empty commit to trigger ci flow
2024-06-09 06:18:27 -07:00
italojohnny
d738f4ca78 fix: Prevent params overwrite for session_id key 2024-06-09 09:42:30 -03:00
Lucas Oliveira
98dcadc797 Merge remote-tracking branch 'origin/cz/mergeAll' into fix/edited_component 2024-06-07 20:06:50 -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
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
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
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
982c33b476 chore: Update package versions in pyproject.toml files 2024-06-07 16:32:37 -03:00