Commit graph

3,986 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
b0a2258232 🔧 chore(OpenAIConversationalAgent.py): add display names for 'tools', 'memory', 'system_message', and 'max_token_limit' parameters to improve readability and user experience 2023-08-09 22:06:33 -03:00
Gabriel Luiz Freitas Almeida
33ef3b0a7e 🐛 fix(OpenAIConversationalAgent.py): ignore type errors for memory_key, system_message, prompt, agent, and tools variables
 feat(OpenAIConversationalAgent.py): add support for return_intermediate_steps parameter in AgentExecutor constructor to enable returning intermediate steps during conversation
2023-08-09 21:58:25 -03:00
Gabriel Luiz Freitas Almeida
1dcdc02e4f 🚀 feat(constants.py): import BaseChatMemory from langchain.memory.chat_memory module to add support for chat memory in custom interfaces 2023-08-09 21:49:20 -03:00
Gabriel Luiz Freitas Almeida
5d226d43d1 🐛 fix(OpenAIConversationalAgent.py): change parameter name from model_name to model to improve clarity and consistency 2023-08-09 21:48:40 -03:00
Gabriel Luiz Freitas Almeida
44f4fc1e62 feat(OpenAIConversationalAgent.py): add implementation of ConversationalAgent class for OpenAI conversational agent 2023-08-09 21:38:39 -03:00
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
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
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
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
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
Gabriel Luiz Freitas Almeida
91914f8bbe
Fixes an edge case that causes OperationalError when creating db tables (#734) 2023-08-08 17:52:50 -03:00
Gabriel Luiz Freitas Almeida
ab11bb99a7 🔖 chore(pyproject.toml): bump version from 0.4.4 to 0.4.5 for langflow package 2023-08-08 17:51:52 -03:00
Gabriel Luiz Freitas Almeida
d6bb6bf3d9 🐛 fix(base.py): handle case where database and tables already exist to prevent error and log a debug message 2023-08-08 17:41:17 -03:00
Gabriel Luiz Freitas Almeida
eb09b0ef59
Hotfix: Fixes ORJSON 3.9.4 preventing installation with Poetry (#733) 2023-08-08 16:55:46 -03:00
Gabriel Luiz Freitas Almeida
14760cae19
Merge branch 'main' into release 2023-08-08 16:55:28 -03:00
Gabriel Luiz Freitas Almeida
9f0b460fec 🔧 chore(pyproject.toml): update orjson dependency from version 3.9.1 to 3.9.3
🔖 chore(pyproject.toml): update package version from 0.4.3 to 0.4.4
2023-08-08 16:53:36 -03:00
Gabriel Luiz Freitas Almeida
bae4792ed9
Fix flows not being able to run without input keys (#732) 2023-08-08 15:14:27 -03:00
Gabriel Luiz Freitas Almeida
ceff1a2833 Merge remote-tracking branch 'origin/main' into release 2023-08-08 15:13:49 -03:00
Gabriel Luiz Freitas Almeida
cf8c0601eb Revert "Merge branch 'main' into release"
This reverts commit 4dea0f6690, reversing
changes made to 597b2153a3.
2023-08-08 15:13:22 -03:00
Gabriel Luiz Freitas Almeida
b8d8ed8283 Revert "Revert "Fixes flows without input_keys not being runnable" (#731)"
This reverts commit 352e74cbc7, reversing
changes made to 3f531a1157.
2023-08-08 15:12:37 -03:00
Gabriel Luiz Freitas Almeida
4dea0f6690
Merge branch 'main' into release 2023-08-08 15:08:11 -03:00
Gabriel Luiz Freitas Almeida
597b2153a3 🔖 chore(pyproject.toml): bump version from 0.4.2 to 0.4.3 for langflow package 2023-08-08 15:06:38 -03:00
Gabriel Luiz Freitas Almeida
352e74cbc7
Revert "Fixes flows without input_keys not being runnable" (#731) 2023-08-08 15:03:02 -03:00
Gabriel Luiz Freitas Almeida
f9b392d5b8
Revert "Fixes flows without input_keys not being runnable" 2023-08-08 15:02:16 -03:00
Gabriel Luiz Freitas Almeida
3f531a1157
Fixes flows without input_keys not being runnable (#727) 2023-08-08 15:01:56 -03:00
Gabriel Luiz Freitas Almeida
df49a6a410
Merge branch 'main' into inputKeysBugFix 2023-08-08 15:01:35 -03:00
Gabriel Luiz Freitas Almeida
8e4ca8e8ef
Adds more settings to ChromaDB and fixes Chat not being runnable without chat variables (#718) 2023-08-08 15:00:55 -03:00
Gabriel Luiz Freitas Almeida
a64f03da9c 📝 docs(loading_document.mdx): update the "Web Page" field URL to point to the correct documentation URL
📝 docs(CNAME): update the CNAME file to point to the new domain for the documentation

🔧 fix(ApiModal/index.tsx): update the links in the description to point to the correct documentation URL
2023-08-08 14:11:57 -03:00
Gabriel Luiz Freitas Almeida
d1f09a6a64 🔨 refactor(utils.ts): remove unnecessary newline after the return statement in getChatInputField function 2023-08-07 20:34:22 -03:00
Gabriel Luiz Freitas Almeida
bd7489206d 🐛 fix(chatComponent): add null check for formKeysData.input_keys to prevent error when accessing undefined property 2023-08-07 20:32:27 -03:00
Gabriel Luiz Freitas Almeida
16666426f7 🐛 fix(chatComponent): fix condition to check if parsedData.input_keys is not undefined
 feat(chatComponent): add logic to close the connection and finish when end_of_stream event is received
2023-08-07 20:31:59 -03:00
Gabriel Luiz Freitas Almeida
e1cbc0d5d4 🐛 fix(utils.ts): fix missing closing bracket in getChatInputField function
 feat(utils.ts): add getChatInputField function to retrieve the chat input field based on the current flow and tabs state
2023-08-07 20:31:32 -03:00
Gabriel Luiz Freitas Almeida
2abc0d2fb4 🐛 fix(formModal/index.tsx): handle case when tabsState or formKeysData is undefined to prevent errors
 feat(formModal/index.tsx): add support for displaying input keys and handling input changes in the form modal
2023-08-07 20:28:41 -03:00
Gabriel Luiz Freitas Almeida
aff3d53021 🔖 chore(pyproject.toml): bump package version from 0.4.1 to 0.4.2
🔖 chore(pyproject.toml): bump langchain version from 0.0.250 to 0.0.256
2023-08-07 20:06:32 -03:00
Gabriel Luiz Freitas Almeida
f61d265e77 🔧 chore(vector_store.py): refactor initialize_chroma function to remove unnecessary if conditions and improve code readability
🔧 chore(vector_store.py): remove chroma_server_ keys from params dictionary if not needed to avoid potential conflicts
2023-08-07 18:52:19 -03:00