Commit graph

11,619 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
5a69b479ff
Merge branch 'main' into vertex_ai 2023-06-28 22:10:43 -03:00
gustavoschaedler
82b76840e3 feat: Add CustomComponent tool to Langflow API
- Added support for the CustomComponent tool in the Langflow API.
- The tool has been added to the config.yaml file.
- The CustomComponentNode class has been implemented in the frontend nodes.
- The code changes include modifications in various files for the implementation of the CustomComponent tool.
- The code changes include the addition of a new field "code" in the TemplateField class.
- The build_langchain_template_custom_component function has been implemented to build the template for the CustomComponent tool.
- New custom fields "my_id", "year", and "other_field" have been added to the template for the CustomComponent tool.
2023-06-29 01:57:53 +01:00
Sean Javiya
e1872be728
Fix: Required input llm for module LLMChain not found
There is a recurring intermittent bug, where Chains fail to validate, with an error "Required module ____ for module ____ not found". This happens frequently for all LLMs that inherit from the LLM class (example Cohere's wrapper).

This is caused by this chunk of code.
This also explains why the bug is intermittent and not every time.
"in" is matching LLM from source_types with BaseLLM from target_reqs. Also, this doesn't need to be a nested loop, it can be done with one loop.

I'm a user of LangFlow, and a first time contributor. Thanks!
2023-06-28 17:09:58 -07:00
Gabriel Luiz Freitas Almeida
98fb7c84c7
Hotfix: 0.2.6 -> Docs and TextSplitter bug (#564) 2023-06-28 18:32:51 -03:00
Gabriel Luiz Freitas Almeida
e2a7d860ae
Add CodeQL workflow (#561) 2023-06-28 18:25:21 -03:00
Gabriel Luiz Freitas Almeida
c2e22a6c08
Merge branch 'main' into release 2023-06-28 18:22:44 -03:00
Gabriel Luiz Freitas Almeida
d92db6b638
Hotfix_02 (#563) 2023-06-28 18:21:09 -03:00
Gabriel Luiz Freitas Almeida
14da6494bf 🔖 chore(pyproject.toml): update package version to 0.2.6
The package version has been updated from 0.2.5 to 0.2.6. This change is made to reflect the latest changes and improvements in the package.
2023-06-28 18:17:58 -03:00
Lucas Oliveira
dadaaa895d 🔥 refactor(chatComponent/index.tsx): remove unnecessary console.log statements for 'open' and 'isBuilt' variables 2023-06-28 18:17:37 -03:00
Lucas Oliveira
657dfa1bb6 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-28 18:17:21 -03:00
Lucas Oliveira
7b2763a1af 🐛 fix(parameterComponent): set isPending to true for each tab in the parameter component state to fix a bug
🐛 fix(chatComponent): remove console.log statements for 'open' and 'isBuilt' variables to clean up code
🐛 fix(formModal): remove unnecessary console.log statement for 'tabsState[id.current]' variable to clean up code
🐛 fix(PageComponent): set isPending to true for each tab in the Page component state to fix a bug
2023-06-28 18:16:59 -03:00
Gabriel Luiz Freitas Almeida
36212884e4 🐛 fix(loading.py): refactor instantiate_textsplitter function to improve readability and remove unnecessary code
The `instantiate_textsplitter` function has been refactored to improve readability and remove unnecessary code. The condition for creating the `text_splitter` object has been simplified and the `separator_type` parameter is now removed from the `params` dictionary if it exists. Additionally, the `language` parameter is now passed as an instance of the `Language` class from the `langchain.text_splitter` module. This change ensures that the `text_splitter` object is created correctly and the `split_documents` method is called with the appropriate parameters.
2023-06-28 18:16:13 -03:00
Gabriel Luiz Freitas Almeida
3485893be0 🔀 refactor(textsplitters.py): extract options list into a variable for reusability and sorting
The options list for the separator_type field in the TextSplittersFrontendNode class has been extracted into a variable called options. This improves code readability and allows for easier modification and sorting of the options list.
2023-06-28 18:16:04 -03:00
Gabriel Luiz Freitas Almeida
8c12e17ad0 📝 docs(config.yaml): update documentation link for ConversationBufferMemory in memories section
The documentation link for ConversationBufferMemory in the memories section has been updated to point to the correct URL "https://python.langchain.com/docs/modules/memory/how_to/buffer". This change ensures that users can access the correct documentation for using ConversationBufferMemory.
2023-06-28 18:06:46 -03:00
Gabriel Luiz Freitas Almeida
a445b079e0 🔧 refactor(loading.py): simplify instantiation of prompt and format_kwargs assignment
💡 chore(loading.py): improve code readability and maintainability by simplifying the instantiation of the prompt object and assignment of format_kwargs dictionary.

The code has been refactored to use a dictionary comprehension to create the format_kwargs dictionary. This simplifies the logic and improves code readability. The commented out code for the prompt.partial() method has been removed as it is no longer necessary.
2023-06-28 17:59:57 -03:00
Lucas Oliveira
3bd103dbc5 🔨 refactor(promptComponent): move postValidatePrompt import statement to the top of the file for better organization
🔥 chore(promptModal): remove unused promptModal component

🔨 refactor(promptComponent): use useEffect to make a POST request to validate the prompt value and update the nodeClass state if the API returns data
2023-06-28 17:42:58 -03:00
Lucas Oliveira
a50e089401 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-28 17:31:14 -03:00
Lucas Oliveira
18acd7e257 🐛 fix(formModal/index.tsx): add missing setTabsState function to TabsContext to fix error
🐛 fix(formModal/index.tsx): update formKeysData.input_keys value when chatValue changes to reflect user input
2023-06-28 17:31:10 -03:00
Gabriel Luiz Freitas Almeida
bb377d4935 🐛 fix(utils.py): set input keys values from artifacts in build_input_keys_response function
 feat(utils.py): add support for setting input keys values from artifacts in build_input_keys_response function
The build_input_keys_response function now takes an additional parameter, artifacts, which is a dictionary containing key-value pairs. The function sets the values of the input keys in the input_keys_response dictionary based on the corresponding keys in the artifacts dictionary. This allows for more flexibility in setting the input keys values dynamically based on the provided artifacts.
2023-06-28 17:27:28 -03:00
Gabriel Luiz Freitas Almeida
d0da0bb1ca 🐛 fix(chat.py): add support for artifacts in stream_build function to pass prompt variables to build_input_keys_response
 feat(chat.py): update build_input_keys_response function to accept artifacts parameter to set input_keys values
The stream_build function now supports the artifacts parameter, which allows passing prompt variables to the build_input_keys_response function. This ensures that the input_keys values are correctly set based on the provided artifacts. The build_input_keys_response function has been updated to accept the artifacts parameter and use it to set the input_keys values. This improves the functionality of the chat module by allowing more flexibility in handling prompt variables.
2023-06-28 17:27:18 -03:00
Gabriel Luiz Freitas Almeida
03349bf999 🐛 fix(vertex/base.py): add artifacts attribute to Vertex class to store additional data
🐛 fix(vertex/base.py): update instantiation logic to handle tuple result from loading.instantiate_class()
🐛 fix(loading.py): update return value of instantiate_prompt() to return a tuple of prompt and format_kwargs
The Vertex class now has a new attribute called artifacts, which is a dictionary used to store additional data related to the vertex. The instantiation logic in the Vertex class has been updated to handle the case where loading.instantiate_class() returns a tuple containing the built object and additional artifacts. The loading.instantiate_prompt() function now returns a tuple containing the prompt and format_kwargs. These changes fix issues related to storing and handling additional data in the vertex and loading modules.
2023-06-28 17:26:57 -03:00
Lucas Oliveira
78ffad4c85 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-28 17:13:43 -03:00
Lucas Oliveira
9d556bc94c 🐛 fix(chatComponent): remove unused openForm state variable
🐛 fix(formModal): remove console.log statement
🐛 fix(formModal): fix formatMessage function to handle string inputs correctly
2023-06-28 17:13:32 -03:00
Gabriel Luiz Freitas Almeida
6afca21e5a 🐛 fix(utils.py): fix build_input_keys_response function to correctly filter out memory variables from input keys
The build_input_keys_response function now correctly filters out memory variables from the input keys response. Previously, it was using a list comprehension to filter the keys, but it should have been using a dictionary comprehension to preserve the key-value pairs. This fix ensures that only the keys that are not present in the langchain_object's memory variables are included in the input keys response.
2023-06-28 17:13:06 -03:00
gustavoschaedler
78fd021f23 Merge remote-tracking branch 'origin/form_io' into python_custom_node_component 2023-06-28 21:05:35 +01:00
Gabriel Luiz Freitas Almeida
c9bb88933b 🔧 chore(chat.py): reset chat history when building a flow to ensure a clean state
The chat history is now reset when building a flow to ensure that the chat starts with a clean state. This helps prevent any potential issues or conflicts that may arise from previous chat interactions.
2023-06-28 16:51:02 -03:00
Gabriel Luiz Freitas Almeida
a0919cb649 🐛 fix(validate.py): set "input_variables" field to new list of variables if it exists
🐛 fix(loading.py): set input variable values if they are present in params
The "input_variables" field in the prompt's frontend_node template is now updated with the new list of variables, if it exists. This ensures that the input variables are correctly set when validating the prompt. In the loading module, the input variable values are now set if they are present in the params dictionary. This ensures that the prompt is correctly instantiated with the provided input variable values.
2023-06-28 16:43:51 -03:00
Lucas Oliveira
16fc6bc4a2 🐛 fix(formModal/index.tsx): fix type of intermediate_steps property to be a string instead of "string" to prevent type error
🐛 fix(formModal/index.tsx): format chatItem.message only if it is not from a bot to improve readability
🐛 fix(formModal/index.tsx): remove unnecessary console.log statement
2023-06-28 16:38:21 -03:00
Cristhian Zanforlin Lousa
1251cf70a9 formatting 2023-06-28 14:20:53 -03:00
Cristhian Zanforlin Lousa
4f0d928a57 🐛 fix(ApiModal/index.tsx): import the 'filter' function from lodash to fix missing reference error
 feat(ApiModal/index.tsx): add functionality to filter nodes and display only nodes with certain types in the tweaks list
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the tweaks list not updating when the flow changes
🐛 fix(ApiModal/index.tsx): fix issue with the
2023-06-28 14:07:46 -03:00
Jorge
9784817821 Add CodeQL workflow 2023-06-28 18:42:32 +02:00
gustavoschaedler
cd4c73ac28 Import random module and HTTPStatus from http module in endpoints.py. Add CustomComponentResponseError to the import in schemas.py. Change the status_code in create_upload_file endpoint to use the HTTPStatus.CREATED constant. Change the status_code in custom_component endpoint to use the HTTPStatus.OK constant. Add a new endpoint for custom_component_error that returns a random error response. 2023-06-28 17:37:48 +01:00
Rodrigo Nader
4e9565e468 feat: Update styling for various components
- Updated hover and transition effects for several components
- Removed unnecessary CSS classes and styles
- Adjusted colors and text styles for better visual consistency
2023-06-28 12:54:54 -03:00
Rodrigo Nader
b14d6d4238 Refactor crash error component, header component, and main page component
- Refactored crash error component to update the background color of the reset button.
- Removed commented code in the header component.
- Imported BUTTON_DIV_STYLE constant in the main page component.
2023-06-28 12:51:05 -03:00
Rodrigo Nader
80a73f93fe Merge remote-tracking branch 'origin/dev' into new-style-features 2023-06-28 12:35:23 -03:00
gustavoschaedler
91f8573bed Merge remote-tracking branch 'origin/form_io' into python_custom_node_component 2023-06-28 16:33:54 +01:00
gustavoschaedler
7d483eb7c9 Add ClassCodeExtractor and related functions to extract and handle information from a class. Also add the utility functions is_valid_class_template, get_entrypoint_function_args_and_return_type, find_class_type, and build_langchain_template_custom_component. 2023-06-28 16:32:48 +01:00
Cristhian Zanforlin Lousa
ab0fcc9cb0 🔧 chore(ApiModal): add tweak.current assignment to improve code readability and maintainability 2023-06-28 12:16:27 -03:00
Gabriel Luiz Freitas Almeida
695bc4c9bf 🐛 fix(manager.py): rename variables in ChatManager class to improve clarity and consistency
🐛 fix(utils.py): rename variable in process_graph function to improve clarity and consistency

In the `ChatManager` class, the variable `chat_message` has been renamed to `chat_inputs` to better reflect its purpose of storing the input messages from the chat payload. This improves clarity and consistency within the class.

In the `process_graph` function in `utils.py`, the variable `chat_message` has been renamed to `chat_inputs` to better reflect its purpose of storing the input messages from the chat payload. This improves clarity and consistency within the function.
2023-06-28 12:01:36 -03:00
Lucas Oliveira
5c22062f72 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-28 11:52:44 -03:00
Lucas Oliveira
c76b8766c0 🔨 refactor(chatComponent): remove unused import of ChatModal to improve code cleanliness
🔨 refactor(chatComponent): update code to correctly access template value from node data

🔨 refactor(chatInput): update button styling and positioning

🔨 refactor(chatInput): update Lock icon styling and positioning

🔨 refactor(chatInput): update Send icon styling and positioning

🔨 refactor(formModal): update setKeysValue function to correctly update the value at a specific index in the array
2023-06-28 11:51:21 -03:00
Gabriel Luiz Freitas Almeida
5a76d36cd4 🔧 chore(utils.py): refactor build_input_keys_response function to return an empty string for each input key
The build_input_keys_response function has been refactored to return an empty string for each input key in the langchain_object. This change ensures consistency in the response structure and provides a default value for each input key.
2023-06-28 11:44:07 -03:00
Cristhian Zanforlin Lousa
dc4d1ccd65 🐛 fix(ApiModal): remove unnecessary div tag to fix layout issue
🐛 fix(codeAreaModal): fix closePopUp function call placement to ensure proper functionality
🐛 fix(genericModal): set closeEdit value to "generic" to fix issue with closing the modal
2023-06-28 11:43:21 -03:00
Lucas Oliveira
0c18aab513 Merge branch 'form_io' of github.com:logspace-ai/langflow into form_io 2023-06-28 11:35:34 -03:00
Cristhian Zanforlin Lousa
b29a54c678 🔧 fix(AccordionComponent/index.tsx): fix import formatting and add missing semicolon
 feat(AccordionComponent/index.tsx): add support for opening and closing accordion items on click
🔧 fix(popUpContext.tsx): add missing semicolon and fix formatting
 feat(popUpContext.tsx): add closeEdit state and setCloseEdit function to manage closing edit pop-up

🐛 fix(ApiModal/index.tsx): add missing dependencies to useEffect to prevent stale data
 feat(ApiModal/index.tsx): add support for opening and closing accordion when there are tweaks present
🔧 chore(ApiModal/index.tsx): refactor getValue function to improve readability and maintainability
🔧 chore(ApiModal/index.tsx): refactor buildContent function to improve readability and maintainability
🔧 chore(ApiModal/index.tsx): refactor buildTweakObject function to improve readability and maintainability
🔧 chore(ApiModal/index.tsx): refactor onChange functions to improve readability and maintainability
🔧 chore(ApiModal/index.tsx): refactor value props to improve readability and maintainability

🔧 fix(codeAreaModal): add setCloseEdit function to PopUpContext to handle closing editcode
🔧 fix(promptModal): add setCloseEdit function to PopUpContext to handle closing prompt
🔧 fix(textAreaModal): add setCloseEdit function to PopUpContext to handle closing textarea
🔧 fix(components): change value prop to open prop in AccordionComponentType for better semantics
2023-06-28 11:35:30 -03:00
Lucas Oliveira
789a4cb2f8 Fixed bug with template code area 2023-06-28 11:35:30 -03:00
Rodrigo Nader
15e1efc0a1 feat: Add new stylesheet for Switch component
Imported a new stylesheet for the Switch component to enhance its visual appearance.
2023-06-28 11:35:26 -03:00
Gabriel Luiz Freitas Almeida
40179ee011 🔧 chore(validate.py): add input_types to template_field in post_validate_prompt function
The input_types attribute is added to the template_field in the post_validate_prompt function. This change allows for specifying the input types that are accepted for the template field, providing more flexibility and control over the input data.
2023-06-28 11:33:56 -03:00
Gabriel Luiz Freitas Almeida
0ecb531749 🔧 fix(base.py): add input_types property to TemplateFieldCreator class
🔧 fix(index.ts): add input_types property to TemplateVariableType interface
The `input_types` property is added to the `TemplateFieldCreator` class in `base.py` and the `TemplateVariableType` interface in `index.ts`. This change allows for specifying the input types for template fields and template variables, respectively.
2023-06-28 11:33:42 -03:00
Lucas Oliveira
5d2901c7a6 🔧 fix(GenericNode/index.tsx): remove console.log statement for data object
🔥 chore(ProgressBarComponent/index.tsx): delete unused ProgressBarComponent component
🔧 fix(intComponent/index.tsx): remove commented out console.log statement for event object
2023-06-28 11:07:58 -03:00