Commit graph

5,500 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
31e02fe25c feat(ConversationalAgent.py): add ConversationalAgent component to handle conversational interactions using OpenAI's function calling API
This commit adds a new file `ConversationalAgent.py` to the `src/backend/langflow/components/agents` directory. The `ConversationalAgent` class is a custom component that represents a conversational agent capable of using OpenAI's function calling API.

The `ConversationalAgent` class has the following features:
- It inherits from the `CustomComponent` class.
- It has a `display_name` attribute set to "OpenaAI Conversational Agent".
- It has a `description` attribute set to "Conversational Agent that can use OpenAI's function calling API".
- It implements the `build_config` method to define the configuration options for the agent.
- It implements the `build` method to create an instance of the `AgentExecutor` class, which represents the agent's execution environment.
- The `build` method takes several parameters, including `model_name`, `tools`, `memory`, `system_message`, and `max_token_limit`.
- It uses the `ChatOpenAI` class from the `langchain.chat_models` module to create an instance of the OpenAI language model.
- It uses the `ConversationTokenBufferMemory` class from the `langchain.memory.token_buffer` module to handle conversation history and token buffering.
- It uses the `OpenAIFunctionsAgent` class from the `langchain.agents.openai_functions_agent.base` module to create an instance of the OpenAI functions agent.
- It returns an instance of the `AgentExecutor` class with the agent, tools, memory, verbose, and return_intermediate_steps parameters set.

📝 feat(__init__.py): add empty __init__.py file to the agents directory

This commit adds an empty `__init__.py` file to the `src/backend/langflow/components/agents` directory. The `__init__.py` file is necessary to make the `agents` directory a Python package.
2023-08-09 21:37:11 -03:00
Gabriel Luiz Freitas Almeida
2725e24ced 🚀 feat(constants.py): add BaseMemory to LANGCHAIN_BASE_TYPES to support custom memory implementation in Langchain interface
📝 WHY: The addition of BaseMemory to LANGCHAIN_BASE_TYPES allows for the customization of the memory component in the Langchain interface. This enables users to implement their own memory functionality according to their specific needs.
2023-08-09 21:11:00 -03:00
Gabriel Luiz Freitas Almeida
67f8bb9dab 🐛 fix(base.py): fix memory inputs only if langchain_object is not an instance of AgentExecutor to prevent unnecessary fix
🔀 chore(base.py): merge changes from langchain.agents.agent module to base module
2023-08-09 21:10:31 -03:00
Cristhian Zanforlin Lousa
9bccb95cd0 Merge branch 'login-admin' into login 2023-08-09 20:34:53 -03:00
Cristhian Zanforlin Lousa
5a690ecb6f 🔨 refactor(AdminPage/index.tsx): improve code formatting and structure for better readability and maintainability 2023-08-09 20:34:36 -03:00
igorrCarvalho
21f47e6c4d refactor: Remove unnecesary email field 2023-08-09 20:30:02 -03:00
igorrCarvalho
3348bfbcb6 merge login into login 2023-08-09 20:14:33 -03:00
igorrCarvalho
468f6ec573 feat: Add signUp page and Sign out button 2023-08-09 20:06:22 -03:00
Cristhian Zanforlin Lousa
075e9dc254 🐛 fix(AdminPage/index.tsx): adjust height of custom-scroll div to improve layout consistency 2023-08-09 20:05:31 -03:00
anovazzi1
5ae597497e
Add Admin Login Page with User Management (#737)
This pull request introduces a new admin login page to the application,
enhancing the user management experience by implementing a user table
with pagination. This will allow administrators to efficiently manage
users, edit passwords, delete accounts, and apply filters through a
user-friendly table interface.

/login/admin - Just click login
2023-08-09 19:46:41 -03:00
Cristhian Zanforlin Lousa
5009715835 🔧 fix(PaginatorComponent): remove unused imports and replace lucide-react icons with IconComponent for better modularity and reusability
 feat(PaginatorComponent): add support for custom icons using IconComponent for better customization options
🔧 fix(UserManagementModal): remove unused imports and fix import order for better organization
 feat(UserManagementModal): add password confirmation validation and reset form on modal open for better user experience
🔧 fix(UserManagementModal): fix modal size to be full height for better visibility and usability
 feat(UserManagementModal): add form fields for username and password with validation for better user input handling
🔧 fix(UserManagementModal): fix form field labels and error messages for better clarity and user guidance
 feat(UserManagementModal): add form submission and confirmation handling for better user interaction and data management
🔧 fix(UserManagementModal): fix cancel button styling for better consistency and user experience

🔧 fix(baseModal): add missing size options to the size prop to support additional modal sizes
 feat(baseModal): add support for "small-h-full" and "medium-h-full" sizes to allow modals with smaller height and full width
🔧 fix(AdminPage): import missing IconComponent and ShadTooltip components
 feat(AdminPage): add functionality to handle editing and adding new users
🔧 fix(applies.css): add missing semicolon to .field-invalid and .label-invalid classes
🔧 fix(styleUtils.ts): import missing Pencil, ChevronsRight, and ChevronsLeft icons
2023-08-09 19:33:46 -03:00
Gabriel Luiz Freitas Almeida
79858561a6
Adds Join The Waitlist button, Vectara, Metaphor in Beta and other fixes (#744) 2023-08-09 17:51:47 -03:00
Gabriel Luiz Freitas Almeida
8c41415a32 🐛 fix(custom_component.py): handle case when return_type is None to prevent errors
🐛 fix(test_custom_component.py): update assertion to expect return_type as a list instead of a string
🐛 fix(test_vectorstore_template.py): update assertion to check if all vectorstores in settings are present in the response
2023-08-09 17:50:03 -03:00
gustavoschaedler
f065a46950 Merge remote-tracking branch 'origin/dev' into authentication 2023-08-09 21:46:08 +01:00
Gabriel Luiz Freitas Almeida
30aad35cc6
Merge branch 'main' into release 2023-08-09 17:41:23 -03:00
Gabriel Luiz Freitas Almeida
8a599a85fe
Adds Vectara VectorStore and Metaphor Toolkit (#743) 2023-08-09 17:40:26 -03:00
Gabriel Luiz Freitas Almeida
e1407d0595 🔧 chore(Metaphor.py): refactor build method to accept additional parameters for improved configurability
🔧 chore(Metaphor.py): update search method to use the provided parameters for use_autoprompt and search_num_results
🔧 chore(Metaphor.py): update find_similar method to use the provided parameter for similar_num_results
2023-08-09 17:12:22 -03:00
Gabriel Luiz Freitas Almeida
89c3306512 🔒 chore(poetry.lock): update aiofiles version from 23.2.0 to 23.2.1 to fix a bug related to file support for asyncio
🔒 chore(poetry.lock): update dnspython version from 2.4.1 to 2.4.2 to fix a bug related to DNS toolkit
2023-08-09 15:53:45 -03:00
Gabriel Luiz Freitas Almeida
29766ecaf0 🐛 fix(Metaphor.py): ignore type error for importing Metaphor from metaphor_python
🐛 fix(Metaphor.py): ignore type error for returning a list with mixed types
🐛 fix(Vectara.py): add condition to check if documents and embedding are not None before creating Vectara instance
🐛 fix(CustomComponent.py): change return type of get_function_entrypoint_return_type to List[str] to match the actual return value
2023-08-09 15:53:18 -03:00
Gabriel Luiz Freitas Almeida
9bbdd9465b 🔨 refactor(Vectara.py): reorganize function parameters for better readability and maintainability
🔧 chore(Vectara.py): add "embedding" parameter to the build function to support custom embeddings in VectaraComponent
2023-08-09 15:47:22 -03:00
Gabriel Luiz Freitas Almeida
e5e23a1da6 🐛 fix(component.py): add support for "documentation" field in template_config to properly handle component documentation
🐛 fix(types.py): update_attributes function now updates frontend_node with "documentation" field from template_config
2023-08-09 15:32:41 -03:00
Gabriel Luiz Freitas Almeida
38b6831b57 feat(Metaphor.py): add MetaphorToolkit component to langflow toolkit
The MetaphorToolkit component is added to the langflow toolkit. It provides functionality for searching metaphors using the Metaphor API. The component includes three tools: search, get_contents, and find_similar. The search tool allows users to search for metaphors using a query. The get_contents tool retrieves the contents of a webpage based on the ids returned from the search tool. The find_similar tool finds search results similar to a given URL returned from the search tool.

The MetaphorToolkit component is still in beta and requires a Metaphor API key to function. The API key is stored securely and can be configured in the field_config of the component. For more information, refer to the documentation: [Metaphor Toolkit Documentation](https://python.langchain.com/docs/integrations/tools/metaphor_search)
2023-08-09 15:29:11 -03:00
Gabriel Luiz Freitas Almeida
d16d916952 🐛 fix(custom_component.py): improve parsing of return type in CustomComponent class
 feat(custom_component.py): add support for parsing return type when it is a Union of types in CustomComponent class
2023-08-09 15:28:39 -03:00
Gabriel Luiz Freitas Almeida
639550d537 🔧 chore(pyproject.toml): add metaphor-python dependency to improve code analysis and documentation generation
⬆️ feat(pyproject.toml): upgrade black dependency to version 23.1.0 for code formatting
2023-08-09 15:26:51 -03:00
Gabriel Luiz Freitas Almeida
b3e512f55f feat(PromptRunner.py): add PromptRunner component to run a Chain with a given PromptTemplate
 feat(Vectara.py): add VectaraComponent to implement Vector Store using Vectara
🔧 chore(vectorstores): add empty __init__.py file to the vectorstores directory
2023-08-09 14:37:20 -03:00
Gabriel Luiz Freitas Almeida
72f88e1a16 🐛 fix(custom_component.py): handle return_type as a Union[type1, type2] and add support for multiple return types in add_base_classes function
🐛 fix(types.py): handle multiple return types in add_base_classes function and raise HTTPException with appropriate error message if return type is invalid
2023-08-09 14:36:45 -03:00
Gabriel Luiz Freitas Almeida
c9e489a195 🔖 chore(pyproject.toml): bump version from 0.4.5 to 0.4.6 for langflow package 2023-08-09 13:50:14 -03:00
Cristhian Zanforlin Lousa
26345cc9a6 📦 chore(frontend): update package.json to add @radix-ui/react-form dependency
🔨 refactor(PaginatorComponent): remove unnecessary whitespace in paginate prop
📝 docs(ConfirmationModal): add missing JSDoc comments and improve code readability
📝 docs(UserManagementModal): add missing JSDoc comments and improve code readability
🔨 refactor(baseModal): improve code readability by adding a div wrapper for headerChild

 feat(AdminPage/index.tsx): add Pencil icon from lucide-react library to the import statement to use it in the component
 feat(AdminPage/index.tsx): add ConfirmationModal and UserManagementModal components to import statements to use them in the component
🐛 fix(AdminPage/index.tsx): remove unused handleSaveClick function
 feat(AdminPage/index.tsx): add modalEditOpen and modalDeleteOpen states to handle the opening and closing of the modals
 feat(AdminPage/index.tsx): add handleEditUser function to handle the edit user functionality
🐛 fix(AdminPage/index.tsx): remove unused handleSaveClick function
 feat(AdminPage/index.tsx): add ConfirmationModal component to handle the delete user functionality
 feat(AdminPage/index.tsx): add UserManagementModal component to handle the edit user functionality
 feat(components/index.ts): add ConfirmationModalType and UserManagementType types to handle the props of ConfirmationModal and UserManagementModal components
🐛 fix(components/index.ts): add missing newline at the end of the file
 feat(utils/styleUtils.ts): add UserMinus2 and UserPlus2 icons from lucide-react library to the import statement
2023-08-09 12:13:58 -03:00
anovazzi1
5e370f3e34
Refactoring: Rename Generic Variable Names to More Descriptive Ones (#725)
This PR is a code refactoring initiative aiming to improve the
readability and maintainability of our codebase. It specifically targets
generic or non-descriptive variable names, renaming them to more
meaningful names that better express their purpose within the code.
2023-08-09 11:21:34 -03:00
anovazzi1
21fb5aad6c style(headerComponent): capitalize the first letter of "The" in "Join The Waitlist" for consistency and readability 2023-08-09 10:59:50 -03:00
anovazzi1
181beb810e style(headerComponent): capitalize the first letter of "join the waitlist" to improve consistency and readability 2023-08-09 10:44:25 -03:00
anovazzi1
24cc59674b chore(headerComponent): remove commented out code for waitlist link
The commented out code for the waitlist link in the header component has been removed. This code was not being used and was cluttering the codebase.
2023-08-09 10:28:50 -03:00
Gabriel Luiz Freitas Almeida
be14d45589 🐛 fix(utils.py): handle CommandError when running migrations and delete alembic_version table if wrong revision in DB 2023-08-09 10:28:41 -03:00
Dave Morris
e922978f27 adding VertexAIEmbeddings into config.yaml 2023-08-09 08:07:59 -05:00
Gabriel Luiz Freitas Almeida
3b04048e75 🔥 refactor(custom-component.mdx): remove width property from style to improve responsiveness and avoid fixed width 2023-08-09 09:49:25 -03:00
Gabriel Luiz Freitas Almeida
61bee4424f
Add zip_path and workspace_url fields (#729) 2023-08-09 09:18:30 -03:00
Gabriel Luiz Freitas Almeida
d3cb71d357
fix(vector_store.py): change the way pinecone_api_key and pinecone_env are extracted so they don't get passed to the classmethod (#740) 2023-08-09 09:10:09 -03:00
Gabriel Luiz Freitas Almeida
f7afbd89b0 🔧 chore(vector_store.py): change the way pinecone_api_key and pinecone_env are retrieved from params dictionary to improve code readability and remove unnecessary code duplication 2023-08-09 08:48:53 -03:00
Melvin Hillsman
f4ad8572e7 Add zip_path and workspace_url fields
As noted in the
[documentation](https://python.langchain.com/docs/integrations/document_loaders/slack)
for this plugin zip_path is the first named parameter not file_path and
workspace_url is the second with zip_path being required and
workspace_url being optional.

Fixes #695

Signed-off-by: Melvin Hillsman <mhillsma@redhat.com>
2023-08-08 21:01:34 -05:00
Dave Morris
aa20ae5a56 rename environment variable for vite server port 2023-08-08 20:25:27 -05:00
anovazzi1
a99a7fe189 fix(headerComponent): fix conditional rendering of waitlist link in header component
chore(headerComponent): comment out unused waitlist link in header component
chore(applies.css): update styling of waitlist link in header component to match design requirements
2023-08-08 22:06:14 -03:00
anovazzi1
c67aa738ea feat(headerComponent): add "join the waitlist" link to the header component
- Added a new anchor tag with the link to the Langflow website's waitlist page
- Added a new CSS class `.header-waitlist-link-box` to style the waitlist link
- Added hover effect to the waitlist link when hovered over
2023-08-08 21:55:23 -03:00
anovazzi1
9b523ad11c update templateName variable to templateField 2023-08-08 20:59:28 -03:00
gustavoschaedler
d243829893 ⬆️ chore(pyproject.toml): upgrade python-jose dependency to version 3.3.0 to ensure compatibility and take advantage of new features 2023-08-09 00:56:07 +01:00
anovazzi1
fccb004248 format code and fix merge errors generated after conflict 2023-08-08 20:53:39 -03:00
gustavoschaedler
f822581df3 🔧 chore(pyproject.toml): add passlib and bcrypt dependencies to improve password hashing and security 2023-08-09 00:47:11 +01:00
anovazzi1
303387a3ec Merge branch 'dev' into variables_refactor 2023-08-08 20:46:18 -03:00
Cristhian Zanforlin Lousa
a88bf657a7 📦 chore(authContext.tsx): add AuthContext component and its initial value to provide authentication-related data throughout the app
📦 chore(authContext.tsx): add login, logout, and refreshAccessToken functions to handle authentication logic
📦 chore(authContext.tsx): add userData state and setUserData function to store user data
📦 chore(baseModal/index.tsx): add "x-small" size option to BaseModal component to make it smaller
📦 chore(deleteAccountPage/index.tsx): create DeleteAccountPage component to handle account deletion logic
📦 chore(routes.tsx): add route for DeleteAccountPage component under /account/delete path
📦 chore(types/auth.ts): create AuthContextType and userData types to define the shape of authentication-related data
2023-08-08 20:15:37 -03:00
Cristhian Zanforlin Lousa
dd6d1e64f7 🔧 chore(frontend): add @radix-ui/react-select package to package.json dependencies
🔧 chore(frontend): add PaginatorComponent and Select component to the project

🔧 fix(api.tsx): comment out error retry logic to temporarily disable it

 feat(LoginPage): add login functionality for admin page

🆕 feat(AdminPage): add AdminPage component to display a list of users and provide filtering and pagination functionality
🐛 fix(AdminPage): fix handleInputChange function to update the password value correctly
🔨 refactor(AdminPage): refactor handleFilterUsers function to filter users based on user and email fields
🔥 chore(AdminPage): remove unused imports and console.log statements

 feat(routes.tsx): add routes for admin login and admin page to enable access to admin features
🔧 chore(components/index.ts): add PaginatorComponentType to define the type for a paginator component
2023-08-08 20:10:28 -03:00
Dave Morris
bb2b8fbb3d add support for VertexAIEmbeddings node 2023-08-08 17:35:50 -05:00