Commit graph

5,043 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
cd3f6c4c52 chore: fix lint errors (#2445)
* chore: Fix type hinting in ConditionalRouterComponent

* refactor: Update PassComponent to PassMessageComponent
2024-07-01 13:53:55 -03:00
italojohnny
9f2e608fcd fix delete messages 2024-07-01 13:53:55 -03:00
autofix-ci[bot]
70e9f06834 [autofix.ci] apply automated fixes 2024-07-01 13:53:55 -03:00
Rodrigo
093fa018f1 feat: Add CreateListComponent for creating a list of texts
This commit adds a new component called CreateListComponent, which is responsible for creating a list of texts. The component takes in one or more texts as input and outputs a list of Data objects. This component is useful for scenarios where a list of texts needs to be processed or manipulated.

The CreateListComponent class is added to the helpers module in the langflow.components package. It includes the necessary inputs and outputs, as well as a create_list method that generates the list of Data objects based on the input texts.

This commit also includes some minor changes to other files, such as renaming the UUIDGeneratorComponent to IDGeneratorComponent and updating import statements.
2024-07-01 13:53:55 -03:00
Gabriel Luiz Freitas Almeida
b19264506c chore: Add inputs parameter to end method in BaseTracer 2024-07-01 13:53:39 -03:00
Gabriel Luiz Freitas Almeida
a180e9e7c4 chore: Update LangSmithTracer constructor parameter type to UUID 2024-07-01 13:53:39 -03:00
Gabriel Luiz Freitas Almeida
293adb0417 🐛 (custom_component.py): fix issue where name was not being set correctly when name is None and self.display_name is True 2024-07-01 13:53:39 -03:00
Gabriel Luiz Freitas Almeida
08b2322a73 ♻️ (base.py): Refactor add_trace and end_trace methods to use Union type for optional arguments to improve code readability and type safety 2024-07-01 13:53:39 -03:00
Gabriel Luiz Freitas Almeida
e94d8254fb 📝 (base.py): add abstract method __init__ to BaseTracer class with required parameters to enforce implementation in subclasses 2024-07-01 13:53:39 -03:00
Gabriel Luiz Freitas Almeida
f8ace79af3 chore: Add metadata parameter to end method in BaseTracer
This commit adds a new optional `metadata` parameter to the `end` method in the `BaseTracer` class. The `metadata` parameter allows for passing additional information related to the tracing process. This enhancement provides more flexibility and extensibility to the tracing functionality.
2024-07-01 13:53:39 -03:00
Gabriel Luiz Freitas Almeida
67a34ffcb8 Refactor: handle error when retrieving messages from monitor service
This commit refactors the code in the `migrate_messages_from_monitor_service_to_database` function to handle errors that may occur when retrieving messages from the monitor service. If an exception is raised, the error is logged and the function returns `False`. This ensures that the migration process can continue even if there is an issue with retrieving the messages.
2024-07-01 13:53:39 -03:00
Gabriel Luiz Freitas Almeida
089ad6695c chore: Update LangSmithTracer import in tracing service 2024-07-01 13:53:39 -03:00
Gabriel Luiz Freitas Almeida
2efaa2804a refactor: Update LangSmithTracer to use convert_to_langchain_types from utils.py 2024-07-01 13:53:39 -03:00
Gabriel Luiz Freitas Almeida
d7008f7662 refactor: Remove unused methods and abstract class from BaseTracer 2024-07-01 13:53:39 -03:00
Gabriel Luiz Freitas Almeida
3ba8a19545 refactor: Update logs to outputs in CustomComponent and TracingService classes 2024-07-01 13:53:39 -03:00
italojohnny
b99f292f1c create an abstract class for an existing class 2024-07-01 13:53:39 -03:00
Gabriel Luiz Freitas Almeida
e9091b9946 feat: Add default value for index field in DuckDbMessageModel
This commit adds a default value of `None` for the `index` field in the `DuckDbMessageModel` class. The default value is set using the `Field` class from the `pydantic` library, with the `default` parameter set to `None` and the `alias` parameter set to "index". This change ensures that the `index` field is optional and can be omitted when creating instances of the `DuckDbMessageModel` class.

Note: The commit message has been generated based on the provided code changes and recent commits.
2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
335cd40418 fix: webhook endpoint passes webhook input as is 2024-07-01 13:53:38 -03:00
Ítalo Johnny
d840a52377 Fix Image Display Issue on Windows by Setting a Static Path (#2382)
change string path
2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
4120fa7538 Add JSON Mode option to OpenAIModelComponent (#2386)
* feat: Add JSON Mode option to OpenAIModelComponent

* ♻️ (OpenAIModel.py): add type ignore comment

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
4ee8698533 Refactor Graph class to consider inactivated vertices in is_vertex_runnable and find_runnable_predecessors_for_successors 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
fb3c61f3b3 chore: Refactor RunnableVerticesManager to consider inactivated vertices in is_vertex_runnable and find_runnable_predecessors_for_successors 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
c3393b5ee5 chore: makes sure end_all_traces run concurrently 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
b57880742d chore: update lock 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
2161fa5c08 chore: Set default value for ttl_seconds to None in CassandraVectorStoreComponent 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
cf7776462e chore: Import firecrawl integration package in FirecrawlCrawlApi and FirecrawlScrapeApi
This commit imports the firecrawl integration package in the FirecrawlCrawlApi and FirecrawlScrapeApi files. It ensures that the package is available for use in the code. If the package is not installed, an ImportError is raised with instructions to install it using `pip install firecrawl-py`.
2024-07-01 13:53:38 -03:00
autofix-ci[bot]
a58f15a97b [autofix.ci] apply automated fixes 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
6428ef7f67 refactor: Update DuckDbMessageModel import in monitor service
This commit updates the import statement for the `DuckDbMessageModel` class in the `monitor/service.py` file. The import is modified to reflect the recent changes made to the `monitor/schema.py` file, where the `DuckDbMessageModel` class was added. This update ensures that the correct class is imported and used in the `add_row` method of the `MonitorService` class.
2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
d633e64439 refactor: Add index field to DuckDbMessageModel in monitor schema
This commit adds the `index` field to the `DuckDbMessageModel` class in the `monitor/schema.py` file. The `index` field is of type `int` and is used to store the index value for the message. This modification enhances the schema of the `DuckDbMessageModel` and allows for more efficient querying and sorting of messages based on their index.
2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
6921d61300 refactor: Remove error handling for migrating messages from monitor service to database 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
162d9edb55 refactor: Update migrate_messages_from_monitor_service_to_database function in utils.py
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.
2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
e456b006ea refactor: Update from_message method in MessageBase model to accept UUID as flow_id parameter 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
e6d1b2bc93 add type ignore 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
1ffc4212bc ♻️ (utils.py): ignore type error 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
fab1e327aa feat: Add field validation for flow_id in MessageTable model
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.
2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
cbe3a05ebe feat: Migrate messages from monitor service to database 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
f7a61f5847 feat: Add flow_id serialization in Message class
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.
2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
46dcc2ef56 Migrate messages from monitor service to database 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
163c70e027 feat: Add flow_id assignment in MessageBase constructor 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
be0065fb2d chore: Update schema and service files for DuckDbMessageModel 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
10361dd3a9 feat: Migrate messages from monitor service to database
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.
2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
c478b6135f refactor: Improve readability and avoid variable shadowing in flows.py 2024-07-01 13:53:38 -03:00
rodrigosnader
9ac094b661 Apply Ruff formatting 2024-07-01 13:53:38 -03:00
Rodrigo
add2c48ab1 Update StoreMessageComponent for enhanced message handling 2024-07-01 13:53:38 -03:00
rodrigosnader
a892a5e126 Apply Ruff formatting 2024-07-01 13:53:38 -03:00
Rodrigo
384fc7e2c0 Update StoreMessageComponent for enhanced message handling
- 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
2024-07-01 13:53:38 -03:00
italojohnny
a8a8fbd351 fix condition stop 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
5cefc8755b refactor: Add field_validator for files in MessageBase model 2024-07-01 13:53:38 -03:00
Gabriel Luiz Freitas Almeida
d1d5eb6e39 refactor: Update add_messages and add_messagetables functions to return Message objects 2024-07-01 13:53:37 -03:00
Gabriel Luiz Freitas Almeida
b2888e1a84 refactor: Remove unused imports and optimize get_messages function 2024-07-01 13:53:37 -03:00