Commit Graph

10220 Commits

Author SHA1 Message Date
c4b86e9d63 Fix: Clicking tags on share modal updates store immediately (#2720)
* Fix: Click tags on share modal share component to the store immediately

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-16 14:41:28 +00:00
a534ac7619 chore: make error messages more generic (#2726)
* chore: make error messages more generic

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-16 14:24:08 +00:00
7d3fac6f10 fix: update chat components to make them backwards compatible (#2725)
* feat: Add conditional check for storing message in ChatOutput

* refactor: Update store_message method in ChatComponent for backward compatibility

* refactor: update input name to not collide with method name
2024-07-16 11:19:53 -03:00
e56a1c1e10 Improve Makefile: color output, clean commands, dependency checks (#2672)
* feat: Add Gemma 2 to Groq model list (#2586)

Add gemma2 to groq_constants.py

* Improve Makefile: color output, clean commands, dependency checks

- Add colored output to 'make help' for various shells.
- Add 'clean_all', 'clean_python_cache', and 'clean_npm_cache' commands.
- Check for installed tools: 'poetry', 'docker', 'pipx', and 'npm'.

* Added success message at the end of the check_tools target to indicate all required tools are installed.
2024-07-16 09:56:05 +00:00
5ef84f7911 feat: add CrewAI components and refactor codebase (#2647)
* feat: Add CrewAI icon component

This commit adds the CrewAI icon component to the project. The component is imported and used in the styleUtils file, allowing it to be used throughout the application. This addition enhances the visual representation of the CrewAI feature in the user interface.

* feat: Add CrewAI[tools] dependency to project

This commit adds the CrewAI dependency to the project by including it in the pyproject.toml file. The version specified is "^0.36.0" and the "tools" extras are included. This addition allows the project to utilize the features provided by CrewAI.

* fix: update crewai icon size

* feat: Add CrewAIAgent component

This commit adds the CrewAIAgent component to the project. The component represents an agent of CrewAI and includes various inputs and outputs for role, goal, backstory, tools, language model, memory, verbosity, and delegation. This addition enhances the functionality of the project by integrating with CrewAI and allows for more advanced agent-based interactions.

* feat: Add CrewAICrew component

This commit adds the CrewAICrew component to the project. The component represents a group of agents and defines how they should collaborate and the tasks they should perform. It includes various inputs and outputs for tasks, agents, topic, verbosity, memory, cache, max RPM, process, and more. This addition enhances the functionality of the project by integrating with CrewAI and allows for more advanced agent-based interactions.

* feat: Add CrewAITask component

This commit adds the CrewAITask component to the project. The component represents a task in CrewAI and includes inputs for description, expected output, tools, agent, and async execution. It also provides an output for the task itself. This addition enhances the functionality of the project by integrating with CrewAI and allows for the creation and execution of tasks within the system.

* refactor: Update build configuration in custom_component_update endpoint

This commit updates the build configuration in the custom_component_update endpoint of the endpoints.py file. The previous implementation was assigning the result of code_request.get_template() directly to the build_config parameter, which caused an issue. The updated code now assigns the result to the updated_build_config variable before passing it to the cc_instance.update_build_config() method. This change ensures that the correct build configuration is used and improves the functionality of the custom_component_update endpoint.

* feat: Add SequentialTask and HierarchicalTask classes

This commit adds the SequentialTask and HierarchicalTask classes to the tasks.py file in the base/agents/crewai directory. These classes represent different types of tasks in the CrewAI system. The SequentialTask class is used for sequential tasks, while the HierarchicalTask class is used for hierarchical tasks. This addition enhances the functionality of the project by providing the necessary classes for implementing different types of tasks in CrewAI.

* refactor: Update CrewAIAgentComponent class name

This commit updates the class name from "CrewAIAgent" to "CrewAIAgentComponent" in the CrewAIAgent.py file. The new name better reflects the nature of the class as a component and improves the clarity of the codebase.

* refactor: Update CrewAICrewSequential component

This commit adds the CrewAICrewSequential component to the project. The component represents a group of agents and defines how they should collaborate and the tasks they should perform in a sequential manner. It includes various inputs and outputs for tasks, verbosity, memory, cache, max RPM, and more. This addition enhances the functionality of the project by providing a specific component for sequential tasks in the CrewAI system.

* feat: Add CrewAICrewHierarchical component

This commit adds the CrewAICrewHierarchical component to the project. The component represents a group of agents and defines how they should collaborate and the tasks they should perform in a hierarchical manner. It includes various inputs and outputs for tasks, verbosity, memory, cache, max RPM, and more. This addition enhances the functionality of the project by providing a specific component for hierarchical tasks in the CrewAI system.

* refactor: Rename CrewAITask.py to CrewAITaskHierarchical.py

This commit renames the file "CrewAITask.py" to "CrewAITaskHierarchical.py" in the "helpers" directory of the "langflow/components/helpers" package. The new name better reflects the purpose of the file, which is to define the "CrewAITaskHierarchical" component. This change improves the clarity and organization of the codebase.

* feat: Add CrewAITaskSequential component

This commit adds the CrewAITaskSequential component to the project. The component represents a sequential task in CrewAI and includes inputs for task description, expected output, tools, agent, and async execution. It also provides an output for the task itself. This addition enhances the functionality of the project by integrating with CrewAI and allows for the creation and execution of sequential tasks within the system.

* feat: Add BaseCrewComponent class

This commit adds the BaseCrewComponent class to the project. The class represents a group of agents, defining how they should collaborate and the tasks they should perform. It includes various inputs and outputs for tasks, verbosity, memory, cache, max RPM, and more. This addition enhances the functionality of the project by providing a base component for creating and managing crews in the CrewAI system.

* refactor: Update display name of CrewAIAgentComponent to "CrewAI Agent"

* refactor: Remove CrewAICrewHierarchical component

This commit removes the CrewAICrewHierarchical component from the project. The component represented a group of agents and defined how they should collaborate and the tasks they should perform in a hierarchical manner. However, it is no longer needed and has been deemed unnecessary for the current project requirements. This removal streamlines the codebase and improves the clarity of the project.

* refactor: make Crew use BaseCrew class

* refactor: Replace CrewAICrewSequential with SequentialCrew

This commit replaces the deprecated CrewAICrewSequential component with the new SequentialCrew component. The SequentialCrew component represents a group of agents and defines how they should collaborate and the tasks they should perform in a sequential manner. This change improves the clarity and organization of the codebase by using a more descriptive and consistent naming convention for the component. It also aligns with the recent refactorings in the project, such as the removal of the CrewAICrewHierarchical component and the addition of the BaseCrewComponent class. Overall, this update enhances the functionality and maintainability of the project.

* refactor: Rename CrewAITaskHierarchical.py to HierarchicalTask.py

This commit renames the file "CrewAITaskHierarchical.py" to "HierarchicalTask.py" in the "helpers" directory of the "langflow/components/helpers" package. The new name better reflects the purpose of the file, which is to define the "HierarchicalTask" component. This change improves the clarity and organization of the codebase.

* refactor: Rename CrewAITaskSequential.py to SequentialTask.py

This commit renames the file "CrewAITaskSequential.py" to "SequentialTask.py" in the "helpers" directory of the "langflow/components/helpers" package. The new name better reflects the purpose of the file, which is to define the "SequentialTaskComponent" component. This change improves the clarity and organization of the codebase.

* style: reorder imports

* chore: update lock

* refactor: Refactor build_crew method in BaseCrewComponent

This commit refactors the build_crew method in the BaseCrewComponent class. The method was previously taking tasks and agents as arguments, but it was not using them correctly. This update removes the unnecessary arguments and fixes the method to correctly build a Crew object. This refactor improves the clarity and functionality of the codebase.

* refactor: Update status assignment in CrewAIAgentComponent

This commit updates the status assignment in the CrewAIAgentComponent class. Previously, the status was set using the `model_dump()` method of the agent, but it has been changed to use the `repr()` method instead. This change improves the clarity and consistency of the codebase.

* refactor: Add agents input to HierarchicalCrewComponent

This commit adds the "agents" input to the HierarchicalCrewComponent class in the "HierarchicalCrew.py" file. The "agents" input is a list of "Agent" objects and allows for better management and collaboration between agents within the crew. This addition enhances the functionality and flexibility of the HierarchicalCrewComponent, improving the overall codebase.

* refactor: Fix post_process_raw function in artifact.py

This commit fixes the post_process_raw function in the artifact.py file. Previously, the function was not correctly handling the case when the raw data was a BaseModel or a dictionary. This update ensures that the raw data is properly encoded using jsonable_encoder and updates the artifact_type accordingly. This fix improves the functionality and reliability of the codebase.

* refactor: Update CustomComponent's repr_value handling

This commit updates the repr_value handling in the CustomComponent class. Previously, the repr_value was being modified directly within the class, which could lead to unexpected behavior. This update ensures that the repr_value is returned instead of modifying it directly. Additionally, it adds proper handling for different types of repr_value, such as dictionaries and BaseModel objects. This refactor improves the clarity and maintainability of the codebase.

* update lock

* refactor: Add task input to SequentialTaskComponent

This commit adds the "task" input to the SequentialTaskComponent class in the "SequentialTask.py" file. The "task" input is a SequentialTask object that will perform the task. This addition enhances the functionality and flexibility of the SequentialTaskComponent, improving the overall codebase.

* refactor: Change log level of file retrieval message in LocalStorageService

* refactor(crew.py): update import statement to include InputTypes from langflow.inputs.inputs module to enhance code readability and maintainability

* chore: Update cachetools dependency to version 5.4.0

* feat(crew.py): add new methods get_task_callback and get_step_callback to handle task and step callbacks respectively

* refactor: Add allow_code_execution input to CrewAIAgentComponent

This commit adds the "allow_code_execution" input to the CrewAIAgentComponent class in the "CrewAIAgent.py" file. The "allow_code_execution" input is a boolean value that determines whether the agent is allowed to execute code. This addition enhances the functionality and flexibility of the CrewAIAgentComponent, improving the overall codebase.

* Add step_callback and task_callback inputs to HierarchicalCrewComponent and SequentialCrewComponent

* style(SequentialTask.py): remove unnecessary 'required' attribute from input definition in SequentialTaskComponent class

* chore: fix lint issues
2024-07-15 16:56:47 -07:00
e1542dc672 chore: update setuptools dependency to version 70 or higher (#2713)
* chore: Update setuptools dependency to version 70 or higher

* chore: new lock
2024-07-15 15:22:03 -07:00
3edc782545 fix: Update telemetry schema to allow for optional error message (#2711) 2024-07-15 20:18:07 +00:00
6e006354c3 fix: update telemetry schema and fix telemtry calls (#2708) 2024-07-15 16:16:23 -03:00
4268ee4d56 chore: Update python_test.yml to include splitCount and group arguments in make unit_tests command (#2709) 2024-07-15 16:13:26 -03:00
c8d04af533 refactor(CustomComponent): make initialization separate from constructor (#2704) 2024-07-15 18:37:10 +00:00
d93382e90a refactor: runnable_vertices_manager.py (#2646)
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-15 17:57:00 +00:00
537e358b65 fix: update condition to run end_all_traces (#2707) 2024-07-15 09:13:49 -07:00
a3959650fc refactor: store tags API (#2678)
* feat: create useGetTags hook to handle tags API

* refactor: use useGetTagsQuery hook to handle tags

* [autofix.ci] apply automated fixes

* refactor: remove unnecessary state handling

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-15 12:39:25 +00:00
85161650bc feat: Add the ability to hide/show components without input/output (I/O). (#2669)
♻️ (use-row-data.tsx): remove redundant check for LANGFLOW_SUPPORTED_TYPES in useRowData hook
2024-07-12 21:13:32 +00:00
b0bdfa211f refactor: store likes API (#2661)
* feat: create usePostLikeComponent hook to handle store like API

* refactor: use usePostLikeComponent hook to handle store likes

* [autofix.ci] apply automated fixes

* refactor: use mutate loading instead of managing loading with react state

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-12 17:53:59 -03:00
f5f5141cc4 fix: check if vertex is in vertices_being_run to check if it is runnable (#2668)
Co-authored-by: Cristhian Zanforlin Lousa <72977554+Cristhianzl@users.noreply.github.com>
2024-07-12 20:26:05 +00:00
dc5ac092fb test: Add Test to Prevent Bug on Output Inspection for Grouped Components (#2667)
* add new test for bug on output inspection + grouped components

* [autofix.ci] apply automated fixes

* 🔧 (typescript_test.yml): increase shard count from 14 to 15 to distribute tests more evenly
🔧 (typescript_test.yml): fix syntax issues in conditional expressions

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-12 20:10:00 +00:00
c8d7f47070 feat: Add milvus vector store (#2634)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-12 12:47:55 -07:00
844da96bd2 fix: update starter projects (#2665) 2024-07-12 18:55:00 +00:00
c47c358cad feat: add payload validation, update Simple API Test fixture, run tests (#2664) 2024-07-12 18:15:43 +00:00
cdb8c80a7e fix: prevent to loop on keys of object profile pictures when It's not loaded yet (#2658)
🐛 (use-preload-images.tsx): add null check for profilePictures to prevent errors when profilePictures is undefined

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-12 17:43:24 +00:00
6bc0766929 chore: update package versions (#2663) 2024-07-12 17:15:18 +00:00
eb0a70f646 fix: adjust function that add incremental name on flows that already exists + tests (#2645)
* 🐛 (reactflowUtils.ts): fix addVersionToDuplicates to exclude the updated flow from existing names to prevent naming conflicts

*  (menuBar): add data-testid to flow configuration button for testing
 (sideBarFolderButtons): add data-testid to delete folder button for testing
 (folders.spec.ts): update test to use new data-testid for delete folder button
 (generalBugs-shard-4.spec.ts): add new end-to-end test for flow operations

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-12 17:14:38 +00:00
ef6d954357 fix: optimize filtering of vertices in useFlowStore (#2662)
Refactor the filtering logic in the useFlowStore hook to optimize the performance. The code changes ensure that the nextVertices array is filtered correctly by excluding vertices that already exist in the last layer.

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-12 16:37:47 +00:00
c88e9af121 feat: refactor memories (#2621)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-12 09:30:04 -07:00
ccd6d1c666 fix: coroutine is not iterable when using redis (#2655) 2024-07-12 09:29:08 -07:00
c522a7aae7 feat: Add JSON Cleaner Component (#2584)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-12 09:26:14 -07:00
8813143622 fix: add try catch on fenet decrypt to prevent errors (#2660) 2024-07-12 09:25:44 -07:00
229b8680f7 fix: fix bug on row selection at IO modal (#2627)
* feat: optimize filtering of messages in SessionView component

The code changes in this commit optimize the filtering of messages in the SessionView component. The useMemo hook is used to memoize the filteredMessages array, which improves performance by avoiding unnecessary re-rendering.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-12 15:28:56 +00:00
74252aa76a fix: handle sender_name passed as data or message (#2653) 2024-07-12 04:59:43 -07:00
34ef234c42 fix: enable copy when dict is disabled (#2642)
 (dictAreaModal): add customizeCopy function to copy JSON to clipboard
2024-07-11 18:47:00 -03:00
7d7502744e fix: update Multiselect component to use 'values' prop instead of 'value' (#2640) 2024-07-11 22:21:41 +02:00
52db335b51 fix: remove unnecessary encode from API key decryption (#2641) 2024-07-11 17:49:01 +00:00
b8cc5a58aa chore: update dependencies for langflow and langflow-base packages (#2638) 2024-07-11 10:34:11 -07:00
7d3d621045 docs: make astra vectorize provider key advanced param (#2639) 2024-07-11 19:11:38 +02:00
180e475cc3 Frontend Feature: Multiselect ui-component and merge refs hook (#2405)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-11 09:14:10 -07:00
feed388857 fix: qdrant with ingest not working (#2636) 2024-07-11 09:12:22 -07:00
ab0ab5f306 perf: improve /logs concurrent access (#2633)
* perf: improve /logs concurrent access

* perf: improve /logs concurrency access

* fix

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-11 15:06:34 +00:00
3d0845c8bd feat: update starter projects (#2630) 2024-07-11 16:05:08 +02:00
81849d5f8b feat: log retriever endpoint (#2601)
* log retriever endpoint

* disabled by default

* realtime log stream via http/2 SSE

* read and write lock

* unit test
2024-07-11 11:19:21 +02:00
7bd105007e feat: add opentelemetry utility functions and unit tests (#2570)
* add opentelemetry utility functions and unit tests

* review comments

* add label validation
2024-07-10 15:01:38 -04:00
fb39c095da fix: issue with freeze value on page refresh (#2623) 2024-07-10 18:51:14 +00:00
aa1958a4ad feat: refactor graph vertex sorting (#2583)
* refactor: extract method from class to new func

* test: add new tests

* refactor: simplify funcs to improve readability

* refactor: extract new func from larger func

* refactor: remove recursion from func

* refactor: remove coupling with graph and vertex

* refactor: create adapter funcs to use new code

* refactor: add test for sorting up to vertex N with is_start=True

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-10 07:37:39 -07:00
3406575c67 feat: add Maritalk model component (#2595)
* feat: add Maritalk icon

* feat: add Maritalk model component

* fix: update icon size

* feat: optimize MaritalkModelComponent initialization

This commit optimizes the initialization of the MaritalkModelComponent class in the Maritalk.py file. It updates the default value for the 'temperature' parameter to be within the range of 0 to 1, using the RangeSpec class. This ensures that the temperature value is valid and improves the overall functionality of the component.

* style: format maritalk svg

* feat: optimize MaritalkModelComponent initialization

This commit optimizes the initialization of the MaritalkModelComponent class in the Maritalk.py file. It updates the default value for the 'temperature' parameter to be within the range of 0 to 1, using the RangeSpec class. This ensures that the temperature value is valid and improves the overall functionality of the component.

* feat: update 'stream' parameter to be advanced in MaritalkModelComponent

This commit updates the 'stream' parameter in the MaritalkModelComponent class to be an advanced option. By setting the 'advanced' attribute to True, the 'stream' parameter will only be visible to advanced users. This change improves the usability of the component by hiding this option from regular users who do not need it.
2024-07-10 09:13:19 -03:00
05044a3434 feat: migrate agents and toolkits to Component syntax (#2579)
* feat: migrate agents and toolkits to Component syntax

* fix mypy

* fix mypy

* [autofix.ci] apply automated fixes

* fix mypy

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-10 05:09:14 -07:00
9c41b0c895 fix: azure embeddings models with fixed dimensions fail (#2619)
* fix: azure embeddings models with fixed dimensions fail

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-10 04:53:23 -07:00
7414a01235 fixing ThreadingInMemoryCache usage (#2604)
* ThreadingInMemoryCache usage is broken. This commit addresses those issues along with missing documentation about the caching options.

* make lint & make unit_tests fixes

* removing unnecessary changes from unclear test results in  last run

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-10 04:52:37 -07:00
d28fe8eedc fix: Improve vertex filtering and update is_vertex_runnable logic (#2612)
* feat: improve is_vertex_runnable method in RunnableVerticesManager

This commit improves the `is_vertex_runnable` method in the `RunnableVerticesManager` class. It adds an additional parameter `activated_vertices` to the method signature and updates the logic to check if a vertex is runnable based on the presence of activated vertices. This enhancement improves the accuracy of determining whether a vertex is runnable or not.

* fix: add predecessors to vertices_to_run

* style: fix lint issues

* feat: optimize vertex filtering in useFlowStore

This commit optimizes the vertex filtering logic in the `useFlowStore` function in `flowStore.ts`. It introduces a more efficient way to filter out vertices that are already being built, resulting in improved performance and accuracy.

* refactor: add is_active method to Vertex class

This commit adds the `is_active` method to the `Vertex` class in the `base.py` file. The `is_active` method checks if the state of the vertex is set to `ACTIVE` and returns a boolean value accordingly. This enhancement improves the readability and maintainability of the codebase.

* refactor: improve is_vertex_runnable method in RunnableVerticesManager

* refactor: improve find_runnable_predecessors_for_successors method in Graph class

* refactor: move test_create_function
2024-07-10 07:40:16 -03:00
46966d164d tests: fix up the astra integ tests and add vectorize tests (#2616)
* fix up the astra integ tests and add vectorize tests

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-10 11:32:34 +02:00
7174e6ef7d fix: show loading component state while images arent fully loaded (#2609)
*  (ProfilePictureForm): add loading state to handle initial loading state

* ♻️ (use-get-profile-pictures.ts): refactor profile pictures query to process data on the server side
♻️ (ProfilePictureForm): simplify state management by removing redundant loading state

* ♻️ (use-get-profile-pictures.ts): rename ProfilePicturesResponse to ProfilePicturesQueryResponse for clarity
♻️ (use-preload-images.tsx): add loading check to useEffect to prevent unnecessary execution
♻️ (profilePictureChooserComponent): update profilePictures prop type to handle undefined and add loading to usePreloadImages
♻️ (ProfilePictureForm): remove unnecessary state and use response directly from useGetProfilePicturesQuery

* 🐛 (use-preload-images.tsx): add missing dependency 'loading' to useEffect dependency array to ensure images are preloaded correctly
2024-07-09 19:57:46 -03:00