Commit graph

5,500 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
1dcb71b952 🐛 fix(base.py): handle case when base_type is None to avoid ValueError
The code now checks if the `base_type` attribute is None before attempting to instantiate a class. If `base_type` is None, a ValueError is raised with a descriptive error message. This fix prevents potential errors when the `base_type` is not found for a given node.
2023-07-05 17:21:03 -03:00
anovazzi1
e832711a1f first modal with subcomponents 2023-07-05 17:04:32 -03:00
Gabriel Luiz Freitas Almeida
d9891b9c86 🔧 chore(base.py): refactor code to improve readability and handle optional parameters
📝 chore(base.py): update comments and remove unused imports
The code in the `Vertex` class has been refactored to improve readability and handle optional parameters more effectively. The code now checks if a parameter is of type "code", "str", or "prompt" and if it is not already set in the `params` dictionary, it sets it to the corresponding value from the `value` dictionary. Additionally, if a parameter is not required and not set in the `params` dictionary, it checks if a default value is provided and sets it to the default value if available, otherwise it removes the parameter from the `params` dictionary. This change improves the handling of optional parameters and makes the code more maintainable.
2023-07-05 17:00:50 -03:00
Cristhian Zanforlin Lousa
6be38af44e merge fix 2023-07-05 16:48:44 -03:00
Gabriel Luiz Freitas Almeida
2fcc8296d2 formatting 2023-07-05 16:45:45 -03:00
Gabriel Luiz Freitas Almeida
df09f6119d 📝 docs(README.md): fix typo in Langflow to LangFlow for consistency
The typo in the word "LangFlow" has been fixed to ensure consistency in the naming convention used throughout the project.
2023-07-05 16:42:47 -03:00
Gabriel Luiz Freitas Almeida
b71913a0aa 🐛 fix(__main__.py): change word variable from "LangFlow" to "Langflow" for consistency
🐛 fix(schemas.py): change class name from "ExportedFlow" to "Exported flow from Langflow" for consistency
The word variable in __main__.py is changed from "LangFlow" to "Langflow" to maintain consistency in naming conventions. Similarly, the class name in schemas.py is changed from "ExportedFlow" to "Exported flow from Langflow" for consistency in naming conventions.
2023-07-05 16:42:13 -03:00
Gabriel Luiz Freitas Almeida
a73737435b 📝 docs(CONTRIBUTING.md): update project name to "Langflow" for consistency
📝 docs(README.md): update project name to "Langflow" for consistency
📝 chore(frontend): update project name in HTML title tag to "Langflow" for consistency
The project name "LangFlow" has been updated to "Langflow" for consistency throughout the documentation and codebase. This change improves readability and maintains a consistent naming convention.
2023-07-05 16:41:57 -03:00
Gabriel Luiz Freitas Almeida
90acee2273 🐛 fix(constants.tsx): fix typo in flow name from LangFlow to Langflow
🐛 fix(tabsContext.tsx): fix typo in variable name from LangFlowState to LangflowState
🐛 fix(flow_constants.tsx): fix typo in description from LangFlow to Langflow
🐛 fix(chatModal/index.tsx): fix typo in chat modal title from LangFlow Chat to Langflow Chat
🐛 fix(importModal/index.tsx): fix typo in import modal title from LangFlow Examples to Langflow Examples
🐛 fix(CommunityPage/index.tsx): fix typo in community page text from LangFlow to Langflow
🐛 fix(FlowPage/index.tsx): fix typo in flow page text from LangFlow to Langflow

The changes were made to fix typos in various parts of the codebase where the name "LangFlow" was misspelled as "Langflow". This improves consistency and ensures that the correct name is used throughout the application.
2023-07-05 16:41:35 -03:00
Lucas Oliveira
87061316b3 formatted code 2023-07-05 16:36:28 -03:00
Gabriel Luiz Freitas Almeida
14d50c878c 🔖 chore(pyproject.toml): update package version to 0.2.13
The package version has been updated from 0.2.12 to 0.2.13. This change is made to reflect the latest changes and improvements in the package.
2023-07-05 16:35:24 -03:00
Lucas Oliveira
e2a066d7f2 Added checks to see if the chat can open 2023-07-05 16:30:46 -03:00
Gabriel Luiz Freitas Almeida
68906407e7
Merge branch 'main' into release 2023-07-05 16:25:24 -03:00
Igor Carvalho
9922ea0593 feat: Add alerts tailwind constants classes 2023-07-05 16:12:48 -03:00
anovazzi1
b7124de011 Merge branch 'python_custom_node_component' of personal:logspace-ai/langflow into python_custom_node_component 2023-07-05 16:04:47 -03:00
anovazzi1
754cfceab6 feat(twoColumnsModal): add TwoColumnsModal component to display a modal with two columns
The TwoColumnsModal component is added to display a modal with two columns. It takes the following props:
- title: the title of the modal
- description: the description of the modal
- open: a boolean indicating whether the modal is open or not
- setOpen: a function to set the open state of the modal

The component renders a Dialog component from the ui/dialog module. It consists of a DialogTrigger, DialogContent, DialogHeader, DialogTitle, and DialogDescription. The DialogContent has a minimum width of 80vw.

Inside the DialogContent, there is a flex container with a height of 80vh and width of 100%. It contains two divs: one with a width of 2/5 and the other with a width of the remaining space.

The TwoColumnsModal component also exports two additional components: first and second. These components can be used as children of the TwoColumnsModal component to render content in the first and second columns, respectively.
2023-07-05 16:04:42 -03:00
gustavoschaedler
f12efa104d Refactor API v1 endpoints and remove unnecessary imports and code duplication
The `endpoints` module in the API v1 folder has been modified to remove an unnecessary import and some code duplication. These changes improve the code organization and maintainability.

This commit also removes a commented-out test endpoint that was intended for testing purposes but was never used. The endpoint has been removed from the codebase to avoid confusion and clutter.

The changes include removing an unused import statement from the module and removing an unused endpoint. The unused endpoint was a commented-out code block that contained example error responses. Since these examples were not needed for testing or documentation purposes, the endpoint has been safely removed.
2023-07-05 19:59:38 +01:00
gustavoschaedler
ecbb0feeab Refactor tools and constants modules
- Refactored the tools module to improve code readability and maintainability.
- Fixed import statements in the constants module to correctly import modules.
- Updated documentation and added comments for better understanding of the code.
2023-07-05 19:57:28 +01:00
gustavoschaedler
e3b6037fe9 Merge from form_io to python_custom_node_component 2023-07-05 19:56:41 +01:00
Gabriel Luiz Freitas Almeida
9c97490fd4
Merge pull request #613 from logspace-ai:fix_dotenv
🔧 chore(__main__.py): add load_params() function to load parameters from environment variables
2023-07-05 15:54:24 -03:00
Igor Carvalho
fa628a04fd feat: Add generic node tailwind constants classes 2023-07-05 15:50:57 -03:00
Gabriel Luiz Freitas Almeida
5138129003 🔧 chore(__main__.py): add load_params() function to load parameters from environment variables
The load_params() function is added to load the parameters from the environment variables. This allows for more flexibility and configurability of the application by allowing the parameters to be set via environment variables.
2023-07-05 15:41:49 -03:00
Gabriel Luiz Freitas Almeida
31c361ce23
Release 0.2.12 (#612) 2023-07-05 15:13:02 -03:00
Gabriel Luiz Freitas Almeida
0743e306c9
Merge branch 'main' into release 2023-07-05 15:11:51 -03:00
Gabriel Luiz Freitas Almeida
0b61a682cd
Added better CLI docs in README and bumps langchain-serve (#611) 2023-07-05 15:10:39 -03:00
Gabriel Luiz Freitas Almeida
08bc992d63 🔖 chore(pyproject.toml): update package version to 0.2.12
The package version has been updated from 0.2.11 to 0.2.12. This change is made to reflect the latest changes and improvements in the package.
2023-07-05 14:57:48 -03:00
Gabriel Luiz Freitas Almeida
92aa40db65
Added better CLI docs in README and bumps langchain-serve (#590) 2023-07-05 14:54:18 -03:00
Gabriel Luiz Freitas Almeida
3c13f87495
Merge branch 'release' into jcloud_fix 2023-07-05 14:48:29 -03:00
Gabriel Luiz Freitas Almeida
f7515eb7bd 📚 docs(README.md): update table of contents and headings for better organization and readability
🔧 chore(README.md): reformat and update CLI section for clarity and consistency
The README.md file has been updated to improve the organization and readability of the document. The table of contents has been updated to include all relevant sections. Headings have been adjusted to provide a clear hierarchy and improve navigation. The CLI section has been reformatted and updated to provide clearer instructions and explanations.
2023-07-05 14:45:28 -03:00
anovazzi1
b5c7646b37 fix(codeAreaModal): update error state type to match API response structure for better error handling
feat(codeAreaModal): add support for displaying error details and traceback in the error tab for better debugging
refactor(codeAreaModal): improve code readability and formatting for better maintainability
2023-07-05 14:01:09 -03:00
gustavoschaedler
68c6ac8ea2 Refactor base class removal logic and add dict representation
- Extracted the logic for removing unwanted base classes to a separate method called `process_base_classes`.
- Created a list `CLASSES_TO_REMOVE` which contains the names of the base classes to be removed.
- Updated `to_dict` method to call `process_base_classes` before generating the dict representation of the frontend node.
- Added a new method `process_base_classes` which removes the unwanted base classes from the list of base classes.
- The method `process_base_classes` updates the `base_classes` list, removing any base classes present in `CLASSES_TO_REMOVE`.

This commit enhances the code by separating the concerns of base class removal logic and dict representation generation.
2023-07-05 17:23:53 +01:00
Gabriel Luiz Freitas Almeida
611cb7f57c 📝 docs(README.md): Add CLI usage and environment variables sections to the README
The README file now includes a new section that provides information on how to use the command-line interface (CLI) of Langflow. It explains the available options and their usage. Additionally, a section on environment variables is added, which explains how to configure CLI options using environment variables. This provides users with more flexibility in customizing the behavior of the Langflow server.
2023-07-05 13:07:16 -03:00
Gabriel Luiz Freitas Almeida
70b634cbcf 🔧 chore(__main__.py): refactor serve function to use environment variables for configuration options
🌟 feat(__main__.py): add support for environment variables to configure serve function
The serve function in __main__.py has been refactored to use environment variables for configuration options. The following configuration options now support environment variables: host, workers, port, log_level, log_file, path, open_browser, and remove_api_keys. This change allows for greater flexibility and easier configuration of the serve function by using environment variables instead of command line options.
2023-07-05 13:07:02 -03:00
Gabriel Luiz Freitas Almeida
29f840aed9 🔧 chore(.env.example): update example values and add new configuration options
The .env.example file has been updated to include example values and new configuration options. The LANGFLOW_DATABASE_URL example has been updated to include both Postgres and SQLite examples. New configuration options have been added for cache type, server host, worker processes, server port, logging level, log file path, frontend directory path, whether to open the browser after starting the server, and whether to remove API keys from the projects saved in the database. These changes provide more flexibility and customization options for the application.
2023-07-05 13:06:50 -03:00
gustavoschaedler
ae5bc1e203 Refactor custom.py for better error handling
- Modifies the `CustomComponent` class to handle errors using `HTTPException` from FastAPI
- Removes the unused `HTTPExceptionWithTraceback` class
- Updates the error response format with `err.msg` and `traceback.format_exc()`
2023-07-05 16:23:32 +01:00
gustavoschaedler
a21582589c import custom.py: Add HTTPExceptionWithTraceback class
This commit adds a new class `HTTPExceptionWithTraceback` that extends `HTTPException` from the `fastapi` module. This new class includes a `traceback` attribute. Additionally, in the `extract_class_info` method of the `CustomComponent` class, a try-except block is added to catch any syntax errors raised by parsing the provided code. If a syntax error is encountered, an HTTPException is raised with the error message and traceback.
2023-07-05 16:22:22 +01:00
Gabriel Luiz Freitas Almeida
95b8555503 🐛 fix(settings.py): change environment variable name from LANGFLOW_DATABASE_URL to langflow_database_url for consistency
The environment variable name is changed from LANGFLOW_DATABASE_URL to langflow_database_url to maintain consistency with the naming conventions used in the codebase. This ensures that the code is more readable and easier to understand.
2023-07-05 12:10:32 -03:00
Gabriel Luiz Freitas Almeida
8214b22c09 🔧 chore(__main__.py): update cache and database environment variable names for clarity and consistency
The `cache` option has been changed to use the `LANGFLOW_LANGCHAIN_CACHE` environment variable instead of `LANGCHAIN_CACHE` for clarity and consistency. Similarly, the `database_url` option now uses the `LANGFLOW_DATABASE_URL` environment variable instead of the previous behavior of using a local SQLite database by default. This change allows for more flexibility in configuring the cache and database connections.
2023-07-05 12:10:09 -03:00
Gabriel Luiz Freitas Almeida
4b1fb4a49e 🐛 fix(utils.py): rename cache_class variable to cache_type for clarity and consistency
🔧 chore(utils.py): refactor `setup_llm_caching` to extract cache setup logic into a separate function for better modularity and readability
The variable `cache_class` has been renamed to `cache_type` to improve clarity and consistency with the naming conventions. The `setup_llm_caching` function has been refactored to extract the cache setup logic into a separate function called `set_langchain_cache`. This improves modularity and readability of the code.
2023-07-05 12:09:53 -03:00
Gabriel Luiz Freitas Almeida
cb1ab1a79e 📝 docs(.env.example): add example .env file with langflow_database_url set to sqlite database URL
The .env.example file is added to provide an example of how to configure the .env file. It includes a commented out example of a PostgreSQL database URL and a new line is added with the langflow_database_url set to a SQLite database URL. This allows users to easily copy the file to .env and modify the values according to their needs.
2023-07-05 12:00:42 -03:00
anovazzi1
53cfec6321
Add round buttons constants classes (#609)
Improves code verbosity and organization of Tailwind classes.
2023-07-05 11:59:43 -03:00
Gabriel Luiz Freitas Almeida
8cee7e701f 🔺 chore(pyproject.toml): update langchain-serve version to >0.0.51
The langchain-serve package has been updated to version >0.0.51. This update may include bug fixes, new features, or other improvements.
2023-07-05 11:54:41 -03:00
anovazzi1
d93dbef31b style(index.css): remove unused text-color class and update components-disclosure-title class to use text-primary class for consistent styling
style(DisclosureComponent): update Icon class to use text-primary class for consistent styling
style(FlowPage): remove logspace-icon-text class and update the structure of the icon and text elements for better alignment and spacing
2023-07-05 11:51:06 -03:00
Gabriel Luiz Freitas Almeida
552edf072b 🔧 chore(settings.py): make database_url optional to handle cases where it is not provided
The `database_url` setting is now declared as an optional string (`Optional[str]`) instead of a required string. This change allows the application to handle cases where the `database_url` is not provided, providing more flexibility in the configuration.
2023-07-05 11:50:32 -03:00
Gabriel Luiz Freitas Almeida
d713d38ca7 🔧 chore(__main__.py): refactor loading of environment variables to allow overriding with .env file
The os module is imported to make use of the os.getenv() function. The loading of the environment variables is refactored to check for the presence of the "langflow_database_url" environment variable and use it as the value for the database_url variable if it is not provided. This allows for more flexibility in configuring the database URL. Additionally, the loading of environment variables is refactored to allow overriding with a .env file if the env_file parameter is provided. This allows for easier configuration management.
🔧 chore(__main__.py): import os module and refactor loading of environment variables
2023-07-05 11:50:07 -03:00
Gabriel Luiz Freitas Almeida
c0efe4dbcf 🔧 chore(__init__.py): add noqa comments to import statements to ignore linting errors
The noqa comments have been added to the import statements to ignore the linting errors raised by the linter. This ensures that the linting errors related to the imports are ignored and the code can be properly executed without any issues.
2023-07-05 11:49:22 -03:00
Gabriel Luiz Freitas Almeida
20da596d9a 🐛 fix(base.py): handle case when no database_url is provided and raise an error
 feat(base.py): add error handling when creating database and tables to provide more informative error messages
The code now checks if the `settings.database_url` is provided and raises a `RuntimeError` if it is not. This ensures that the application does not attempt to create a database connection without a valid URL. Additionally, error handling has been added when creating the database and tables. If an exception occurs during the creation process, an error message is logged and a `RuntimeError` is raised with a more informative error message. This helps in identifying and resolving any issues related to the database creation process.
2023-07-05 11:47:55 -03:00
gustavoschaedler
53656dcc1f feat: Add dynamic field support
This commit adds support for dynamic fields in the template field creator class. The "dynamic" attribute has been added to the class definition and its default value is set to False.
2023-07-05 15:04:22 +01:00
anovazzi1
ffb8e17eb6 Merge branch 'python_custom_node_component' of personal:logspace-ai/langflow into python_custom_node_component 2023-07-05 10:52:19 -03:00
anovazzi1
900aacb5fb debug dynamic on console 2023-07-05 10:52:10 -03:00