Commit graph

9,749 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
0bfb702736 refactor: Remove unused imports and optimize get_messages function 2024-06-25 20:22:58 -03:00
Gabriel Luiz Freitas Almeida
76fffe5990 ♻️ (service.py): remove unused code related to adding and retrieving messages in MonitorService 2024-06-25 20:22:58 -03:00
Gabriel Luiz Freitas Almeida
3204af1263 📝 (memory.py): Refactor get_messages function to use SQLAlchemy select statement for better performance and readability
📝 (memory.py): Refactor delete_messages function to use SQLAlchemy delete statement for better performance and readability
📝 (monitor/schema.py): Update MessageModel to use UUID type for id and flow_id for consistency and better data handling
2024-06-25 20:22:58 -03:00
Gabriel Luiz Freitas Almeida
a857375016 refactor: Remove unused imports in authContext.tsx 2024-06-25 20:22:58 -03:00
Gabriel Luiz Freitas Almeida
7be4f88678 refactor: ignore type error 2024-06-25 20:22:58 -03:00
Gabriel Luiz Freitas Almeida
22609eac70 chore: Fix issue with message timestamp conversion in MessageBase model 2024-06-25 20:22:58 -03:00
ogabrielluiz
cd73904095 Apply Prettier formatting 2024-06-25 20:22:58 -03:00
Gabriel Luiz Freitas Almeida
988d2cf10b fix: Refactor monitor.py messages endpoints 2024-06-25 20:22:58 -03:00
Gabriel Luiz Freitas Almeida
1105e61200 Refactor add_messages function to separate message addition and commit logic 2024-06-25 20:22:58 -03:00
Gabriel Luiz Freitas Almeida
8fbf026476 Fix issue with message timestamp conversion in MessageBase model 2024-06-25 20:22:57 -03:00
Gabriel Luiz Freitas Almeida
f5fec47f76 chore: Add error handling for message not found in update_message endpoint 2024-06-25 20:22:57 -03:00
anovazzi1
6d9e2e4350 format code 2024-06-25 20:22:57 -03:00
anovazzi1
35d80fe978 fix fetch data to work even with autologin true 2024-06-25 20:22:57 -03:00
Gabriel Luiz Freitas Almeida
3bb5f9d5e7 refactor: Update messages endpoints to use database table 2024-06-25 20:22:57 -03:00
Gabriel Luiz Freitas Almeida
c1c478e8c4 refactor: Update add_messages function to use database session
This commit refactors the add_messages function in memory.py to use a database session for adding messages to the monitor service. Instead of directly calling the monitor_service.add_message method, the messages are now added using a session object. This change ensures that the messages are properly persisted in the database and improves the reliability of the application.
2024-06-25 20:22:57 -03:00
Gabriel Luiz Freitas Almeida
2b0765d41b feat: Add message table to the database
This commit adds a new table called "message" to the database. The table includes columns for timestamp, sender, sender_name, session_id, text, id, flow_id, and files. The "message" table is created using Alembic migration. This addition allows for storing and retrieving messages in the application.
2024-06-25 20:22:57 -03:00
Gabriel Luiz Freitas Almeida
2ed4d54f99
Add check-format script and update lint-js.yml (#2357)
* chore: Add check-format script to package.json for code formatting consistency

* chore: Update lint-js.yml to use npm run check-format instead of npm run format
2024-06-25 14:46:51 -07:00
cristhianzl
4faf84ebee ♻️ (flows.py): rename loop variable flow to _flow to avoid shadowing and improve readability 2024-06-25 13:42:01 -07:00
cristhianzl
b05455a9b8 refactor: Ensure flow names are unique by appending a number if necessary 2024-06-25 19:25:14 +00:00
Gabriel Luiz Freitas Almeida
4365e3d2d8 chore: Update package versions in pyproject.toml files 2024-06-25 15:31:29 -03:00
Gabriel Luiz Freitas Almeida
4ed879ff56 Refactor telemetry service payload field names for consistency 2024-06-25 15:31:29 -03:00
Gabriel Luiz Freitas Almeida
0f8cd9e572 chore: Update authContext imports and remove duplicate imports 2024-06-25 15:31:29 -03:00
Cristhian Zanforlin Lousa
4077135ba7 Updating Tests and Fixing Related Bugs (#2319)
* 🐛 (tableNodeCellRender): fix templateValue check to use Object.keys
 (textAreaComponent): add Case component for conditional rendering
♻️ (editNodeModal): remove commented-out useEffect code
 (basicExamples.spec): update test selectors and increase timeout values

 (filterEdge.spec.ts): update test IDs to match new naming conventions

 (inputListComponent.spec.ts, intComponent.spec.ts): update test IDs and streamline test steps for consistency and clarity

 (keyPairListComponent.spec.ts): update test ID for model element
 (keyPairListComponent.spec.ts): add steps to test editing model options and saving changes

*  (tests): update end-to-end tests for chat input/output and modal components

- Update test selectors for better accuracy
- Add keyboard interaction in chatInputOutputUser.spec.ts
- Improve file handling in chat image upload test
- Refine prompt modal component tests for better validation
- Enhance twoEdges.spec.ts with additional view controls

* ♻️ (tests): refactor repeated click actions into reusable function in e2e tests

*  (tests): replace waitForTimeout with waitForSelector in end-to-end tests

*  (typescript_test.yml): add --debug flag to Playwright test command for better debugging

*  (typescript_test.yml): enable trace option in Playwright tests for better debugging

*  (typescript_test.yml): reduce Playwright test workers from 2 to 1 to improve stability
 (textInputOutput.spec.ts): add waitFor visibility checks to ensure elements are visible before interaction

*  (tests): update paths for test assets to correct locations
 (tests): add waitForSelector to ensure elements are loaded before interaction

*  (typescript_test.yml): increase Playwright workers from 1 to 2 to speed up tests
 (chatInputOutputUser.spec.ts): increase timeout for AI response to 100000ms
 (chatInputOutputUser.spec.ts): correct file path for image upload test
 (deleteComponentFlows.spec.ts): change waitFor to target last checkbox-component
 (store.spec.ts): increase timeout for share button to 100000ms

* 🐛 (flows.py): ensure flow names are unique by appending a number if necessary

* Apply Ruff formatting

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Cristhianzl <Cristhianzl@users.noreply.github.com>
2024-06-25 10:21:38 -07:00
Cristhian Zanforlin Lousa
2fe2024a58 Fix lint error version of tailwind css plugin (#2323)
⬆️ (package.json): update prettier-plugin-tailwindcss to version 0.6.5
♻️ (package.json): reorder @types/lodash dependency for consistency

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-06-25 10:21:38 -07:00
anovazzi1
f954295731 format code 2024-06-25 10:21:38 -07:00
anovazzi1
c8d37c38b4 fix fetch data to work even with autologin true 2024-06-25 10:21:38 -07:00
Gabriel Luiz Freitas Almeida
fff4537b1e
Fixes CLI and server (#2342)
* chore: update linting workflows to include dev branch in merge_group

* Update README.md

Add 1.0 banner

* Update README.md

* chore: update package versions in pyproject.toml files

* Refactor "created_at" column type for consistency and fix cancel middleware (#2316)

* chore: update linting workflows to include dev branch in merge_group

* Update README.md

Add 1.0 banner

* Update README.md

* chore: update package versions in pyproject.toml files

* refactor: update "created_at" column type to use the "sa" module for consistency

* Update README.md

Add 1.0 banner

* chore: Remove unused import in ToolCallingAgent.py

* fix: adapt RequestCancelledMiddleware to handle cancelled requests

* chore: Remove unused import in test_helper_components.py

* refactor: Declare queue variable with explicit type in RequestCancelledMiddleware

---------

Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>

* chore: Update AstraDB.py imports and method signature for search_documents

* chore: Update package versions in pyproject.toml files

* chore: Update run-name in release.yml for Langflow Release

* fix: add call to _add_documents_to_vector_store in AstraDB component

* chore: Fix missing parentheses in RequestCancelledMiddleware

* chore: Update pydantic-settings and tenacity versions

The commit updates the versions of the `pydantic-settings` and `tenacity` packages in the `poetry.lock` file. The `pydantic-settings` version is updated from 2.3.3 to 2.3.4, and the `tenacity` version is updated from 8.4.1 to 8.4.2.

* Update README.md

Add 1.0 banner

* fix fetch data to work even with autologin true

* format code

* deactivate stop button until we have a better solution (#2337)

* consistent auth error status code

* [Fix] unhandled http errors in background tasks (#2326)

* handle exceptions for background task

* revert changes that is not related to this HTTP handler exception

* Refactor model GoogleGenerativeAIModel (#2251)

* refactor model GoogleGenerativeAIModel

* adds model options

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>

* Fix .env values not being honored in CLI (#2336)

* chore: Update launch.json to include environment file

The launch.json file was updated to include the environment file path for the "run" command in the "Python: Flask" configuration. This change ensures that the necessary environment variables are loaded when running the backend base of Langflow frontend. The previous configuration had the environment variables set in the "env" field, but it has been removed as it is redundant with the new environment file inclusion.

* chore: Update dotenv import and environment variable handling

This commit updates the import statement for the `dotenv` module in the `__main__.py` file. It adds the `dotenv_values` function to the import statement to enable loading environment variables from a file. Additionally, it introduces a new section of code that maps environment variables to their corresponding variables and types, allowing for more flexible and dynamic configuration. The commit also updates the `run` function to update variables based on environment variables, if they are present. This change improves the handling of environment variables and enhances the configurability of the application.

* deactivate stop button until we have a better solution (#2337)

* consistent auth error status code

* [Fix] unhandled http errors in background tasks (#2326)

* handle exceptions for background task

* revert changes that is not related to this HTTP handler exception

* Refactor model GoogleGenerativeAIModel (#2251)

* refactor model GoogleGenerativeAIModel

* adds model options

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>

---------

Co-authored-by: ming luo <itestmycode@gmail.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>

* Update GitHub Actions workflows and dependencies (#2341)

* chore: Add GitHub Actions workflow for testing documentation build

* Fix server start command in GitHub Actions workflows

* chore: Bump langflow and langflow-base versions

* chore: Update GitHub Actions workflow for docs_test

* chore: Update typing import in __main__.py

* Fix user authentication and authorization issues (#2343)

---------

Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: ming luo <itestmycode@gmail.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
2024-06-25 09:20:55 -07:00
Gabriel Luiz Freitas Almeida
af98504e4a
Fix Astra Component and Middleware (#2321)
* chore: update linting workflows to include dev branch in merge_group

* Update README.md

Add 1.0 banner

* Update README.md

* chore: update package versions in pyproject.toml files

* Refactor "created_at" column type for consistency and fix cancel middleware (#2316)

* chore: update linting workflows to include dev branch in merge_group

* Update README.md

Add 1.0 banner

* Update README.md

* chore: update package versions in pyproject.toml files

* refactor: update "created_at" column type to use the "sa" module for consistency

* Update README.md

Add 1.0 banner

* chore: Remove unused import in ToolCallingAgent.py

* fix: adapt RequestCancelledMiddleware to handle cancelled requests

* chore: Remove unused import in test_helper_components.py

* refactor: Declare queue variable with explicit type in RequestCancelledMiddleware

---------

Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>

* chore: Update AstraDB.py imports and method signature for search_documents

* chore: Update package versions in pyproject.toml files

* chore: Update run-name in release.yml for Langflow Release

* fix: add call to _add_documents_to_vector_store in AstraDB component

* chore: Fix missing parentheses in RequestCancelledMiddleware

* chore: Update pydantic-settings and tenacity versions

The commit updates the versions of the `pydantic-settings` and `tenacity` packages in the `poetry.lock` file. The `pydantic-settings` version is updated from 2.3.3 to 2.3.4, and the `tenacity` version is updated from 8.4.1 to 8.4.2.

* Update README.md

Add 1.0 banner

---------

Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>
2024-06-24 13:29:41 -07:00
Gabriel Luiz Freitas Almeida
d85657f214
Refactor "created_at" column type for consistency and fix cancel middleware (#2316) (#2320)
* chore: update linting workflows to include dev branch in merge_group

* Update README.md

Add 1.0 banner

* Update README.md

* chore: update package versions in pyproject.toml files

* Refactor "created_at" column type for consistency and fix cancel middleware (#2316)

* chore: update linting workflows to include dev branch in merge_group

* Update README.md

Add 1.0 banner

* Update README.md

* chore: update package versions in pyproject.toml files

* refactor: update "created_at" column type to use the "sa" module for consistency

* Update README.md

Add 1.0 banner

* chore: Remove unused import in ToolCallingAgent.py

* fix: adapt RequestCancelledMiddleware to handle cancelled requests

* chore: Remove unused import in test_helper_components.py

* refactor: Declare queue variable with explicit type in RequestCancelledMiddleware

---------

Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>

* chore: Update AstraDB.py imports and method signature for search_documents

* chore: Update package versions in pyproject.toml files

* chore: Update run-name in release.yml for Langflow Release

* fix: add call to _add_documents_to_vector_store in AstraDB component

---------

Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>
2024-06-24 13:15:54 -07:00
Gabriel Luiz Freitas Almeida
75dbf1b39d chore: update package versions in pyproject.toml files 2024-06-24 07:41:40 -07:00
Lucas Oliveira
1af961f1f7 Fixed starter flows 2024-06-24 07:38:40 -07:00
Gabriel Luiz Freitas Almeida
24d9e86885 chore: update package versions in pyproject.toml files 2024-06-24 10:19:17 -03:00
Gabriel Luiz Freitas Almeida
a539c90c31 chore: fix types in Alembic migration script 2024-06-24 10:10:29 -03:00
Gabriel Luiz Freitas Almeida
ceaff46016 Merge remote-tracking branch 'origin/main' into dev 2024-06-24 10:09:44 -03:00
Gabriel Luiz Freitas Almeida
07cc7b31a1 chore: remove merge artifact 2024-06-24 06:08:28 -07:00
Gabriel Luiz Freitas Almeida
4b72a7caa8 Fix unique constraints for id column and update API key creation (#1764)
* Update .gitignore to ignore additional files and directories

* Add migration to fix column types

* Bump version to 0.6.17 in pyproject.toml
2024-06-24 06:08:28 -07:00
Gabriel Luiz Freitas Almeida
184f2524cf refactor: make rag example be two flows again 2024-06-24 05:59:32 -07:00
Lucas Oliveira
4e26b46825 FIxed basic prompting 2024-06-24 05:59:32 -07:00
Lucas Oliveira
c55bbfdc9b Fixed examples to use gpt 4 2024-06-24 05:59:32 -07:00
Gabriel Luiz Freitas Almeida
bb785c7be4 fix: remove prompt chaining project 2024-06-24 05:59:32 -07:00
Gabriel Luiz Freitas Almeida
39320ae31e refactor: Update nodeColors and nodeNames in styleUtils.ts for consistency 2024-06-24 05:59:32 -07:00
Lucas Oliveira
723d854db2 Fixed starter examples 2024-06-24 05:59:32 -07:00
Lucas Oliveira
4cc7ae1f2a Fixed starter examples 2024-06-24 05:59:32 -07:00
Lucas Oliveira
d0e84c1dc8 Fixed starter examples 2024-06-24 05:59:32 -07:00
Gabriel Luiz Freitas Almeida
243a4e77f0 Update column types and bump version (#1653)
* Add logger import in script.py.mako

* Fix error handling during upgrade in alembic scripts

* Bump version to 0.6.14 in pyproject.toml

* Update column types in credential and api_key models

* Bump version to 0.6.15 in pyproject.toml
2024-06-24 05:56:11 -07:00
Gabriel Luiz Freitas Almeida
537cf93493 Add logger import and fix error handling during upgrade in alembic scripts (#1650)
* Add logger import in script.py.mako

* Fix error handling during upgrade in alembic scripts

* Bump version to 0.6.14 in pyproject.toml
2024-06-24 05:56:11 -07:00
Gabriel Luiz Freitas Almeida
5c09ff40d9 refactor: Update LangSmithTracer initialization error handling 2024-06-24 05:55:46 -07:00
Gabriel Luiz Freitas Almeida
7f94f5f5dd Update project documentation URLs to use the new domain 2024-06-24 05:43:40 -07:00
Gabriel Luiz Freitas Almeida
47940c8aa5 refactor: Update ToolCallingAgentComponent input_dict type to use Dict[str, str] for values 2024-06-24 05:42:46 -07:00
Gabriel Luiz Freitas Almeida
ef1e70d151 style: run prettier 2024-06-24 05:05:35 -07:00