Commit graph

3,948 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
5c2ab59797
Format code and update langflow version (#1922)
* format

* chore: Bump langflow version to 1.0.0a34 and langflow-base version to 0.0.45

* Fix fallback_to_env_vars type hint

* chore: Add fallback_to_env_vars parameter to run_flow_from_json function

The `run_flow_from_json` function now accepts a new optional parameter `fallback_to_env_vars` which determines whether Global Variables should fallback to environment variables if not found. This change allows for more flexibility in handling variable values.

* chore: Add fallback_to_env_vars parameter to run_flow_from_json function

* chore: Set file path to None when not found in component

This commit modifies the `Vertex` class to set the file path to `None` when it is not found for a required field in a component. This change ensures that the code can handle missing file paths gracefully and avoids raising a `ValueError`.

* chore: Add fallback_to_env_vars parameter to run_flow_from_json function

* new package lock
2024-05-19 19:17:18 -07:00
ogabrielluiz
0fd6660cf6 chore: Fix fallback to environment variables in loading.py
This commit fixes an issue in the `loading.py` file where environment variables were not being properly fallbacked to if not found in custom component keys. It also updates the documentation to inform users about the new feature of falling back to environment variables if the variable value is not found in custom component keys.
2024-05-19 16:28:21 -07:00
Gabriel Luiz Freitas Almeida
ec910f3bd7
Fix fallback to environment variables in loading.py (#1921)
* 🐛 (loading.py): Fix issue where environment variables were not being properly fallbacked to if not found in custom component keys
📝 (loading.py): Update documentation to inform users about the new feature of falling back to environment variables if variable value is not found in custom component keys

* add fallback_to_env_vars to build vertex
2024-05-19 11:21:45 -07:00
Gabriel Luiz Freitas Almeida
c3353bec37
Fix visited set bug in Graph class and refactor GenericNode component (#1917)
* format

* chore: Fix visited set bug in Graph class

* Refactor GenericNode component to improve build status handling
2024-05-17 15:28:02 -07:00
Gabriel Luiz Freitas Almeida
b9fa68dcfb
feat: Add get_final_results_only parameter to build_records_from_result_data method (#1912)
* feat: Add get_final_results_only parameter to build_records_from_result_data method

The `build_records_from_result_data` method in the `SubFlowComponent` class now accepts a `get_final_results_only` parameter. This parameter controls whether the output will contain all outputs from the flow or only the final results. This change allows for more flexibility in handling the result data.
2024-05-16 16:50:00 -07:00
Gabriel Luiz Freitas Almeida
53dc025b5e
Changes default location for the database and adds the option to use the previous behavior (#1907)
* chore: Refactor loading of settings and handle missing keys

* chore: Update .env.example file with new configuration options

* Ignore database files in .gitignore

* Refactor loading of settings and handle missing keys

* Update DOWNLOAD_WEBHOOK_URL in base settings to use the correct URL for triggering flows in the Langflow store.

* 🐛 (base.py): Fix condition to copy existing database to new location only if SAVE_DB_IN_CONFIG_DIR is true

* 🐛 (base.py): update log message to accurately reflect the action being taken when creating a new database
2024-05-15 20:41:01 -03:00
anovazzi1
14ff98213d
add export flow on API modal and fix .env bug (#1896)
* feat(codeTabsComponent): add ExportModal component to enable exporting flow data in CodeTabsComponent

* refactor(service.py): update VariableService to handle environment variables with
whitespace by stripping the value before creating the variable

* chore: Update package versions to 1.0.0a33 and 0.0.44 for 'langflow' and 'langflow-base' respectively

* make lock
2024-05-14 19:23:36 -03:00
Gabriel Luiz Freitas Almeida
1ea9fcde25 chore: Update package versions to 1.0.0a32 and 0.0.43 for 'langflow' and 'langflow-base' respectively 2024-05-13 11:11:04 -07:00
Gabriel Luiz Freitas Almeida
8b873b78c9 Add gpt-4o model 2024-05-13 11:07:28 -07:00
Gabriel Luiz Freitas Almeida
da256785d0
refactor: Improve variable creation logic in VariableService (#1875)
* refactor: Improve variable creation logic in VariableService
2024-05-10 12:34:24 -03:00
Gabriel Luiz Freitas Almeida
e36901bb34 (pyproject.toml): update package versions to 1.0.0a31 and 0.0.42 for 'langflow' and 'langflow-base' respectively 2024-05-10 12:33:05 -03:00
Gabriel Luiz Freitas Almeida
5ca1c22893
Add support for Python 3.12 (#1873)
* Add support for Python 3.12

* chore: Update Python version to 3.11 and DuckDB dependency to 0.10.2

* chore: fix mistral components lint

* Update SQLAgent and SQLExecutor imports to use langchain_community utilities

* Update langchain import to langchain_community

* Update langchain import to langchain_community

* 📝 (langflow/__main__.py): Import warnings module to suppress warnings during app execution
📝 (langflow/api/v1/schemas.py): Update timestamp field default value to use datetime.now with timezone.utc
📝 (auth/utils.py): Ignore warnings related to datetime.utcnow when decoding JWT tokens and creating refresh tokens
📝 (models/flow/model.py): Update updated_at field default value to use lambda function with timezone.utc
📝 (models/user/model.py): Update create_at and updated_at field default values to use lambda function with timezone.utc
2024-05-10 12:25:34 -03:00
h-arnold
12d1a9a426
Added MistralAI LLM and Embedding (#1865)
* Added Mistral AI LLM Model and added MistralAI embeddings.

* Added tracking to the new MistralAIEmbeddings.py and MistalModel.py

* Added MistralAI model specs and added the correct models list to the Mistral Model LLM component.

* Actually added the MistralAI model specs this time.
2024-05-09 15:54:16 -03:00
Gabriel Luiz Freitas Almeida
1a54582b95
Update ZepMessageReader and ZepMessageWriter to avoid 404 error (#1844)
* Update ZepMessageReader and ZepMessageWriter to avoid 404 error

* Update ZepMessageReader and ZepMessageWriter to use API Base Path option

* Update ZepMessageReader and ZepMessageWriter to fix API Base Path and avoid 404 error

* Update ZepMessageReader and ZepMessageWriter to use API Base Path option
2024-05-08 11:46:48 -03:00
Gabriel Luiz Freitas Almeida
fa87284937 Update starter projects 2024-05-08 10:30:33 -03:00
Rodrigo Nader
03f781c0f4
Refactor SplitText (#1836)
Refactor LCModelComponent status message formatting for better readability
2024-05-08 09:59:43 -03:00
Rodrigo Nader
5a21263272
Refactor TextOperatorComponent to include true_output parameter (#1829)
* Refactor TextOperatorComponent to include true_output parameter

* Refactor TextOperatorComponent to include true_output parameter

* Add PassComponent to experimental components
2024-05-08 09:59:27 -03:00
Gabriel Luiz Freitas Almeida
28c2585415
(openai_constants.py): add a new file to define constant MODEL_NAMES for OpenAI models (#1858)
*  (openai_constants.py): add a new file to define constant MODEL_NAMES for OpenAI models
♻️ (ChatOpenAISpecs.py, OpenAIModel.py): refactor to use MODEL_NAMES constant from openai_constants.py for consistency and easier maintenance

*  (IDGenerator.py): update key name from 'real_time_refresh' to 'refresh_button' for better clarity and consistency
2024-05-07 22:47:21 -03:00
Gabriel Luiz Freitas Almeida
82877d8b99 🐛 (chat.py): Add validation for stream configuration in graph to prevent two connected vertices with stream or streaming set to True from raising a ValueError
🐛 (chat.py): Raise HTTPException with status code 400 if "stream or streaming set to True" is found in the exception message
📝 (base.py): Add method `validate_stream` to Graph class to validate stream configuration and prevent connected vertices with stream or streaming set to True
📝 (base.py): Update method `get_all_successors` in Graph class to specify type hint for the `vertex` parameter and return type
📝 (base.py): Update method `get_successors` in Graph class to specify type hint for the `vertex` parameter and return type
2024-05-07 20:04:31 -03:00
Mendon Kissling
42714d35f1
[Docs] - Vector Store RAG Starter Flow (#1850)
* initial-content

* additional-query
2024-05-07 18:39:24 -03:00
Gabriel Luiz Freitas Almeida
a037bf9978
Add GroqLogo and GroqIcon components (#1853)
* Update package.json format command to include only specific directories

* Add GroqLogo component and GroqIcon to the project

* Update dependencies and add GroqModelSpecs component

* Fix nullable column issue in langflow/alembic/versions/6e7b581b5648_fix_nullable.py

* Add GroqModelSpecs component and update dependencies

* Update GroqModelSpecs and GroqModel display names

* chore: Add langchain-pinecone dependency and update constants.py
2024-05-07 18:38:13 -03:00
Gabriel Luiz Freitas Almeida
21be1268ae
Update langchain-pinecone dependency and add Pinecone API key (#1854)
* Update langchain-pinecone dependency and related code

* Add Pinecone API key to environment variables

* Fix commented out code in codeTabsComponent, parameterComponent, and editNodeModal

* Add PineconeSearchComponent to PineconeSearch.py

* Update PineconeComponent to accept pinecone_api_key as optional parameter
2024-05-07 17:46:54 -03:00
Gabriel Luiz Freitas Almeida
9b201740e6 Update versions 2024-05-06 16:54:42 -03:00
Kiyu Gabriel
dea6b5167e
Update VertexAIEmbeddings.py (#1834)
Upgrade to new library that isn't deprecated.
2024-05-06 16:48:36 -03:00
Gabriel Luiz Freitas Almeida
92d39a6500
Fix mark_branch function and refactor build_and_cache_graph_from_db function (#1833)
* Fix mark_branch function in Graph class to properly handle visited vertices

* Refactor build_and_cache_graph_from_db function in utils.py to simplify code and remove unnecessary parameter

* Fix retrieval of graph from cache in retrieve_vertices_order function

* Fix possible_id type annotation in get_id_from_search_string function

* Refactor APIRequest class to improve variable naming and remove unnecessary underscore prefix in headers parameter

* Refactor buildVertices function in buildUtils.ts to improve code readability and remove unnecessary variable assignment

* Fix API endpoints in test_endpoints.py to use correct HTTP methods
2024-05-03 18:23:41 -03:00
Cristhian Zanforlin Lousa
566c3642f6
Add headers to API Request component (#1832)
♻️ (APIRequest.py): refactor APIRequest class to improve variable naming and remove unnecessary underscore prefix in headers parameter
💡 (APIRequest.py): update comments in APIRequest class to improve code readability and maintainability
2024-05-03 17:26:11 -03:00
Gabriel Luiz Freitas Almeida
354a236bc7
Fix custom_repr assignment in instantiate_custom_component function (#1828) 2024-05-02 18:32:13 -03:00
cristhianzl
d057dc1600 🔧 (FileInput.py, JsonInput.py, KeyPairInput.py, StringListInput.py, CSVOutput.py, ImageOutput.py, JsonOutput.py, KeyPairOutput.py, PDFOutput.py, StringListOutput.py): delete unused input and output components
The input and output components FileInput.py, JsonInput.py, KeyPairInput.py, StringListInput.py, CSVOutput.py, ImageOutput.py, JsonOutput.py, KeyPairOutput.py, PDFOutput.py, and StringListOutput.py were deleted as they were no longer being used in the project. This cleanup improves code organization and reduces unnecessary dependencies.
2024-05-02 18:28:24 -03:00
cristhianzl
820c0c3712 🐛 (chat.py): fix type annotation for 'data' parameter in retrieve_vertices_order function to allow None as a value
🐛 (constants.py): fix import statement for JsonSpec from langchain.tools.json.tool to langchain_community.tools.json.tool
🐛 (index.tsx): add data-testid attribute to the div element to improve testability
🐛 (buildUtils.ts): add debugger statement for debugging purposes
🐛 (chatInputOutput.spec.ts): fix click event target from "Run" to "Playground"
🐛 (fileUploadComponent.spec.ts): fix click event target from "Run" to "Playground"
🐛 (textInputOutput.spec.ts): fix click event target from "Run" to "Playground"
2024-05-02 15:54:16 -03:00
cristhianzl
5042c0a750 merge dev on feature/ui-table 2024-05-02 14:57:10 -03:00
Cristhian Zanforlin Lousa
79e1d538ca
Playground (#1824) 2024-05-02 14:46:11 -03:00
Rodrigo Nader
2785a8bc3a
Refactor store_message function and add StoreMessageComponent (#1817)
* Refactor store_message function in chat.py and memory.py

* Refactor store_message function in chat.py and memory.py

* Add StoreMessageComponent to langflow components

* Refactor store_message function in chat.py and memory.py to require session_id, sender, and sender_name

* Refactor StoreMessageComponent to use Optional[str] for sender_name and session_id parameters

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-05-02 14:29:54 -03:00
cristhianzl
101a045cba merge dev on playground 2024-05-02 13:59:52 -03:00
Gabriel Luiz Freitas Almeida
0648e3f2ac Update component descriptions to reflect Playground instead of Interaction Panel 2024-05-02 13:50:01 -03:00
Cristhian Zanforlin Lousa
bbe72887eb
Introducing Versatile IO Components: JSON Viewer, DictionaryIO, and InputListIO (#1822)
In our ongoing commitment to enhancing user experience and streamlining
data interaction, we are thrilled to introduce a trio of powerful IO
components: JSON Viewer, DictionaryIO, and InputListIO. These components
are meticulously crafted to empower developers with seamless data
handling capabilities, enabling efficient processing and visualization
of JSON data structures, dictionaries, and input lists.
2024-05-02 13:47:43 -03:00
Gabriel Luiz Freitas Almeida
e3edc54d64 Refactor get_id_from_search_string function to convert UUID to string in service.py 2024-05-02 12:56:57 -03:00
cristhianzl
1df3fe7ad6 📝 (StringListInput.py): update parameter name from "param" to "input_value" to improve clarity and consistency
📝 (StringListOutput.py): update parameter name from "param" to "input_value" to improve clarity and consistency
📝 (index.tsx): add InputListComponent to handle StringListInput and StringListOutput components in IOFieldView
📝 (index.tsx): update InputListComponent props to include value, onChange, disabled, and playgroundDisabled
📝 (index.tsx): update IOFieldView to render InputListComponent for StringListInput and StringListOutput components
2024-05-02 11:39:41 -03:00
cristhianzl
aa3ea07c6a merge playground 2024-05-02 10:39:46 -03:00
Rodrigo Nader
08797ee592 Refactor TextOperatorComponent in TextOperator.py to improve code readability and maintainability 2024-05-01 22:37:26 -03:00
Gabriel Luiz Freitas Almeida
0dc5cff33e Add id search from search string 2024-05-01 11:41:51 -03:00
Gabriel Luiz Freitas Almeida
f9f1d9ba14 Bump version to 1.0.0a30 in pyproject.toml 2024-05-01 11:34:33 -03:00
Gabriel Luiz Freitas Almeida
95813de618
Fixes State management and first implementation of vertex inactivation (#1805)
* Refactor RoutingVertex class in types.py to include a new step in the steps list

* Refactor Graph class to update run_manager.run_predecessors when activating vertices

* Refactor ShouldRunNextComponent class in ShouldRunNext.py to improve error handling and readability

* Refactor error handling in get_lifespan function in main.py and fix mismatch between models and database in DatabaseService class in service.py

* Fix vertex inactivation

* Fix inactivation of vertices and update buildUtils

* Refactor ShouldRunNextComponent class to improve error handling and readability

* Refactor langflow.graph.vertex.types imports in base.py

* Fix nullable constraint in langflow migration script

* Fix condition check in ShouldRunNextComponent class

* Refactor build_graph_maps function in base.py to accept optional parameters for edges and vertices

* Apply grayscale effect to ring-muted-foreground in applies.css

* Apply grayscale effect to ring-muted-foreground in applies.css
2024-04-30 16:33:53 -03:00
Gabriel Luiz Freitas Almeida
4bbba570fe Fix validation for empty variable name and value in create_variable function 2024-04-30 15:18:36 -03:00
Gabriel Luiz Freitas Almeida
354a7b5985 Refactor Alembic migration scripts to set name and value columns as not nullable 2024-04-30 14:46:45 -03:00
Gabriel Luiz Freitas Almeida
027cfe81fc format 2024-04-30 14:35:09 -03:00
Gabriel Luiz Freitas Almeida
90f1efb18b Refactor Alembic migration scripts and Variable model 2024-04-30 14:34:54 -03:00
Gabriel Luiz Freitas Almeida
71a9051727 Add default_fields attribute to VariableRead model and update create_variable method in VariableService 2024-04-30 13:34:27 -03:00
cristhianzl
edabb31112 (StringListInput.py): add a new custom component called "StringListInput" to handle string list inputs
 (KeyPairOutput.py): add a new custom component called "KeyPairOutput" to handle dictionary outputs
 (StringListOutput.py): add a new custom component called "StringListOutput" to handle string list outputs
🚀 (constants.ts): add "StringListInput" and "StringListOutput" to the list of supported input and output types
♻️ (index.tsx): refactor IOKeyPairInput component to accept an additional prop "isInputField" and disable input fields if it's false
♻️ (index.tsx): refactor IOFieldView component to handle rendering of "StringListInput" and "StringListOutput" components
2024-04-30 13:33:37 -03:00
Mendon Kissling
cc70a11572
[Docs] - Refactor folders and leftnav (#1781)
* refactor-leftnav

* bump-whats-new

* comment-out-some-tutorials

* links

* guidelines

* comma

* starter-projects

* try-links

* add-new-component-location
2024-04-30 09:28:59 -03:00
Gabriel Luiz Freitas Almeida
3978d98845
Fix nullable column in apikey table (#1801)
* Fix nullable column in apikey table

* Update package versions in pyproject.toml and poetry.lock
2024-04-30 09:26:21 -03:00