Commit graph

12,533 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
d9fa17189e 🎨 style(MongoDB icon): rename SlackSVG to MongoDBSVG for better naming
The SlackSVG component was renamed to MongoDBSVG to better reflect the actual icon being used. This improves the naming consistency and makes the code more readable.
2023-06-23 15:33:10 -03:00
carlosrcoelho
f946db714f builded 2023-06-23 14:43:52 -03:00
Gabriel Luiz Freitas Almeida
99121d95c1 🔀 refactor(loading.py): use dictionary to initialize vector stores
The `instantiate_vectorstore` function now uses a dictionary to initialize vector stores instead of a series of if-else statements. This improves the readability and maintainability of the code. A new dictionary `vecstore_initializer` is added to `vector_store.py` to map the class names of vector stores to their respective initialization functions.
2023-06-23 14:32:15 -03:00
carlosrcoelho
122005e3e7 fixed readthedocs yaml position 2023-06-23 14:31:50 -03:00
carlosrcoelho
7288a8c22f added readthedocs yaml 2023-06-23 14:29:56 -03:00
carlosrcoelho
14a0dd0b16 improved mendable file and centralized videos. 2023-06-23 14:08:45 -03:00
Gabriel Luiz Freitas Almeida
19bd687b3f 📦 chore(pyproject.toml): add certifi package to dev dependencies
The certifi package is added to the dev dependencies to ensure that the package is available during development. This package provides Mozilla's carefully curated collection of Root Certificates for validating the trustworthiness of SSL certificates while making HTTPS requests.
2023-06-23 13:20:28 -03:00
Gabriel Luiz Freitas Almeida
fb7bcb50e5 🚀 feat(loading.py): add support for MongoDBAtlasVectorSearch vector store
The `instantiate_vectorstore` function now supports the `MongoDBAtlasVectorSearch` vector store. This allows for the use of MongoDB Atlas as a vector store for Langflow. The `search_kwargs` parameter is now supported for all vector stores that have a `as_retriever` method. This allows for the configuration of the vector store's search parameters.
2023-06-23 13:20:02 -03:00
Gabriel Luiz Freitas Almeida
ea0231025f feat(vectorstores.py): add support for index_name parameter in MongoDBAtlasVectorSearch template
The hardcoded values for db_name, collection_name, and index_name have been removed from the initialize_mongodb function and are now required parameters. This makes the function more flexible and allows it to be used with different databases and collections. The support for the index_name parameter has been added to the MongoDBAtlasVectorSearch template in vectorstores.py, which allows the user to specify the name of the index to be used in the search.
🐛 fix(vector_store.py): remove hardcoded values for db_name, collection_name, and index_name and make them required parameters
2023-06-23 13:19:30 -03:00
Gabriel Luiz Freitas Almeida
81fb84b081 🎨 style(MongoDBIcon): add MongoDBIcon component to frontend app
The MongoDBIcon component was added to the frontend app to be used as an icon for MongoDB Atlas Vector Search. The icon was added as an SVG file and imported as a React component. The component was then added to the nodeIcons object in the utils.ts file.
2023-06-23 13:18:52 -03:00
gustavoschaedler
2eb677f1db Merge branch 'dynamicNode' into python_custom_node_component 2023-06-23 17:18:23 +01:00
Gabriel Luiz Freitas Almeida
086ed52923 📦 chore(pyproject.toml): add pymongo dependency to dev dependencies
The pymongo package is added to the dev dependencies section of the pyproject.toml file. This package is required for development purposes.
2023-06-23 12:38:22 -03:00
Gabriel Luiz Freitas Almeida
4cc2fae52b 🚀 feat(langflow): add support for MongoDB Atlas Vector Search in vectorstores
 feat(langflow): add support for search_kwargs field in VectorStoreFrontendNode
The changes add support for MongoDB Atlas Vector Search in the vectorstores. The `MongoDBAtlasVectorSearch` class is now imported and initialized in `vector_store.py`. The `initialize_mongodb` function is added to initialize the MongoDB Atlas Vector Search class. The `VectorStoreFrontendNode` class is updated to add the `mongodb_atlas_cluster_uri`, `collection_name`, and `db_name` fields. The `search_kwargs` field is also added to the `VectorStoreFrontendNode` class to allow users to pass additional search parameters to the vector store.
2023-06-23 12:38:02 -03:00
Gabriel Luiz Freitas Almeida
dc0a772635 🚚 chore(endpoints.py): reorder endpoints to keep backwards compatibility
The `/predict/{flow_id}` endpoint was moved above the `/process/{flow_id}` endpoint to maintain backwards compatibility with existing clients.
2023-06-23 12:36:46 -03:00
Gabriel Luiz Freitas Almeida
bcb80a08b2 🐛 fix(loading.py): remove unnecessary type hinting for allowed_tools variable
The type hinting for allowed_tools variable is unnecessary as it is already defined in the previous line. Removing the type hinting improves the readability of the code.
2023-06-23 11:04:03 -03:00
Gabriel Luiz Freitas Almeida
4451e7e777 🔒 chore(pyproject.toml): update fastapi dependency to version 0.98.0
FastAPI dependency has been updated to version 0.98.0 to ensure that the application is using the latest version of the framework.
2023-06-23 10:57:36 -03:00
Gabriel Luiz Freitas Almeida
0645693069 🐛 fix(utils.ts): simplify ternary operator in validateNode function
The ternary operator in the validateNode function was simplified by removing the unnecessary if statement. The code is now more concise and easier to read.
2023-06-23 10:54:34 -03:00
Gabriel Luiz Freitas Almeida
d4559c1356 test(test_template.py): add assertion to check if result is not None
The test now includes an assertion to check if the result of the function call is not None. This ensures that the function is returning a value and that the test is checking the correct output.
2023-06-23 10:53:53 -03:00
Gabriel Luiz Freitas Almeida
c191d893ca test(test_template.py): add assertions to test_build_template_from_function
Added assertions to test_build_template_from_function to ensure that the returned result is not None and that the expected keys are present in the result. This improves the reliability of the test and ensures that the function is working as expected.
2023-06-23 10:52:55 -03:00
Gabriel Luiz Freitas Almeida
8cd8449034 🔥 refactor(inputFileComponent): remove unused import of RadialProgressComponent
The import of RadialProgressComponent was removed as it was not being used in the component.
2023-06-23 10:51:59 -03:00
Gabriel Luiz Freitas Almeida
713d2f19e5 🔨 refactor(utils.ts): simplify snakeToSpaces function
🔨 refactor(utils.ts): simplify getConnectedNodes function
🔨 refactor(utils.ts): remove unused variable in groupByFamily function
The snakeToSpaces function has been simplified by removing the unnecessary variable declaration. The getConnectedNodes function has been simplified by removing the unnecessary variable declaration and returning the result directly. The groupedObj variable in the groupByFamily function is no longer used, so it has been removed.
2023-06-23 10:51:29 -03:00
Gabriel Luiz Freitas Almeida
fb25744714 🔥 refactor(loading.py): remove unused imports and functions
The imports and functions that were not being used were removed to improve the code's readability and maintainability.
2023-06-23 10:51:09 -03:00
Gabriel Luiz Freitas Almeida
6c08340aff 🚀 feat(vectorstores.py): add display name for SupabaseVectorStore
The display name for the SupabaseVectorStore is now set to "Supabase". This improves the user experience by providing a more descriptive name for the vector store.
2023-06-23 10:50:37 -03:00
Gabriel Luiz Freitas Almeida
a0f48b1d12 🐛 fix(test_graph.py): add assertion to check if root node is not None
The test_build_params function was failing when the root node was None. This commit adds an assertion to check if the root node is not None before proceeding with the other assertions.
2023-06-23 10:44:23 -03:00
Gabriel Luiz Freitas Almeida
786a4bd233 Merge remote-tracking branch 'origin/dev' into add_params_to_llms 2023-06-23 09:54:45 -03:00
Gabriel Luiz Freitas Almeida
8ccdeb9dd5 🐛 fix(chat.py): fix stream_build function to return StreamData objects instead of strings
 feat(chat.py): add progress information to the stream_build function
The stream_build function now returns StreamData objects instead of strings, which improves the readability of the code. The function also now includes progress information in the response, which allows the client to track the progress of the build process.
2023-06-23 09:54:15 -03:00
Gabriel Luiz Freitas Almeida
fc2e6c112e 🐛 fix(chat.py): delete flow from cache if it already exists before initializing build
The code now checks if the flow already exists in the cache and deletes it before initializing the build. This ensures that the cache is always up to date and avoids any inconsistencies that may arise from having outdated data in the cache.
2023-06-23 09:28:25 -03:00
Gabriel Luiz Freitas Almeida
cc8e5e3106 🚀 feat(tests): update default values for OpenAI models in chat and text fields
The default value for the OpenAI model in the chat field has been updated to "gpt-3.5-turbo-0613" to reflect the latest version of the model. The default value for the OpenAI model in the text field has been updated to "text-davinci-003" to reflect the latest version of the model. This ensures that the tests are using the latest and most accurate models for OpenAI.
2023-06-23 09:19:25 -03:00
Gabriel Luiz Freitas Almeida
f2230a6d70 🚚 chore(base.py): move DIRECT_TYPES import to utils.constants
The DIRECT_TYPES import has been moved to the utils.constants module to improve the organization of the code.
2023-06-23 09:13:38 -03:00
Gabriel Luiz Freitas Almeida
a23c53dd14 🚀 feat(base.py): add sorting of fields based on DIRECT_TYPES
The `sort_fields` method has been added to the `Template` class to sort fields based on the `DIRECT_TYPES` constant. Fields that have a `field_type` in `DIRECT_TYPES` are sorted first, followed by the remaining fields. This ensures that fields that have a direct type are processed first, which is important for the correct functioning of the template.
2023-06-23 09:13:22 -03:00
Gabriel Luiz Freitas Almeida
9f00421d64 🔥 chore(constants.py): remove DIRECT_TYPES constant from vertex and graph modules
The DIRECT_TYPES constant was removed from the vertex and graph modules as it is now defined in the utils module. This change improves code organization and reduces duplication.
2023-06-23 09:13:09 -03:00
Gabriel Luiz Freitas Almeida
c0a8d15dc2 🐛 fix(util.py): set default value for model_name in format_dict function
The format_dict function was updated to set a default value for the model_name key in the value dictionary for the OpenAI, ChatOpenAI, and Anthropic models. This ensures that the model_name key always has a value, even if the options list is empty.
2023-06-23 09:12:53 -03:00
Gabriel Luiz Freitas Almeida
a05a9202e8 🐛 fix(chains.py): set required=True for TemplateField 'memory'
 feat(chains.py): add TemplateField 'chain_type' to support different types of QA chains
The 'memory' field was previously set to required=False, but it is actually required for the chain to function properly. This fix sets required=True for the 'memory' field.

A new TemplateField 'chain_type' has been added to support different types of QA chains. This field is of type 'str', is required, and is a list of options. It allows the user to select the type of QA chain they want to use.
2023-06-23 09:04:35 -03:00
Gabriel Luiz Freitas Almeida
c686ed01ca 🐛 fix(memories.py): set advanced field to False for input_key and output_key fields
The advanced field was set to True for input_key and output_key fields, which made them appear in the advanced section of the UI. This was not intended, so the advanced field is now set to False for these fields.
2023-06-23 09:04:21 -03:00
Gabriel Luiz Freitas Almeida
508c66cbaa 🐛 fix(endpoints.py): make inputs and tweaks optional in process_flow endpoint
🐛 fix(process.py): make inputs optional in process_graph_cached function
The inputs and tweaks parameters in the process_flow endpoint are now optional, which allows for more flexibility in the API. The inputs parameter in the process_graph_cached function is now optional, which prevents a ValueError from being raised when a Chain object is processed without inputs.
2023-06-23 08:40:43 -03:00
Gabriel Luiz Freitas Almeida
fed726b727 🚀 feat(memories.py): set default value for memory_key field to "chat_history"
The memory_key field is now set to "chat_history" by default. This change ensures that the memory_key field is always initialized with a default value, which is useful for the application's functionality.
2023-06-23 08:14:26 -03:00
Gabriel Luiz Freitas Almeida
4dec5db45e 🔨 refactor(frontend): remove unnecessary empty object destructuring in LoadingSpinner component
🔨 refactor(frontend): simplify conditional rendering in InputFileComponent component
🔨 refactor(frontend): simplify arrow function in SupabaseIcon component
The empty object destructuring in the LoadingSpinner component is unnecessary and can be removed. The conditional rendering in the InputFileComponent component can be simplified by removing unnecessary parentheses. The arrow function in the SupabaseIcon component can be simplified by removing unnecessary parentheses.
2023-06-22 22:57:00 -03:00
Gabriel Luiz Freitas Almeida
1c80135551 📦 chore(pyproject.toml): add types-appdirs package to poetry dependencies
The types-appdirs package was added to the poetry dependencies to provide type hints for the appdirs package. This improves the codebase's maintainability and readability by providing better type checking and documentation.
2023-06-22 22:56:38 -03:00
gustavoschaedler
cf7cd979dc feat: Add ClassCodeExtractor and is_valid_class_template functions, and custom_component endpoint
This commit adds a new file called `extract_info_from_class.py` containing a `ClassCodeExtractor` class that can extract information (imports, class details and functions) from a Python class code. It also adds a function called `is_valid_class_template` that checks if a given Python class code matches a certain template. Additionally, the commit adds a new endpoint in the `/custom_component` route of `endpoints.py` that returns a dictionary of all `langchain` types created by a specific creator. Finally, the commit adds a new section to `types.py` named `template_node`, which describes a default dictionary that can be used to define a new node for Langflow's template editor.
2023-06-23 02:54:43 +01:00
Cristhian Zanforlin Lousa
7a61791058 🐛 fix(chatMessage): remove unnecessary text-sm class from message sender name to improve readability 2023-06-22 22:51:21 -03:00
Cristhian Zanforlin Lousa
bc1d6885ed 🔧 chore(frontend): fix formatting issues in multiple files
🚀 feat(frontend): add hover effect to file search icon in InputFileComponent
🚀 feat(frontend): add support for dark mode in alert icons
🚀 feat(frontend): add support for dark mode in dropdown chevron icon
🚀 feat(frontend): add support for dark mode in success alert icon
🚀 feat(frontend): add support for dark mode in notice alert icon
🚀 feat(frontend): add support for dark mode in error alert icon
🚀 feat(frontend): add support for process.env.PORT environment variable to be able to run app on a configurable port
🚀 feat(frontend): add parameter types to GenericNode component
🚀 feat(frontend): add hover effect to external link icon in CodeAreaComponent
🚀 feat(frontend): add hover effect to plus icon in MenuBar component
🚀 feat(frontend): add hover effect to settings icon in MenuBar component
🚀 feat(frontend): add hover effect to undo icon in MenuBar component
🚀 feat(frontend): add hover effect to redo icon in MenuBar component

🎨 style(inputListComponent): add space before self-closing tag to improve readability
🎨 style(promptComponent): add space before self-closing tag to improve readability
🎨 style(ApiModal): fix indentation to improve readability
🎨 style(chatInput): add space before self-closing tag to improve readability
🎨 style(chatMessage): remove unnecessary line breaks to improve readability
🎨 style(fileComponent): add space before self-closing tag to improve readability
🎨 style(chatModal): remove unnecessary line breaks to improve readability
🎨 style(codeAreaModal): fix indentation to improve readability
🎨 style(genericModal): fix indentation to improve readability
🎨 style(DisclosureComponent): add space before self-closing tag to improve readability
🎨 style(extraSidebarComponent): fix indentation to improve readability
2023-06-22 22:49:42 -03:00
Cristhian Zanforlin Lousa
198b2c6c75 🐛 fix(chatMessage): remove unnecessary text-sm class from message sender name to improve readability 2023-06-22 22:47:37 -03:00
Gabriel Luiz Freitas Almeida
eb7f8838be 🔥 refactor(schemas.py): remove extra blank line in UploadFileResponse schema
The extra blank line in the UploadFileResponse schema has been removed to improve code readability and consistency.
2023-06-22 22:44:24 -03:00
Gabriel Luiz Freitas Almeida
7f90956d20 🐛 fix(vector_store.py): add type ignore comments to suppress import errors
The import statements for the weaviate and pinecone libraries were causing import errors. Adding the `# type: ignore` comment suppresses these errors and allows the code to run without issues.
2023-06-22 22:43:59 -03:00
Gabriel Luiz Freitas Almeida
4b5c3a0c53 🔨 refactor(process.py): add type hinting to function arguments
This commit adds type hinting to the function arguments of `get_result_and_thought` and `process_graph_cached` functions in `process.py` file. This improves code readability and maintainability.
2023-06-22 22:43:51 -03:00
Gabriel Luiz Freitas Almeida
3c89e893e7 🔨 refactor(vectorstores.py): change import statement to import List from typing
The import statement for Optional was changed to import List from typing to improve readability and consistency with the use of List in the code.
2023-06-22 22:43:37 -03:00
Cristhian Zanforlin Lousa
0c4e1f11e7 🎨 style(frontend): replace heroicons with lucide-react icons for consistency and smaller bundle size
🐛 fix(chatMessage): replace ChatBubbleOvalLeftEllipsisIcon with MessageCircle icon for consistency and better semantics

🎨 style(frontend): replace heroicons with lucide-react icons for consistency and better performance
🐛 fix(ApiModal): replace CodeBracketSquareIcon with Code2 icon for better semantics and consistency

🎨 style(frontend): replace heroicons with lucide-react icons for consistency and better design

🎨 style(genericModal/index.tsx): replace DocumentTextIcon with FileText icon from lucide-react library
🎨 style(importModal/buttonBox/index.tsx): remove unused imports
🎨 style(DisclosureComponent/index.tsx): replace ChevronRightIcon with ChevronRight icon from lucide-react library
🎨 style(extraSidebarComponent/index.tsx): replace Bars2Icon with Menu icon from lucide-react library
🔥 chore(entities/index.ts): remove unused HomeIcon import from heroicons-react library
2023-06-22 22:43:21 -03:00
Gabriel Luiz Freitas Almeida
8bb11f66e9 🔺 chore(pyproject.toml): update langchain dependency from 0.0.208 to 0.0.209
This commit updates the langchain dependency from version 0.0.208 to version 0.0.209. This is a minor version update and is done to keep the dependency up-to-date with the latest features and bug fixes.
2023-06-22 22:34:32 -03:00
Gabriel Luiz Freitas Almeida
7e72ba43fa 🐛 fix(vector_store.py): fix variable naming to follow PEP8 guidelines
The variables PINECONE_API_KEY and PINECONE_ENV were renamed to pinecone_api_key and pinecone_env, respectively, to follow PEP8 guidelines.
2023-06-22 22:32:04 -03:00
Gabriel Luiz Freitas Almeida
d069ab5d6d 🚨 test(agents_template.py): add openai-multi-functions to the list of agents
🐛 fix(graph.py): change message variable to a dictionary to match the expected input of get_result_and_thought function and update the assertion to check if the result is a dictionary instead of a string
The test for agents_template.py was updated to include the openai-multi-functions agent in the list of agents. This was done to ensure that the test coverage for the agent is complete.

The test for graph.py was updated to change the message variable to a dictionary to match the expected input of the get_result_and_thought function. The assertion was also updated to check if the result is a dictionary instead of a string. This was done to ensure that the test coverage for the function is complete.
2023-06-22 22:31:13 -03:00