Commit graph

14,263 commits

Author SHA1 Message Date
Eric Hare
1dfa160385
fix: issue with dynamic inputs when selecting model (#4538) 2024-11-12 19:58:41 +00:00
Gabriel Luiz Freitas Almeida
0dc6cce8dc
tests: Enhance component testing and error handling with dynamic retrieval (#4526)
* Add module parameter to build_component_instance_for_tests function for dynamic component retrieval

* Enhance component test base with detailed version mapping and error handling

- Introduced `VersionComponentMapping` TypedDict for structured version mapping.
- Updated `FILE_NAMES_MAPPING` to use a list of `VersionComponentMapping`.
- Added comprehensive error messages for missing or invalid mappings in `test_all_versions_have_a_file_name_defined`.
- Improved `test_component_versions` with detailed exception handling and error reporting.
- Ensured `component_class` is defined before running tests.

* Refactor FILE_NAMES_MAPPING to use a list of dictionaries for better structure and readability in test_prompt_component.py

* refactor: Enhance ComponentTestBase with fixture validation and improved version handling

* Refactor test setup in `test_prompt_component.py` to use fixtures for improved modularity and readability

* fix: Add PlaceholderGraph NamedTuple and handle 'graph' attribute in Component class

* Add attribute checks for 'graph' and 'vertex' to prevent errors

* Handle missing 'graph' attribute in 'store_message' method to prevent errors.

* Handle missing 'graph' attribute in Message creation to prevent errors

* Handle missing 'graph' attribute in chat message flow ID assignment

* Add component code to test instance creation and error logging

* Update SUPPORTED_VERSIONS to remove older versions

* test: add unit tests for ChatInput and TextInputComponent

Implement comprehensive tests for both ChatInput and TextInputComponent to ensure proper functionality, including message responses and handling of various input scenarios. This enhances reliability and aids in future development.

* test: add unit tests for ChatOutput and TextOutputComponent

Implement comprehensive tests for ChatOutput and TextOutputComponent, validating message responses, source properties, and behavior with various input types to ensure reliability and consistency across output components.

* Update JSON files to improve code readability and add missing info fields

- Added missing `info` fields to various input components to provide better context and descriptions.
- Improved code readability by ensuring consistent formatting and structure across JSON files.
- Updated `message_response` method to handle cases where `graph` attribute might not be present.
- Enhanced `build_vectorize_options` method to set `authentication` and `parameters` to `None` if no values are provided.
- Refined `AgentComponent` to include `info` for `agent_llm` and other fields, improving clarity on their purpose.

* Refactor: update attribute access to use private `_vertex` attribute

* test: enhance TextInputComponent tests and update properties assertions

* Remove redundant unit tests for output components in test_output_components.py

* feat: add PlaceholderGraph for backwards compatibility and enhance Component attributes

* fix: improve run_id assignment and ensure user_id is a string in PlaceholderGraph

* Add check for non-empty incoming_edges in get_properties_from_source_component
2024-11-12 10:50:56 -08:00
Lucas Oliveira
ae966ab588
fix: added new image to get started templates, fixed sidebar overlapping bug (#4533)
* Fixed flow on top of sidebar

* Fixed get started templates design and bg image

* Fixed build button overflowing

* Changed truncation of list

* Fixed colors on collapse buttons

* Fixed is mobile hook and fixed sidebar not reappearing after hiding it in small screens

* Changed to max char 110
2024-11-12 18:34:45 +00:00
Mike Fortman
94561426a2
feat: Implement new Langflow Logo throughout the application (#4509)
* Logo changes

* favicons

* [autofix.ci] apply automated fixes

* pr comment: use tailing height/width

* tiny feature flag wrapping fix

* update favicon

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-12 11:37:55 -06:00
Mendon Kissling
bcd7617e48
Docs: Contributing folder (#4415)
* issues

* contributing

* telemetry-cleanup

* name

* name

* pr-guidance

* Apply suggestions from code review

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>

* code-review

* move-discussions

* have-written

* why-to-run-locally

* clarify-how-to-contribute

* add-custom-component-page

* Apply suggestions from code review

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>

* update-join-the-community-age

---------

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
2024-11-12 17:05:08 +00:00
Lucas Oliveira
ab71e2fa15
fix: upgraded agent tool mode switch ux, fixed icon color on main page, fixed pagination ui on main page (#4501)
* Added bg background for icon on Agent

* Changed system prompt description

* Added toggle to node toolbar for tool mode

* Removed copy from node toolbar

* Fixed node last output border

* Removed beta tag from agent

* remove text foreground from grid

* updated paginator style

* Fixed pagination element disposition on main page

* Fixed node icon

* Removed storeComponent from pagination

* removed storeComponent from paginator type

* Fixed canvas dots color

* Changed pagination design

* fixed gap

* Fix minimized state on components that have a custom icon

* Fixed exibition of flow running state to not make the header jump

* Fixed starter flows
2024-11-12 16:31:36 +00:00
Mendon Kissling
692af0eef4
Docs: Settings pages (#4425)
* settings-content

* my-collection-location-and-slug

* my-collection

* redirects

* more-cleanup

* docs:: fixed-components-menu-item

* move-settings-content-and-redirect

* title-case

* case

* code-review

* Apply suggestions from code review

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>

---------

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
2024-11-12 10:34:11 -05:00
Cristhian Zanforlin Lousa
2ddd773512
refactor: rename CSV component and update Google OAuth imports (#4521)
* change csv to data name, change googleauth folder

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-12 15:22:15 +00:00
Eric Hare
8cd87210ad
feat: Add a WikiData API Tool Component (#4512)
* feat: Add a WikiData API Tool Component

* [autofix.ci] apply automated fixes

* Update wikidata_api.py

* Fix casing and import in init

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-12 15:03:01 +00:00
Edwin Jose
516ba8908d
fix: bedrock component handling AWS constants (#4514)
* update model list as constants

update model list as constants
Add default value to Secret string variables

* Update amazon_bedrock.py

load_from_db false for session_token
2024-11-12 14:46:37 +00:00
anovazzi1
f34d57acb7
fix: update step duration display and logic (#4506)
* feat: Add durationStore for managing chat durations and intervals and update duration display logic to use store

* [autofix.ci] apply automated fixes

* Expand `recursive_serialize_or_str` to support `BaseModelV1` subclasses

* fix: Update duration calculation for event handlers

Improve accuracy of duration measurement in event handlers by centralizing the calculation method. This ensures consistent timing across different events and enhances the reliability of event processing.

* refactor: improve duration calculation logic

Enhance the duration calculation by clearly handling both integer and float timestamps. This ensures accurate duration tracking and simplifies the code structure, improving maintainability and readability.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2024-11-12 11:19:13 -03:00
Cristhian Zanforlin Lousa
4254d8ef4e
style: update border radius and add orange datatype color (#4522)
📝 (applies.css): Update border radius value to use specific pixel value for consistency
📝 (index.css): Add new custom CSS variables for datatype orange and its foreground color
📝 (styleUtils.ts): Add new node color for BaseChatMessageHistory to be displayed in orange
2024-11-12 14:04:22 +00:00
Cristhian Zanforlin Lousa
84dd03198d
feat: Add YouTube transcript extraction component and frontend integration (#4502)
* add new youtube transcripts component

* [autofix.ci] apply automated fixes

*  (youtube-transcripts.spec.ts): add integration test for youtube transcripts component in the frontend to ensure user can interact with it successfully

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-12 13:13:30 +00:00
anovazzi1
0e101ef1e7
fix: update SignUpPage component styling to use full screen height (#4510)
refactor: Update SignUpPage component styling to use full screen height
2024-11-12 04:12:45 -08:00
anovazzi1
eb5cb2e923
refactor: Remove cursor highlighting feature (#4508)
The cursor highlighting feature was removed from the PageComponent in order to simplify the code and improve performance.
2024-11-12 04:12:07 -08:00
Mike Fortman
ca12a454d9
fix: Fix tweaks text color (#4513)
fix tweaks text color
2024-11-12 04:11:09 -08:00
Gabriel Luiz Freitas Almeida
7dfce1dc63
refactor: Enhance tools with enums and improved error handling (#4493)
* fix: Enhance extract_class_name function to identify Component subclasses

* Add TODO for improving Component inheritance check in validate.py

* Add YahooFinanceMethod enum and improve error handling in Yahoo Finance tool

- Introduced YahooFinanceMethod enum to standardize method options.
- Updated YahooFinanceSchema to use the new enum for method selection.
- Enhanced error handling by raising ToolException on data retrieval failure.
- Refactored method handling in _yahoo_finance_tool to use enum values.

* Enhance TavilySearchToolComponent with Enums and Improved Error Handling

- Introduced `TavilySearchDepth` and `TavilySearchTopic` enums for better type safety and clarity.
- Updated `TavilySearchSchema` to use enums for `search_depth` and `topic` fields.
- Added validation for enum values in `run_model` and `_tavily_search` methods.
- Improved error handling by raising `ToolException` for HTTP and unexpected errors.
- Updated dropdown inputs to use enum options directly.

* Add error handling and parameter flexibility to SerpAPI tool

- Introduced `ToolException` for improved error handling in SerpAPI searches.
- Added `SerpAPISchema` for structured search parameters.
- Modified `_build_wrapper` to accept dynamic parameters.
- Enhanced `search_func` to rebuild wrapper with new parameters and handle exceptions.

* feat: Enhance Glean Search API integration

Refactor the API wrapper and schema for better clarity and maintainability. Improve error handling for search results and streamline request preparation.

* Add error handling to DuckDuckGo search function using ToolException

---------

Co-authored-by: Eric Hare <ericrhare@gmail.com>
2024-11-12 11:59:32 +00:00
Edwin Jose
bbaec2b8da
fix: adding info to Agent and related components (#4495)
* info added

* Update openai.py

update to Open AI model info

* info changed

* Update tool_calling.py

made info of LLM much simpler

* info updated to be simpler

* Update agent.py
2024-11-12 03:03:44 +00:00
Gabriel Luiz Freitas Almeida
768e6f02ba
fix: Make from_template_and_variables async for backwards compatibility, add sync version, add tests and small fixes (#4500)
* Refactor `trace_name` property to use `_id` instead of `_vertex.id` for component identification

* Handle missing session_id attribute in component and agent classes

* Add SUPPORTED_VERSIONS constant for version tracking in tests

* Add utility to download components from GitHub in integration tests

* Rename TestComponent to ComponentForTesting to avoid conflict with pytest

* test: enhance PromptComponent tests for version support

Add parameterized testing for supported versions and a validation for the latest PromptComponent. This improves test coverage and ensures compatibility across different versions.

* refactor: move build_component_instance_for_tests utility to integration utils

* Make `from_template_and_variables` async for backwards compatibility and add sync version

* Refactor `PromptComponent` to use `Message.from_template` method across starter projects JSON files.

* add await to `from_template_and_variables` call

* Add async test for message prompt serialization and update cache directory handling

- Introduced `async` in `test_message_prompt_serialization` for asynchronous message creation.
- Added `test_message_sync_prompt_serialization` for synchronous message testing.
- Updated cache directory paths to "langflow_test" for test isolation.
- Utilized `monkeypatch` to set environment variable for cache directory in `langflow_cache_dir` fixture.

* Add fixture and existence check in test_schema_message.py

- Use `langflow_cache_dir` fixture in `test_message_with_single_image`.
- Add assertion to verify the existence of `second_image`.

* Add base test class to ensure file names are defined for all supported versions

* Remove default value for 'file_name' parameter in 'build_component_instance_for_tests' function

* Enhance `TestPromptComponent` with version-specific file name handling and base class integration

* Refactor test_prompt_component_versions to use FILE_NAMES_MAPPING directly

* Add component version tests and base classes for testing with/without client

* Simplify `build_component_instance_for_tests` by returning `cc_class` directly

* Refactor `TestPromptComponent` to use `ComponentTestBaseWithClient` and remove version tests

* Add assertion for LANGFLOW_CONFIG_DIR in test_message_with_multiple_images

* Refactor: update method call to `from_template` in `langchain_hub.py`

* Handle missing '_id' attribute in 'trace_name' method of custom_component.py

* Optimize `get_and_cache_all_types_dict` call by removing unnecessary thread usage in test.
2024-11-12 02:25:24 +00:00
Christophe Bornet
8bb0f65b47
fix: Use AsyncSession in some non-blocking APIs (#4484)
Fix sync/async DB usage in APIs:
* flows
* files
* folders
* monitor
2024-11-11 23:51:33 +00:00
bhatsanket
19963ded26
fix: ParseJSONDataComponent prevent unnecessary array wrapping (#4357)
* fix(ParseJSONDataComponent): prevent unnecessary array wrapping

Prevent wrapping non-array inputs in arrays to ensure correct JSON parsing and filtering.

* [autofix.ci] apply automated fixes

* updated failing test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-11 23:38:20 +00:00
Eric Hare
a107650cc6
FIX: Properly pass missing vectorize params in Astra DB (#4511) 2024-11-11 23:09:50 +00:00
Edwin Jose
aea9804527
fix: AWS Bedrock components (#4503)
* AWS Bedrock components update

* update in imports
2024-11-11 21:55:34 +00:00
Cristhian Zanforlin Lousa
961189a7dd
fix: prevent nested scrolling in markdown code blocks (#4505)
🔧 (NodeDescription/index.tsx): update class name to prevent text overflow and improve readability
2024-11-11 21:20:04 +00:00
Cristhian Zanforlin Lousa
133a8aec5c
fix: change input display name of Webhook component to "Payload" (#4507)
* change input display name of webhook component to payload

* [autofix.ci] apply automated fixes

* 📝 (docs): update formatting and alignment of tables in components-data.md to improve readability and consistency across the document

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-11 20:51:44 +00:00
Cristhian Zanforlin Lousa
537a8010f1
fix: Update duckduckgo-search to 6.3.4 and improve tests (#4504)
⬆️ (pyproject.toml): update duckduckgo-search dependency to version 6.3.4
🔧 (duckduckgo.spec.ts): remove test.skip from the test case to enable the test for duckduckgo search component
💡 (duckduckgo.spec.ts): refactor test case to improve readability and remove unnecessary code blocks
2024-11-11 20:34:03 +00:00
Cristhian Zanforlin Lousa
29e484465c
feat: Refactor langflow Components - Consolidate Imports, Remove Unused Components, and Update Astra Assistant Icons (#4460)
* fix lint

* fix lint

* [autofix.ci] apply automated fixes

* 📝 (message_to_data.py): refactor convert_message_to_data method to simplify code and improve readability
🔧 (conftest.py): update imports to organize them alphabetically for better code maintenance
🔧 (test_starter_projects.py): organize imports alphabetically for better code maintenance
🔧 (test_astra_component.py): organize imports alphabetically for better code maintenance
🔧 (test_parse_json_data.py): remove unnecessary whitespace for cleaner code
🔧 (test_chat_input.py): remove unnecessary whitespace for cleaner code
🔧 (test_text_input.py): remove unnecessary whitespace for cleaner code
🔧 (test_output_parser.py): remove unnecessary whitespace for cleaner code
🔧 (test_chat_output.py): remove unnecessary whitespace for cleaner code
🔧 (test_text_output.py): remove unnecessary whitespace for cleaner code
🔧 (test_prompt.py): remove unnecessary whitespace for cleaner code
🔧 (test_basic_prompting.py): remove unnecessary whitespace for cleaner code
🔧 (test_misc.py): remove unnecessary whitespace for cleaner code
🔧 (utils.py): remove unnecessary whitespace for cleaner code
🔧 (test_server_init.py): remove unnecessary whitespace for cleaner code
🔧 (test_endpoints.py): remove unnecessary whitespace for cleaner code
🔧 (test_component_toolkit.py): remove unnecessary whitespace for cleaner code
🔧 (test_agent_component.py): remove unnecessary whitespace for cleaner code
🔧 (test_agent_events.py): remove unnecessary whitespace for cleaner code
🔧 (test_tool_calling_agent.py): remove unnecessary whitespace for cleaner code
🔧 (test_structured_output_component.py): remove unnecessary whitespace for cleaner code
🔧 (test_chatollama_component.py): remove unnecessary whitespace for cleaner code

📝 (test_huggingface.py): Remove unnecessary import statement
📝 (test_create_data_component.py): Remove unnecessary import statement
📝 (test_update_data_component.py): Remove unnecessary import statement
📝 (test_componet_set_functionality.py): Remove unnecessary import statement
📝 (test_component.py): Remove unnecessary import statement
📝 (test_event_manager.py): Remove unnecessary import statement
📝 (test_edge_base.py): Remove unnecessary import statement
📝 (test_state_model.py): Remove unnecessary import statement
📝 (test_base.py): Remove unnecessary import statement
📝 (test_callback_graph.py): Remove unnecessary import statement
📝 (test_cycles.py): Remove unnecessary import statement
📝 (test_graph_state_model.py): Remove unnecessary import statement
📝 (test_runnable_vertices_manager.py): Remove unnecessary import statement
📝 (test_utils.py): Remove unnecessary import statement
📝 (test_graph.py): Remove unnecessary import statement
📝 (test_base_model_from_schema.py): Reorder import statements
📝 (test_memory_chatbot.py): Remove unnecessary import statement
📝 (test_vector_store_rag.py): Remove unnecessary import statement
📝 (test_inputs.py): Reorder import statements
📝 (test_io_schema.py): Remove unnecessary import statement
📝 (test_table_schema.py): Remove unnecessary import statement
📝 (test_schema_message.py): Remove unnecessary import statement
📝 (test_service.py): Reorder import statements
📝 (test_api_key.py): Remove unnecessary import statement
📝 (test_chat_endpoint.py): Remove unnecessary import statement
📝 (test_cli.py): Remove unnecessary import statement

📝 (test_custom_component.py): Add missing import statement in test_custom_component.py
📝 (test_custom_component_with_client.py): Add missing import statement in test_custom_component_with_client.py
📝 (test_data_class.py): Add missing import statement in test_data_class.py
📝 (test_data_components.py): Add missing import statement in test_data_components.py
📝 (test_database.py): Add missing import statement in test_database.py
📝 (test_endpoints.py): Add missing import statement in test_endpoints.py
📝 (test_files.py): Add missing import statement in test_files.py
📝 (test_frontend_nodes.py): Add missing import statement in test_frontend_nodes.py
📝 (test_initial_setup.py): Add missing import statement in test_initial_setup.py
📝 (test_kubernetes_secrets.py): Add missing import statement in test_kubernetes_secrets.py
📝 (test_logger.py): Add missing import statement in test_logger.py
📝 (test_login.py): Add missing import statement in test_login.py
📝 (test_messages.py): Add missing import statement in test_messages.py
📝 (test_messages_endpoints.py): Add missing import statement in test_messages_endpoints.py
📝 (test_schema.py): Add missing import statement in test_schema.py
📝 (test_telemetry.py): Add missing import statement in test_telemetry.py
📝 (test_template.py): Add missing import statement in test_template.py
📝 (test_user.py): Add missing import statement in test_user.py
📝 (test_validate_code.py): Add missing import statement in test_validate_code.py
📝 (test_connection_string_parser.py): Add missing import statement in test_connection_string_parser.py
📝 (test_format_directory_path.py): Add missing import statement in test_format_directory_path.py
📝 (test_rewrite_file_path.py): Add missing import statement in test_rewrite_file_path.py
📝 (test_truncate_long_strings.py): Add missing import statement in test_truncate_long_strings.py
📝 (test_truncate_long_strings_on_objects.py): Add missing import statement in test_truncate_long_strings_on_objects.py

* [autofix.ci] apply automated fixes

* formatting

* Update import paths for MemoryComponent and HuggingFaceEndpointsComponent

* fix tests

*  (decisionFlow.spec.ts): update test selectors to match changes in the application's UI for better test accuracy and reliability

* [autofix.ci] apply automated fixes

* ♻️ (test_output_parser.py): refactor import statements to improve code readability and maintainability

* fix tests

*  (Simple Agent.spec.ts): enable test for "Simple Agent" by removing the skip flag to ensure it runs properly

* [autofix.ci] apply automated fixes

* Remove optional type from 'num_news' field in YahooFinanceSchema

* Refactor JSON formatting for improved readability and maintainability across starter projects.

* adding icon to flows

* [autofix.ci] apply automated fixes

*  (similarity.spec.ts): update test selectors for filtering and connection nodes to match changes in the frontend implementation

* [autofix.ci] apply automated fixes

* removing init uncessary

* ⬆️ (pyproject.toml): upgrade crewai dependency to version 0.76.9 to include the latest features and bug fixes

*  (Simple Agent.spec.ts): update test assertion to check if the count of "print(" is greater than or equal to 1 for better test coverage.

* [autofix.ci] apply automated fixes

* proposed changes

* [autofix.ci] apply automated fixes

* add zep icon

* [autofix.ci] apply automated fixes

* 🔧 (model.py): remove unused import and method 'cast_vector_store' from LCVectorStoreComponent
🔧 (openai_tools.py): remove beta flag from OpenAIToolsAgentComponent
🔧 (tool_calling.py): remove beta flag from ToolCallingAgentComponent
🔧 (Vector Store RAG.json): remove 'cast_vector_store' method from starter projects
🔧 (styleUtils.ts): add missing icon 'WolframAlphaAPI' to nodeIconsLucide in styleUtils module

* add langwatch and mem0 icon

* change mem0 name to mem0ai

*  (filterSidebar.spec.ts): update test to use first() method to select the first element with the specified test ID
♻️ (filterSidebar.spec.ts): remove unnecessary code related to checking the checkbox state in the test
🔧 (generalBugs-shard-2.spec.ts): update test to select the correct element with the test ID "dataWebhook" instead of "dataWebhook Input"

* ♻️ (test_vector_store_rag.py): remove redundant code setting "vector_store" value in both ingestion_graph and rag_graph functions to improve code readability and maintainability

* [autofix.ci] apply automated fixes

* updating json test

* [autofix.ci] apply automated fixes

* ⬆️ (pyproject.toml): downgrade crewai dependency version from 0.76.9 to 0.74.2 to resolve compatibility issues

* 🐛 (generalBugs-shard-5.spec.ts): fix typo in test case for component name
🐛 (generalBugs-shard-9.spec.ts): update endX calculation to move 600 pixels to the right instead of 300
🐛 (generalBugs-shard-9.spec.ts): fix typo in test case for component name and update test steps to click "fit_view" button twice

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-11-11 19:30:05 +00:00
Gabriel Luiz Freitas Almeida
6b3bf7b523
chore: Add 'lf' and 'ff' options to Makefile for pytest configuration (#4494)
Add 'lf' and 'ff' options to Makefile for pytest configuration
2024-11-11 18:59:56 +00:00
Lucas Oliveira
859b72d634
fix: add colors to the templates and main page cards (#4497)
* Add swatch colors

* Implement new colors on templates modal

* Implement new colors on main page

* Removed hover icon color change on templates

---------

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2024-11-11 16:48:29 +00:00
Gabriel Luiz Freitas Almeida
06b7450652
feat: Enhance tool mapping and output rendering with animations (#4481)
* Enhance tool block mapping by using unique tool keys with name and run_id

* Enhance tool output rendering with Markdown and JSON formatting in ContentDisplay component

* Add animations for block title and content separators in ContentBlockDisplay component

* Allow 'size' prop to accept string values and update styling in BorderTrail component

* Adjust BorderTrail animation size and duration based on expansion state

* fix both borders trailing at the same time

* [autofix.ci] apply automated fixes

* fix text sizing

* fix spacing issues

* Adjust header title and text styling in ContentBlockDisplay and DurationDisplay components

* Refactor header title in ContentBlockDisplay component

* [autofix.ci] apply automated fixes

* Convert `test_handle_on_tool_start` to an async function and update tool content key logic

* Handle logger without 'opt' method in code parsing error handling

* Update test duration values in .test_durations file

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-11 16:32:08 +00:00
Gabriel Luiz Freitas Almeida
11888121af
fix: Simplify exception handling and refactor error messaging (#4496)
* Refactor `ExceptionWithMessageError` to remove redundant exception parameter

* Handle nested exceptions in message schema initialization

* fix: Simplify exception handling in LCAgentComponent
2024-11-11 16:10:58 +00:00
Mike Fortman
f66f31d4ce
refactor: Small improvements to sidebar, customParams, and flowToolbar for easier DSLF merges (#4487)
* DSLF refactor

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-11 15:28:46 +00:00
João
5a6c556e36
Feat: Adding Mem0 Integration (#4339)
* feat(frontend): adding Mem0 Icon

* feat(dependencies): adding and setting Mem0 dependency

* feat(frontend): adding Mem0 Icon

* feat: adding Mem0 components

* feat(dependencies): adding and setting Mem0 dependency

* Update uv.lock

update uv for memo

* update and delete mem0 removed

update and delete mem0 removed as per suggestion

* update requirement

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2024-11-11 15:15:09 +00:00
Gabriel Luiz Freitas Almeida
76c91de563
fix: Enable sorting of chat inputs to improve UI message speed (#4480) 2024-11-11 14:22:04 +00:00
Gabriel Luiz Freitas Almeida
f43fd895c6
fix: Enhance extract_class_name function to identify Component subclasses (#4492) 2024-11-11 13:43:59 +00:00
João
357c5878a5
feat: Adding Semantic Text Splitter Component (Text Splitters) (#4254)
* feat: Adding Semantic Text Splitter Component (Text Splitters)

* update: adding beta flag to component since it is imported from langchain_experimental

* update: adding beta flag to component since it is imported from langchain_experimental formatted

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2024-11-11 11:17:42 +00:00
Vinícios Batista da Silva
fa2854131a
feat: Add Google Oauth Token Component (#4383) 2024-11-11 03:03:57 -08:00
Gabriel Luiz Freitas Almeida
6ace83198b
feat: Add 'isToolMode' prop for enhanced tool mode support (#4483)
* fix: update getIconName function to support optional parameters and add tool mode handling

* Add 'isToolMode' prop to components for tool mode support

- Introduced 'isToolMode' prop across various components to enable tool mode functionality.
- Updated icon logic in textAreaComponent to use 'getIconName' with 'isToolMode'.
- Passed 'isToolMode' prop through parameterRenderComponent and related components.
- Adjusted inputGlobalComponent and NodeInputField to handle 'isToolMode' for conditional rendering.

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-11-10 17:37:06 -03:00
Gabriel Luiz Freitas Almeida
69a1c16e82
fix: serialize BaseModel subclasses and avoid calling methods on types (#4479)
Fix serialization for BaseModel subclasses by handling type objects separately
2024-11-09 01:23:01 +00:00
Mendon Kissling
33a42bcd6b
Docs: Authentication (#4476)
* initial-cleanup

* more

* docs: update authentication configuration guide for version 0.5

* introduce-table

* tech-and-docs-review
2024-11-08 22:09:28 +00:00
Lucas Oliveira
f32360fea8
fix: changed component colors name to not override existing colors, fixed responsiveness issues on main, playground and nav (#4482)
* Changed description color

* Updated edge colors

* updated color of output inspection

* Updated handle position to work with every case

* Open sidebar on filter

* Fixed empty folder on top of the sidebar

* Fix app header responsitivity

* Changed mobile playground showing

* Changed color name to datatype

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-08 21:10:18 +00:00
Gabriel Luiz Freitas Almeida
8681c56cdc
feat: Enhance backend with context management, error handling, and refactored code (#4286)
* Add cycle detection and management for graph vertices in run manager

* Refactor: Move AIMLEmbeddingsImpl to a new module path

* Add AIMLEmbeddingsImpl class for document and query embeddings using AIML API

* Add agent components for action routing, decision-making, execution, and context management

- Introduced `AgentActionRouter` to route agent flow based on action type.
- Added `DecideActionComponent` for determining actions from context and prompts.
- Implemented `ExecuteActionComponent` to execute actions using available tools.
- Created `GenerateThoughtComponent` for generating thoughts based on context.
- Developed `ProvideFinalAnswerComponent` to generate final answers from context.
- Built `AgentContextBuilder` for constructing `AgentContext` instances.
- Added `ObserveResultComponent` to process and observe action results.
- Implemented `CheckTerminationComponent` to determine if the agent should continue or terminate.

* Add AgentContext class for managing agent state and context serialization

- Introduced `AgentContext` class in `context.py` to handle agent state, including tools, language model, and context history.
- Implemented serialization methods for converting agent context to JSON-compatible format.
- Added validation for language model instances to ensure compatibility.
- Provided methods for updating and retrieving full context, including context history management.

* Add new agent components to the langflow module's init file

* Update `apply_on_outputs` to use `_outputs_map` in vertex base class

* Add _pre_run_setup method to custom component for pre-execution setup

* Handle non-list action types in decide_action method

* Enhance AgentActionRouter with iteration control and context routing logic

* Fix incorrect variable usage in tool call result message formatting

* Add AgentActionRouter to module exports in agents package

* Refactor cycle detection logic in graph base class

* Add test for complex agent flow with cyclic graph validation

* Enhance readiness checks in tracing service methods

* Add context management to Graph class with dotdict support

* Add context management methods to custom component class

- Introduced a `_ctx` attribute to store context data.
- Added `ctx` property to access the graph's context, raising an error if the graph is not built.
- Implemented `add_to_ctx` method to add key-value pairs to the context with an optional overwrite flag.
- Implemented `update_ctx` method to update the context with a dictionary of values, ensuring the graph is built and the input is a dictionary.

* Add customizable Agent component with input/output handling and action routing

* Handle non-list 'tools' attribute in 'build_context' method

* Convert `get_response` method to asynchronous and update graph processing to use async iteration.

* Add async test for Agent component in graph cycle tests

* Refactor Agent Flow JSON: Simplify input types and update agent component structure

- Removed "BaseTool" from input types for "ToolCallingAgent" to streamline tool handling.
- Updated agent component to a more modular structure with new prompts and input configurations.
- Replaced deprecated methods and fields with updated implementations for improved functionality.
- Adjusted metadata and configuration settings for better clarity and usability.

* [autofix.ci] apply automated fixes

* Add Agent import to init, improve error handling, and clean up imports

- Added `Agent` import to `__init__.py` for better module accessibility.
- Improved error handling in `aiml_embeddings.py` by raising a `ValueError` when the expected embedding count is not met.
- Cleaned up redundant imports in `test_cycles.py` to enhance code readability.

* Refactor agent component imports for improved modularity and organization

* Remove agent components and update `__init__.py` exports

* Add iteration control and default route options to ConditionalRouter component

* Refactor graph tests to include new components and update iteration logic

- Replaced complex agent flow with a simplified guessing game using OpenAI components and conditional routing.
- Introduced `TextInputComponent` and updated `ChatInput` initialization.
- Added new test `test_conditional_router_max_iterations` to validate conditional routing with max iterations.
- Updated graph cyclicity assertions and snapshot checks for improved test coverage.
- Removed deprecated agent components and related logic.

* Refactor conditional router to return message consistently and use iterate_and_stop_once method

* Add return type annotations to methods in langsmith.py

* Remove unnecessary `@override` decorator and add `# noqa: ARG002` comments for unused arguments

* Move ChatInput import inside flow_component fixture in conftest.py

* Update test to use _outputs_map for cycle outputs retrieval

* Refactor `iterate_and_stop_once` to remove redundant `_id` variable usage

* Add default route to ConditionalRouterComponent in cycle test

* Implement synchronous graph execution using threading and queues

- Removed `nest_asyncio` dependency and replaced it with a new threading-based approach for synchronous graph execution.
- Introduced a `queue.Queue` to handle results and exceptions between threads.
- Added a new thread to run asynchronous code, ensuring proper event loop management and task completion.
- Updated methods to return sorted lists of runnable vertices for consistency.

* Update import path for ModelConstants in test_model_constants.py

* [autofix.ci] apply automated fixes

* fix: add property decorator

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-11-08 20:28:30 +00:00
Lucas Oliveira
b898d8a652
fix: refactor sidebar disposition for sidebar to not push main out of screen (#4477)
Fixed sidebar pushing main
2024-11-08 19:09:57 +00:00
Gabriel Luiz Freitas Almeida
c5495c4aac
fix: Remove 'refresh_button' from DropdownInput in AgentComponent configuration (#4471)
* Remove 'refresh_button' from DropdownInput in AgentComponent configuration

* Add 'Current Date' tool option to AgentComponent inputs and update response method

* Disable refresh button in Agent Flow starter project configuration
2024-11-08 17:43:50 +00:00
Lucas Oliveira
a09652ca5f
fix: refactor loading of main page, use new Sidebar in main page, fix small UI bugs (#4451)
* Tighten space between main page sidebar buttons

* Fixed skeleton size

* Added playground button back

* Updated no components and flows state

* Update default icon to Workflow

* Fixed size of list cards

* Removed browse store

* Removed playground button

* Removed black background from empty folder state

* Update empty state color

* Fix color of empty state

* fix text not selectable

* updated border color

* added shadow only on hover

* Remove JSON from Download JSON

* Fixed colors and weight of tabs on home page

* Fixed padding on list and grid components

* Update icons that take long to load

* Fixed icon and bg color for home tiles

* Removed unused code

* removed placeholder data for skeleton to not appear on first load

* Make onSuccess refetch the queries so that the loading waits for it

* Removed unused divs on foldersidebarnav

* Refactor sidebar buttons to use new shadcn sidebar

* Created skeletons for folder, grid and list

* Added new sidebar size

* Use new sidebar button on header and implemented animation

* Changed icon to getIcon

* Added sidebar provider and fixed loading states of the main page

* Removed folder buttons on emptyPage

* Fixed foldername to appear immediatly, and fixed loading states for the folders

* Removed unused state from folders store

* Removed unused states from folders store type

* Added new icon

* fixed modals component to not show a trash icon

* Changed icons to load immediatly

* Added empty folder condition to not display header info

* Added conditions to show loading state until everything loads

* Created empty folder state

* Changed empty page to correct colors

* Added skeletons while flows of the folder are loading

* Removed shadow from text

* Fixed font chivo taking long time to load

* Fix adding new folder not redirecting

* [autofix.ci] apply automated fixes

* Fixed colors and paddings on list and grid components

* Re added tooltips to upload and create folders

* fix input for name editing

* Fix tests

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-11-08 17:33:52 +00:00
Lucas Oliveira
6761df6110
fix: update nav bar UI, changed user menu to use shadcn dropdown, fix responsivity issues (#4454)
* Updated saved color

* Removed selection from header /

* hide text from 1200px

* Updated github star style

* Fixed hover state on account menu

* Fix misalignment of store

* Changed user menu to use dropdown menu from shadcn

* Fixed notification dot

* Change mobile responsivity

* Fixed flow settings name

* Implement opening the sidebar when hitting /

* Fixed code opening when hitting space on sidebar

* Fixed errors with tests
2024-11-08 17:20:36 +00:00
Eric Hare
a4863bbe57
fix: pdf parsing, pass as str instead of posix path (#4448)
* FIX: PyMuPDF for parsing, pass as str instead of posix path

* Switch back to pypdf due to licensing

* Allow specification of the number of threads

* [autofix.ci] apply automated fixes

* Update file.py

* Switch StrInput to IntInput

*  (Document QA.json, Vector Store RAG.json): Update FileComponent class to include IntInput for concurrency_multithreading to control the number of workers for parallel processing. This enhancement allows for better control and optimization of processing tasks.

* ⬆️ (pyproject.toml): upgrade langchain-core dependency from version 0.3.10 to version 0.3.12 to ensure compatibility and leverage new features

* ⬆️ (pyproject.toml): update langchain-core dependency to allow versions greater than or equal to 0.3.12 for compatibility reasons

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-11-08 16:55:06 +00:00
Gabriel Luiz Freitas Almeida
98274633db
fix: remove use of ImagePromptTemplate in image handling and adds image utils (#4467)
* remove poetry.lock

* fix: update langchain-core dependency version to 0.3.15

* feat: add functions to convert images to base64 and create data URLs

* refactor: simplify image URL handling by replacing ImagePromptTemplate with create_data_url function

* Fix image URL structure in data schema to use nested dictionary format

* Add unit tests for Data schema message conversion with text and images

* test: add unit tests for image utility functions to validate base64 conversion and data URL creation

* Refactor image URL generation to use `create_data_url` utility function instead of `ImagePromptTemplate`

* Add unit tests for message handling and image processing in schema module

- Introduce fixtures for temporary cache directory and sample image creation.
- Add tests for message creation from human and AI text.
- Implement tests for messages with single and multiple images.
- Include tests for invalid image paths and messages without sender.
- Add message serialization and conversion tests.
- Ensure cleanup of cache directory after tests.

* Use platformdirs to determine cache directory paths in test_schema_message.py
2024-11-08 08:24:19 -08:00
Gabriel Luiz Freitas Almeida
7114cc4799
ci: Add temporary database setup for performance tests (#4469)
Add temporary database setup for performance tests and assertions for database URL
2024-11-08 14:41:01 +00:00
Mendon Kissling
1138869d0f
Docs: backend only mode (#4405)
* initial-cleanup-and-test

* better-flow

* config

* Apply suggestions from code review

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>

* more-why-clarity

* cleanup

* code-review-and-tech-review

---------

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
2024-11-08 14:00:43 +00:00