diff --git a/docs/docs/deployment/backend-only.md b/docs/docs/deployment/backend-only.md index 43e412a46..fb5efdfdb 100644 --- a/docs/docs/deployment/backend-only.md +++ b/docs/docs/deployment/backend-only.md @@ -4,7 +4,7 @@ You can run Langflow in `--backend-only` mode to expose your Langflow app as an Start langflow in backend-only mode with `python3 -m langflow run --backend-only`. -The terminal prints ` Welcome to ⛓ Langflow `, and a blank window opens at `http://127.0.0.1:7864/all`. +The terminal prints `Welcome to ⛓ Langflow`, and a blank window opens at `http://127.0.0.1:7864/all`. Langflow will now serve requests to its API without the frontend running. ## Prerequisites @@ -42,7 +42,7 @@ Note the flow ID of `ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef`. You can find this ID 1. Stop Langflow with Ctrl+C. 2. Start langflow in backend-only mode with `python3 -m langflow run --backend-only`. - The terminal prints ` Welcome to ⛓ Langflow `, and a blank window opens at `http://127.0.0.1:7864/all`. + The terminal prints `Welcome to ⛓ Langflow`, and a blank window opens at `http://127.0.0.1:7864/all`. Langflow will now serve requests to its API. 3. Run the curl code you copied from the UI. You should get a result like this: diff --git a/src/backend/base/langflow/api/utils.py b/src/backend/base/langflow/api/utils.py index 048f14ac3..1dbd68d8f 100644 --- a/src/backend/base/langflow/api/utils.py +++ b/src/backend/base/langflow/api/utils.py @@ -86,6 +86,10 @@ def update_frontend_node_with_template_values(frontend_node, raw_frontend_node): update_template_values(frontend_node["template"], raw_frontend_node["template"]) + old_code = raw_frontend_node["template"]["code"]["value"] + new_code = frontend_node["template"]["code"]["value"] + frontend_node["edited"] = old_code != new_code + return frontend_node diff --git a/src/backend/base/langflow/api/v1/files.py b/src/backend/base/langflow/api/v1/files.py index bbe97f81a..f6293686f 100644 --- a/src/backend/base/langflow/api/v1/files.py +++ b/src/backend/base/langflow/api/v1/files.py @@ -2,6 +2,7 @@ import hashlib from http import HTTPStatus from io import BytesIO from uuid import UUID +from pathlib import Path from fastapi import APIRouter, Depends, HTTPException, UploadFile from fastapi.responses import StreamingResponse @@ -99,6 +100,47 @@ async def download_image(file_name: str, flow_id: UUID, storage_service: Storage raise HTTPException(status_code=500, detail=str(e)) +@router.get("/profile_pictures/{folder_name}/{file_name}") +async def download_profile_picture( + folder_name: str, + file_name: str, + storage_service: StorageService = Depends(get_storage_service), +): + try: + extension = file_name.split(".")[-1] + config_dir = get_storage_service().settings_service.settings.config_dir + config_path = Path(config_dir) + folder_path = config_path / 'profile_pictures' / folder_name + content_type = build_content_type_from_extension(extension) + file_content = await storage_service.get_file(flow_id=folder_path, file_name=file_name) + return StreamingResponse(BytesIO(file_content), media_type=content_type) + + except Exception as e: + raise HTTPException(status_code=500, detail=str(e)) + + +@router.get("/profile_pictures/list") +async def list_profile_pictures(storage_service: StorageService = Depends(get_storage_service)): + try: + config_dir = get_storage_service().settings_service.settings.config_dir + config_path = Path(config_dir) + + people_path = config_path / "profile_pictures/People" + space_path = config_path / "profile_pictures/Space" + + people = await storage_service.list_files(flow_id=people_path) + space = await storage_service.list_files(flow_id=space_path) + + files = [Path("People") / i for i in people] + files += [Path("Space") / i for i in space] + + return {"files": files} + + except Exception as e: + raise HTTPException(status_code=500, detail=str(e)) + + + @router.get("/list/{flow_id}") async def list_files( flow_id: UUID = Depends(get_flow_id), storage_service: StorageService = Depends(get_storage_service) diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-01.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-01.png new file mode 100644 index 000000000..fa4fed5d1 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-01.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-02.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-02.png new file mode 100644 index 000000000..6519e7657 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-02.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-03.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-03.png new file mode 100644 index 000000000..512a5b037 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-03.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-04.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-04.png new file mode 100644 index 000000000..6c84a0792 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-04.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-05.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-05.png new file mode 100644 index 000000000..8e4b22298 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-05.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-06.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-06.png new file mode 100644 index 000000000..d317eb499 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-06.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-07.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-07.png new file mode 100644 index 000000000..ed2ed8214 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-07.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-08.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-08.png new file mode 100644 index 000000000..0785f59ea Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-08.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-09.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-09.png new file mode 100644 index 000000000..8dd5b1677 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-09.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-10.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-10.png new file mode 100644 index 000000000..058dff1a8 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-10.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-11.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-11.png new file mode 100644 index 000000000..a517fad0d Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-11.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-12.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-12.png new file mode 100644 index 000000000..508590f18 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-12.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-13.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-13.png new file mode 100644 index 000000000..90865a49d Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-13.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-14.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-14.png new file mode 100644 index 000000000..269621bb2 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-14.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-15.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-15.png new file mode 100644 index 000000000..da85a4e30 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-15.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-16.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-16.png new file mode 100644 index 000000000..cf30ae136 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-16.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-17.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-17.png new file mode 100644 index 000000000..d53cd7997 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-17.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-18.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-18.png new file mode 100644 index 000000000..e0ac43aab Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-18.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-19.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-19.png new file mode 100644 index 000000000..d04a96a27 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-19.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-20.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-20.png new file mode 100644 index 000000000..e2d6e99bc Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-20.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-21.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-21.png new file mode 100644 index 000000000..392b004e2 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-21.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-22.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-22.png new file mode 100644 index 000000000..606aed15d Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-22.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-23.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-23.png new file mode 100644 index 000000000..c16d96d41 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-23.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-24.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-24.png new file mode 100644 index 000000000..e0dd6a1b2 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-24.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-25.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-25.png new file mode 100644 index 000000000..08aeb61c3 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-25.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-26.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-26.png new file mode 100644 index 000000000..312ef035c Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-26.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-27.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-27.png new file mode 100644 index 000000000..95972203e Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-01-27.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-01.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-01.png new file mode 100644 index 000000000..b55f875ac Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-01.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-02.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-02.png new file mode 100644 index 000000000..b51a3b136 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-02.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-03.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-03.png new file mode 100644 index 000000000..8b386a081 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-03.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-04.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-04.png new file mode 100644 index 000000000..e36804f81 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-04.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-05.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-05.png new file mode 100644 index 000000000..7e4661821 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-05.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-06.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-06.png new file mode 100644 index 000000000..5ce14b221 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-06.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-07.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-07.png new file mode 100644 index 000000000..c91f89584 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-07.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-08.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-08.png new file mode 100644 index 000000000..4f4c4ab2e Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-08.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-09.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-09.png new file mode 100644 index 000000000..9c1b5b34d Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-09.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-10.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-10.png new file mode 100644 index 000000000..6746a9cc1 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-10.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-11.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-11.png new file mode 100644 index 000000000..771ed1869 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-11.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-12.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-12.png new file mode 100644 index 000000000..f32aa58ee Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-12.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-13.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-13.png new file mode 100644 index 000000000..ae8db49a6 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-13.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-14.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-14.png new file mode 100644 index 000000000..038272194 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-14.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-15.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-15.png new file mode 100644 index 000000000..073b456a0 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-15.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-16.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-16.png new file mode 100644 index 000000000..5369cf9af Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-16.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-17.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-17.png new file mode 100644 index 000000000..1f143bc30 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-17.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-18.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-18.png new file mode 100644 index 000000000..3456bf542 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-18.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-19.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-19.png new file mode 100644 index 000000000..a8f673724 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-19.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-20.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-20.png new file mode 100644 index 000000000..5384bf7a1 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-20.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-21.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-21.png new file mode 100644 index 000000000..1c6a39bbf Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-21.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-22.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-22.png new file mode 100644 index 000000000..976f94dc1 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-22.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-23.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-23.png new file mode 100644 index 000000000..c6ca79192 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-23.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-24.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-24.png new file mode 100644 index 000000000..429f74046 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-24.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-25.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-25.png new file mode 100644 index 000000000..38aeea19c Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-25.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-26.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-26.png new file mode 100644 index 000000000..65342b59d Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-26.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-27.png b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-27.png new file mode 100644 index 000000000..1c2fc7717 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/People/People Avatar-02-27.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/026-alien.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/026-alien.png new file mode 100644 index 000000000..218c03407 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/026-alien.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/027-satellite.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/027-satellite.png new file mode 100644 index 000000000..f72f22226 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/027-satellite.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/028-alien.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/028-alien.png new file mode 100644 index 000000000..2e558a69d Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/028-alien.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/029-telescope.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/029-telescope.png new file mode 100644 index 000000000..6c3622fea Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/029-telescope.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/030-books.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/030-books.png new file mode 100644 index 000000000..f1b5cf777 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/030-books.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/031-planet.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/031-planet.png new file mode 100644 index 000000000..289a237c9 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/031-planet.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/032-constellation.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/032-constellation.png new file mode 100644 index 000000000..ca09192a6 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/032-constellation.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/033-planet.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/033-planet.png new file mode 100644 index 000000000..de3bf7548 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/033-planet.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/034-alien.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/034-alien.png new file mode 100644 index 000000000..0ed7f3a46 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/034-alien.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/035-globe.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/035-globe.png new file mode 100644 index 000000000..b58ec3148 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/035-globe.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/036-eclipse.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/036-eclipse.png new file mode 100644 index 000000000..4cb944fd2 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/036-eclipse.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/037-meteor.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/037-meteor.png new file mode 100644 index 000000000..f1e11b5ed Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/037-meteor.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/038-eclipse.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/038-eclipse.png new file mode 100644 index 000000000..63c8893ed Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/038-eclipse.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/039-Asteroid.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/039-Asteroid.png new file mode 100644 index 000000000..8b858f28e Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/039-Asteroid.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/040-mission.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/040-mission.png new file mode 100644 index 000000000..0befc44f1 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/040-mission.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/041-spaceship.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/041-spaceship.png new file mode 100644 index 000000000..d499c98b6 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/041-spaceship.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/042-space shuttle.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/042-space shuttle.png new file mode 100644 index 000000000..f13df646b Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/042-space shuttle.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/043-space shuttle.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/043-space shuttle.png new file mode 100644 index 000000000..136dc8031 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/043-space shuttle.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/044-rocket.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/044-rocket.png new file mode 100644 index 000000000..16d60e221 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/044-rocket.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/045-astronaut.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/045-astronaut.png new file mode 100644 index 000000000..fdb107548 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/045-astronaut.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/046-rocket.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/046-rocket.png new file mode 100644 index 000000000..e2808eb39 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/046-rocket.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/047-computer.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/047-computer.png new file mode 100644 index 000000000..cc3bbf904 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/047-computer.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/048-satellite.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/048-satellite.png new file mode 100644 index 000000000..0548cb820 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/048-satellite.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/049-astronaut.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/049-astronaut.png new file mode 100644 index 000000000..99654c52e Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/049-astronaut.png differ diff --git a/src/backend/base/langflow/initial_setup/profile_pictures/Space/050-space robot.png b/src/backend/base/langflow/initial_setup/profile_pictures/Space/050-space robot.png new file mode 100644 index 000000000..52c23b249 Binary files /dev/null and b/src/backend/base/langflow/initial_setup/profile_pictures/Space/050-space robot.png differ diff --git a/src/backend/base/langflow/initial_setup/setup.py b/src/backend/base/langflow/initial_setup/setup.py index 83408d8b9..e57c554ae 100644 --- a/src/backend/base/langflow/initial_setup/setup.py +++ b/src/backend/base/langflow/initial_setup/setup.py @@ -1,5 +1,6 @@ import logging import os +import shutil from collections import defaultdict from copy import deepcopy from datetime import datetime, timezone @@ -20,7 +21,7 @@ from langflow.services.database.models.user.crud import get_user_by_username from langflow.services.deps import get_settings_service, session_scope from langflow.services.database.models.folder.utils import create_default_folder_if_it_doesnt_exist -from langflow.services.deps import get_variable_service +from langflow.services.deps import get_variable_service, get_storage_service STARTER_FOLDER_NAME = "Starter Projects" @@ -103,6 +104,26 @@ def load_starter_projects() -> list[tuple[Path, dict]]: logger.info(f"Loaded starter project {file}") return starter_projects +def copy_profile_pictures(): + config_dir = get_storage_service().settings_service.settings.config_dir + origin = Path(__file__).parent / "profile_pictures" + target = Path(config_dir) / "profile_pictures" + import pdb; pdb.set_trace + + if not os.path.exists(origin): + raise ValueError(f"The source folder '{origin}' does not exist.") + + if not os.path.exists(target): + os.makedirs(target) + + try: + shutil.copytree(origin, target, dirs_exist_ok=True) + logger.debug(f"Folder copied from '{origin}' to '{target}'") + + except Exception as e: + logger.error(f"Error copying the folder: {e}") + + def get_project_data(project): project_name = project.get("name") @@ -286,6 +307,7 @@ def create_or_update_starter_projects(): new_folder = create_starter_folder(session) starter_projects = load_starter_projects() delete_start_projects(session, new_folder.id) + copy_profile_pictures() for project_path, project in starter_projects: ( project_name, diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting (Hello, world!).json b/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting (Hello, world!).json index e14ae756d..52bc386c8 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting (Hello, world!).json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting (Hello, world!).json @@ -45,9 +45,7 @@ "name": "template", "display_name": "Template", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -86,22 +84,14 @@ "is_input": null, "is_output": null, "is_composition": null, - "base_classes": [ - "object", - "str", - "Text" - ], + "base_classes": ["object", "str", "Text"], "name": "", "display_name": "Prompt", "documentation": "", "custom_fields": { - "template": [ - "user_input" - ] + "template": ["user_input"] }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "full_path": null, "field_formatters": {}, "frozen": false, @@ -150,10 +140,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text", - "Record" - ] + "input_types": ["Text", "Record"] }, "code": { "type": "code", @@ -236,9 +223,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_base": { "type": "str", @@ -257,9 +242,7 @@ "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_key": { "type": "str", @@ -278,9 +261,7 @@ "info": "The OpenAI API Key to use for the OpenAI model.", "load_from_db": true, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "OPENAI_API_KEY" }, "stream": { @@ -319,9 +300,7 @@ "info": "System message to pass to the model.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "temperature": { "type": "float", @@ -352,11 +331,7 @@ }, "description": "Generates text using OpenAI LLMs.", "icon": "OpenAI", - "base_classes": [ - "object", - "Text", - "str" - ], + "base_classes": ["object", "Text", "str"], "display_name": "OpenAI", "documentation": "", "custom_fields": { @@ -370,9 +345,7 @@ "stream": null, "system_message": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [ @@ -443,9 +416,7 @@ "name": "input_value", "display_name": "Message", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -469,9 +440,7 @@ "info": "In case of Message being a Record, this template will be used to convert it to text.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "return_record": { "type": "bool", @@ -503,10 +472,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "name": "sender", "display_name": "Sender Type", "advanced": true, @@ -514,9 +480,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "sender_name": { "type": "str", @@ -536,9 +500,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "session_id": { "type": "str", @@ -557,20 +519,13 @@ "info": "If provided, the message will be stored in the memory.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Display a chat message in the Playground.", "icon": "ChatOutput", - "base_classes": [ - "Record", - "Text", - "str", - "object" - ], + "base_classes": ["Record", "Text", "str", "object"], "display_name": "Chat Output", "documentation": "", "custom_fields": { @@ -581,10 +536,7 @@ "return_record": null, "record_template": null }, - "output_types": [ - "Text", - "Record" - ], + "output_types": ["Text", "Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -680,10 +632,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "name": "sender", "display_name": "Sender Type", "advanced": true, @@ -691,9 +640,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "sender_name": { "type": "str", @@ -713,9 +660,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "session_id": { "type": "str", @@ -734,20 +679,13 @@ "info": "If provided, the message will be stored in the memory.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Get chat inputs from the Playground.", "icon": "ChatInput", - "base_classes": [ - "object", - "Record", - "str", - "Text" - ], + "base_classes": ["object", "Record", "str", "Text"], "display_name": "Chat Input", "documentation": "", "custom_fields": { @@ -757,10 +695,7 @@ "session_id": null, "return_record": null }, - "output_types": [ - "Text", - "Record" - ], + "output_types": ["Text", "Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -788,17 +723,11 @@ "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-njtka", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "Text", - "str" - ], + "baseClasses": ["object", "Text", "str"], "dataType": "OpenAIModel", "id": "OpenAIModel-k39HS" } @@ -818,17 +747,11 @@ "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-k39HS", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "Prompt", "id": "Prompt-uxBqP" } @@ -848,21 +771,11 @@ "targetHandle": { "fieldName": "user_input", "id": "Prompt-uxBqP", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "Record", - "str", - "Text" - ], + "baseClasses": ["object", "Record", "str", "Text"], "dataType": "ChatInput", "id": "ChatInput-P3fgL" } @@ -884,4 +797,4 @@ "name": "Basic Prompting (Hello, World)", "last_tested_version": "1.0.0a4", "is_component": false -} \ No newline at end of file +} diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Blog Writter.json b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Blog Writter.json index 3cecca755..ede2f4692 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Blog Writter.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Blog Writter.json @@ -45,9 +45,7 @@ "name": "template", "display_name": "Template", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -138,24 +136,14 @@ "is_input": null, "is_output": null, "is_composition": null, - "base_classes": [ - "object", - "Text", - "str" - ], + "base_classes": ["object", "Text", "str"], "name": "", "display_name": "Prompt", "documentation": "", "custom_fields": { - "template": [ - "reference_1", - "reference_2", - "instructions" - ] + "template": ["reference_1", "reference_2", "instructions"] }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "full_path": null, "field_formatters": {}, "frozen": false, @@ -222,9 +210,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": [ "https://www.promptingguide.ai/techniques/prompt_chaining" ] @@ -233,17 +219,13 @@ }, "description": "Fetch content from one or more URLs.", "icon": "layout-template", - "base_classes": [ - "Record" - ], + "base_classes": ["Record"], "display_name": "URL", "documentation": "", "custom_fields": { "urls": null }, - "output_types": [ - "Record" - ], + "output_types": ["Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -302,9 +284,7 @@ "name": "input_value", "display_name": "Message", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -328,9 +308,7 @@ "info": "In case of Message being a Record, this template will be used to convert it to text.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "return_record": { "type": "bool", @@ -362,10 +340,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "name": "sender", "display_name": "Sender Type", "advanced": true, @@ -373,9 +348,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "sender_name": { "type": "str", @@ -395,9 +368,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "session_id": { "type": "str", @@ -416,20 +387,13 @@ "info": "If provided, the message will be stored in the memory.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Display a chat message in the Playground.", "icon": "ChatOutput", - "base_classes": [ - "Text", - "Record", - "object", - "str" - ], + "base_classes": ["Text", "Record", "object", "str"], "display_name": "Chat Output", "documentation": "", "custom_fields": { @@ -440,10 +404,7 @@ "return_record": null, "record_template": null }, - "output_types": [ - "Text", - "Record" - ], + "output_types": ["Text", "Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -483,10 +444,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text", - "Record" - ] + "input_types": ["Text", "Record"] }, "code": { "type": "code", @@ -569,9 +527,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_base": { "type": "str", @@ -590,9 +546,7 @@ "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_key": { "type": "str", @@ -611,9 +565,7 @@ "info": "The OpenAI API Key to use for the OpenAI model.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "OPENAI_API_KEY" }, "stream": { @@ -652,9 +604,7 @@ "info": "System message to pass to the model.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "temperature": { "type": "float", @@ -685,11 +635,7 @@ }, "description": "Generates text using OpenAI LLMs.", "icon": "OpenAI", - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "display_name": "OpenAI", "documentation": "", "custom_fields": { @@ -703,9 +649,7 @@ "stream": null, "system_message": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [ @@ -778,28 +722,20 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ], - "value": [ - "https://www.promptingguide.ai/introduction/basics" - ] + "input_types": ["Text"], + "value": ["https://www.promptingguide.ai/introduction/basics"] }, "_type": "CustomComponent" }, "description": "Fetch content from one or more URLs.", "icon": "layout-template", - "base_classes": [ - "Record" - ], + "base_classes": ["Record"], "display_name": "URL", "documentation": "", "custom_fields": { "urls": null }, - "output_types": [ - "Record" - ], + "output_types": ["Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -859,10 +795,7 @@ "name": "input_value", "display_name": "Value", "advanced": false, - "input_types": [ - "Record", - "Text" - ], + "input_types": ["Record", "Text"], "dynamic": false, "info": "Text or Record to be passed as input.", "load_from_db": false, @@ -886,28 +819,20 @@ "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Get text inputs from the Playground.", "icon": "type", - "base_classes": [ - "object", - "Text", - "str" - ], + "base_classes": ["object", "Text", "str"], "display_name": "Instructions", "documentation": "", "custom_fields": { "input_value": null, "record_template": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -936,18 +861,11 @@ "targetHandle": { "fieldName": "reference_2", "id": "Prompt-Rse03", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "Record" - ], + "baseClasses": ["Record"], "dataType": "URL", "id": "URL-HYPkR" } @@ -967,17 +885,11 @@ "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-JPlxl", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "OpenAIModel", "id": "OpenAIModel-gi29P" } @@ -997,18 +909,11 @@ "targetHandle": { "fieldName": "reference_1", "id": "Prompt-Rse03", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "Record" - ], + "baseClasses": ["Record"], "dataType": "URL", "id": "URL-2cX90" } @@ -1028,20 +933,11 @@ "targetHandle": { "fieldName": "instructions", "id": "Prompt-Rse03", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "Text", - "str" - ], + "baseClasses": ["object", "Text", "str"], "dataType": "TextInput", "id": "TextInput-og8Or" } @@ -1061,17 +957,11 @@ "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-gi29P", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "Text", - "str" - ], + "baseClasses": ["object", "Text", "str"], "dataType": "Prompt", "id": "Prompt-Rse03" } @@ -1094,4 +984,4 @@ "name": "Blog Writer", "last_tested_version": "1.0.0a0", "is_component": false -} \ No newline at end of file +} diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Document QA.json b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Document QA.json index 8c93967a9..c2e2c1d70 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Document QA.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Document QA.json @@ -45,9 +45,7 @@ "name": "template", "display_name": "Template", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -112,23 +110,14 @@ "is_input": null, "is_output": null, "is_composition": null, - "base_classes": [ - "object", - "str", - "Text" - ], + "base_classes": ["object", "str", "Text"], "name": "", "display_name": "Prompt", "documentation": "", "custom_fields": { - "template": [ - "Document", - "Question" - ] + "template": ["Document", "Question"] }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "full_path": null, "field_formatters": {}, "frozen": false, @@ -231,18 +220,14 @@ "_type": "CustomComponent" }, "description": "A generic file loader.", - "base_classes": [ - "Record" - ], + "base_classes": ["Record"], "display_name": "Files", "documentation": "", "custom_fields": { "path": null, "silent_errors": null }, - "output_types": [ - "Record" - ], + "output_types": ["Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -338,10 +323,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "name": "sender", "display_name": "Sender Type", "advanced": true, @@ -349,9 +331,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "sender_name": { "type": "str", @@ -371,9 +351,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "session_id": { "type": "str", @@ -392,20 +370,13 @@ "info": "If provided, the message will be stored in the memory.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Get chat inputs from the Playground.", "icon": "ChatInput", - "base_classes": [ - "str", - "Record", - "Text", - "object" - ], + "base_classes": ["str", "Record", "Text", "object"], "display_name": "Chat Input", "documentation": "", "custom_fields": { @@ -415,10 +386,7 @@ "session_id": null, "return_record": null }, - "output_types": [ - "Text", - "Record" - ], + "output_types": ["Text", "Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -477,9 +445,7 @@ "name": "input_value", "display_name": "Message", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -515,10 +481,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "name": "sender", "display_name": "Sender Type", "advanced": true, @@ -526,9 +489,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "sender_name": { "type": "str", @@ -548,9 +509,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "session_id": { "type": "str", @@ -569,20 +528,13 @@ "info": "If provided, the message will be stored in the memory.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Display a chat message in the Playground.", "icon": "ChatOutput", - "base_classes": [ - "str", - "Record", - "Text", - "object" - ], + "base_classes": ["str", "Record", "Text", "object"], "display_name": "Chat Output", "documentation": "", "custom_fields": { @@ -592,10 +544,7 @@ "session_id": null, "return_record": null }, - "output_types": [ - "Text", - "Record" - ], + "output_types": ["Text", "Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -640,10 +589,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text", - "Record" - ] + "input_types": ["Text", "Record"] }, "code": { "type": "code", @@ -726,9 +672,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_base": { "type": "str", @@ -747,9 +691,7 @@ "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_key": { "type": "str", @@ -768,9 +710,7 @@ "info": "The OpenAI API Key to use for the OpenAI model.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "OPENAI_API_KEY" }, "stream": { @@ -809,9 +749,7 @@ "info": "System message to pass to the model.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "temperature": { "type": "float", @@ -842,11 +780,7 @@ }, "description": "Generates text using OpenAI LLMs.", "icon": "OpenAI", - "base_classes": [ - "object", - "str", - "Text" - ], + "base_classes": ["object", "str", "Text"], "display_name": "OpenAI", "documentation": "", "custom_fields": { @@ -860,9 +794,7 @@ "stream": null, "system_message": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [ @@ -900,21 +832,11 @@ "targetHandle": { "fieldName": "Question", "id": "Prompt-tHwPf", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "str", - "Record", - "Text", - "object" - ], + "baseClasses": ["str", "Record", "Text", "object"], "dataType": "ChatInput", "id": "ChatInput-MsSJ9" } @@ -934,18 +856,11 @@ "targetHandle": { "fieldName": "Document", "id": "Prompt-tHwPf", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "Record" - ], + "baseClasses": ["Record"], "dataType": "File", "id": "File-6TEsD" } @@ -965,17 +880,11 @@ "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-Bt067", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "Prompt", "id": "Prompt-tHwPf" } @@ -995,17 +904,11 @@ "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-F5Awj", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "OpenAIModel", "id": "OpenAIModel-Bt067" } @@ -1027,4 +930,4 @@ "name": "Document QA", "last_tested_version": "1.0.0a0", "is_component": false -} \ No newline at end of file +} diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Memory Conversation.json b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Memory Conversation.json index 18c81d063..5d9004316 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Memory Conversation.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Memory Conversation.json @@ -83,10 +83,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "name": "sender", "display_name": "Sender Type", "advanced": true, @@ -94,9 +91,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "sender_name": { "type": "str", @@ -116,9 +111,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "session_id": { "type": "str", @@ -137,21 +130,14 @@ "info": "If provided, the message will be stored in the memory.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "MySessionID" }, "_type": "CustomComponent" }, "description": "Get chat inputs from the Playground.", "icon": "ChatInput", - "base_classes": [ - "Text", - "object", - "Record", - "str" - ], + "base_classes": ["Text", "object", "Record", "str"], "display_name": "Chat Input", "documentation": "", "custom_fields": { @@ -161,10 +147,7 @@ "session_id": null, "return_record": null }, - "output_types": [ - "Text", - "Record" - ], + "output_types": ["Text", "Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -223,9 +206,7 @@ "name": "input_value", "display_name": "Message", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -261,10 +242,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "name": "sender", "display_name": "Sender Type", "advanced": true, @@ -272,9 +250,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "sender_name": { "type": "str", @@ -294,9 +270,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "session_id": { "type": "str", @@ -315,21 +289,14 @@ "info": "If provided, the message will be stored in the memory.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "MySessionID" }, "_type": "CustomComponent" }, "description": "Display a chat message in the Playground.", "icon": "ChatOutput", - "base_classes": [ - "Text", - "object", - "Record", - "str" - ], + "base_classes": ["Text", "object", "Record", "str"], "display_name": "Chat Output", "documentation": "", "custom_fields": { @@ -339,10 +306,7 @@ "session_id": null, "return_record": null }, - "output_types": [ - "Text", - "Record" - ], + "output_types": ["Text", "Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -418,10 +382,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Ascending", - "Descending" - ], + "options": ["Ascending", "Descending"], "name": "order", "display_name": "Order", "advanced": true, @@ -429,9 +390,7 @@ "info": "Order of the messages.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "record_template": { "type": "str", @@ -451,9 +410,7 @@ "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "sender": { "type": "str", @@ -466,11 +423,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Machine", - "User", - "Machine and User" - ], + "options": ["Machine", "User", "Machine and User"], "name": "sender", "display_name": "Sender Type", "advanced": false, @@ -478,9 +431,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "sender_name": { "type": "str", @@ -499,9 +450,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "session_id": { "type": "str", @@ -516,9 +465,7 @@ "name": "session_id", "display_name": "Session ID", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "Session ID of the chat history.", "load_from_db": false, @@ -529,11 +476,7 @@ }, "description": "Retrieves stored chat messages given a specific Session ID.", "icon": "history", - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "display_name": "Chat Memory", "documentation": "", "custom_fields": { @@ -544,9 +487,7 @@ "order": null, "record_template": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -608,9 +549,7 @@ "name": "template", "display_name": "Template", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -675,23 +614,14 @@ "is_input": null, "is_output": null, "is_composition": null, - "base_classes": [ - "Text", - "str", - "object" - ], + "base_classes": ["Text", "str", "object"], "name": "", "display_name": "Prompt", "documentation": "", "custom_fields": { - "template": [ - "context", - "user_message" - ] + "template": ["context", "user_message"] }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "full_path": null, "field_formatters": {}, "frozen": false, @@ -740,10 +670,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text", - "Record" - ] + "input_types": ["Text", "Record"] }, "code": { "type": "code", @@ -826,9 +753,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_base": { "type": "str", @@ -847,9 +772,7 @@ "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_key": { "type": "str", @@ -868,9 +791,7 @@ "info": "The OpenAI API Key to use for the OpenAI model.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "OPENAI_API_KEY" }, "stream": { @@ -909,9 +830,7 @@ "info": "System message to pass to the model.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "temperature": { "type": "float", @@ -942,11 +861,7 @@ }, "description": "Generates text using OpenAI LLMs.", "icon": "OpenAI", - "base_classes": [ - "str", - "object", - "Text" - ], + "base_classes": ["str", "object", "Text"], "display_name": "OpenAI", "documentation": "", "custom_fields": { @@ -960,9 +875,7 @@ "stream": null, "system_message": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [ @@ -1014,10 +927,7 @@ "name": "input_value", "display_name": "Value", "advanced": false, - "input_types": [ - "Record", - "Text" - ], + "input_types": ["Record", "Text"], "dynamic": false, "info": "Text or Record to be passed as output.", "load_from_db": false, @@ -1059,28 +969,20 @@ "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Display a text output in the Playground.", "icon": "type", - "base_classes": [ - "str", - "object", - "Text" - ], + "base_classes": ["str", "object", "Text"], "display_name": "Inspect Memory", "documentation": "", "custom_fields": { "input_value": null, "record_template": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -1109,19 +1011,10 @@ "fieldName": "context", "type": "str", "id": "Prompt-ODkUx", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ] + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"] }, "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "MemoryComponent", "id": "MemoryComponent-cdA1J" } @@ -1143,20 +1036,10 @@ "fieldName": "user_message", "type": "str", "id": "Prompt-ODkUx", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ] + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"] }, "sourceHandle": { - "baseClasses": [ - "Text", - "object", - "Record", - "str" - ], + "baseClasses": ["Text", "object", "Record", "str"], "dataType": "ChatInput", "id": "ChatInput-t7F8v" } @@ -1177,17 +1060,11 @@ "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-9RykF", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "Text", - "str", - "object" - ], + "baseClasses": ["Text", "str", "object"], "dataType": "Prompt", "id": "Prompt-ODkUx" } @@ -1207,17 +1084,11 @@ "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-P1jEe", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "str", - "object", - "Text" - ], + "baseClasses": ["str", "object", "Text"], "dataType": "OpenAIModel", "id": "OpenAIModel-9RykF" } @@ -1237,18 +1108,11 @@ "targetHandle": { "fieldName": "input_value", "id": "TextOutput-vrs6T", - "inputTypes": [ - "Record", - "Text" - ], + "inputTypes": ["Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "MemoryComponent", "id": "MemoryComponent-cdA1J" } @@ -1270,4 +1134,4 @@ "name": "Memory Chatbot", "last_tested_version": "1.0.0a0", "is_component": false -} \ No newline at end of file +} diff --git a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Prompt Chaining.json b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Prompt Chaining.json index e7d78268c..62bcf2c70 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/Langflow Prompt Chaining.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/Langflow Prompt Chaining.json @@ -45,9 +45,7 @@ "name": "template", "display_name": "Template", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -86,22 +84,14 @@ "is_input": null, "is_output": null, "is_composition": null, - "base_classes": [ - "object", - "str", - "Text" - ], + "base_classes": ["object", "str", "Text"], "name": "", "display_name": "Prompt", "documentation": "", "custom_fields": { - "template": [ - "document" - ] + "template": ["document"] }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "full_path": null, "field_formatters": {}, "frozen": false, @@ -165,9 +155,7 @@ "name": "template", "display_name": "Template", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -206,22 +194,14 @@ "is_input": null, "is_output": null, "is_composition": null, - "base_classes": [ - "object", - "str", - "Text" - ], + "base_classes": ["object", "str", "Text"], "name": "", "display_name": "Prompt", "documentation": "", "custom_fields": { - "template": [ - "summary" - ] + "template": ["summary"] }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "full_path": null, "field_formatters": {}, "frozen": false, @@ -280,9 +260,7 @@ "name": "input_value", "display_name": "Message", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -306,9 +284,7 @@ "info": "In case of Message being a Record, this template will be used to convert it to text.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "return_record": { "type": "bool", @@ -340,10 +316,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "name": "sender", "display_name": "Sender Type", "advanced": true, @@ -351,9 +324,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "sender_name": { "type": "str", @@ -373,9 +344,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "session_id": { "type": "str", @@ -394,20 +363,13 @@ "info": "If provided, the message will be stored in the memory.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Display a chat message in the Playground.", "icon": "ChatOutput", - "base_classes": [ - "object", - "Record", - "Text", - "str" - ], + "base_classes": ["object", "Record", "Text", "str"], "display_name": "Chat Output", "documentation": "", "custom_fields": { @@ -418,10 +380,7 @@ "return_record": null, "record_template": null }, - "output_types": [ - "Text", - "Record" - ], + "output_types": ["Text", "Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -476,9 +435,7 @@ "name": "input_value", "display_name": "Message", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -502,9 +459,7 @@ "info": "In case of Message being a Record, this template will be used to convert it to text.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "return_record": { "type": "bool", @@ -536,10 +491,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "name": "sender", "display_name": "Sender Type", "advanced": true, @@ -547,9 +499,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "sender_name": { "type": "str", @@ -569,9 +519,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "session_id": { "type": "str", @@ -590,20 +538,13 @@ "info": "If provided, the message will be stored in the memory.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Display a chat message in the Playground.", "icon": "ChatOutput", - "base_classes": [ - "object", - "Record", - "Text", - "str" - ], + "base_classes": ["object", "Record", "Text", "str"], "display_name": "Chat Output", "documentation": "", "custom_fields": { @@ -614,10 +555,7 @@ "return_record": null, "record_template": null }, - "output_types": [ - "Text", - "Record" - ], + "output_types": ["Text", "Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -672,10 +610,7 @@ "name": "input_value", "display_name": "Value", "advanced": false, - "input_types": [ - "Record", - "Text" - ], + "input_types": ["Record", "Text"], "dynamic": false, "info": "Text or Record to be passed as input.", "load_from_db": false, @@ -699,28 +634,20 @@ "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Get text inputs from the Playground.", "icon": "type", - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "display_name": "Text Input", "documentation": "", "custom_fields": { "input_value": null, "record_template": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -762,10 +689,7 @@ "name": "input_value", "display_name": "Value", "advanced": false, - "input_types": [ - "Record", - "Text" - ], + "input_types": ["Record", "Text"], "dynamic": false, "info": "Text or Record to be passed as output.", "load_from_db": false, @@ -807,28 +731,20 @@ "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Display a text output in the Playground.", "icon": "type", - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "display_name": "First Prompt", "documentation": "", "custom_fields": { "input_value": null, "record_template": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -873,10 +789,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text", - "Record" - ] + "input_types": ["Text", "Record"] }, "code": { "type": "code", @@ -959,9 +872,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_base": { "type": "str", @@ -980,9 +891,7 @@ "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_key": { "type": "str", @@ -1001,9 +910,7 @@ "info": "The OpenAI API Key to use for the OpenAI model.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "OPENAI_API_KEY" }, "stream": { @@ -1042,9 +949,7 @@ "info": "System message to pass to the model.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "temperature": { "type": "float", @@ -1075,11 +980,7 @@ }, "description": "Generates text using OpenAI LLMs.", "icon": "OpenAI", - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "display_name": "OpenAI", "documentation": "", "custom_fields": { @@ -1093,9 +994,7 @@ "stream": null, "system_message": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [ @@ -1147,10 +1046,7 @@ "name": "input_value", "display_name": "Value", "advanced": false, - "input_types": [ - "Record", - "Text" - ], + "input_types": ["Record", "Text"], "dynamic": false, "info": "Text or Record to be passed as output.", "load_from_db": false, @@ -1192,28 +1088,20 @@ "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Display a text output in the Playground.", "icon": "type", - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "display_name": "Second Prompt", "documentation": "", "custom_fields": { "input_value": null, "record_template": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -1258,10 +1146,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text", - "Record" - ] + "input_types": ["Text", "Record"] }, "code": { "type": "code", @@ -1344,9 +1229,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_base": { "type": "str", @@ -1365,9 +1248,7 @@ "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_key": { "type": "str", @@ -1386,9 +1267,7 @@ "info": "The OpenAI API Key to use for the OpenAI model.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "" }, "stream": { @@ -1427,9 +1306,7 @@ "info": "System message to pass to the model.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "temperature": { "type": "float", @@ -1460,11 +1337,7 @@ }, "description": "Generates text using OpenAI LLMs.", "icon": "OpenAI", - "base_classes": [ - "str", - "Text", - "object" - ], + "base_classes": ["str", "Text", "object"], "display_name": "OpenAI", "documentation": "", "custom_fields": { @@ -1478,9 +1351,7 @@ "stream": null, "system_message": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [ @@ -1518,20 +1389,11 @@ "targetHandle": { "fieldName": "document", "id": "Prompt-amqBu", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "TextInput", "id": "TextInput-sptaH" } @@ -1551,18 +1413,11 @@ "targetHandle": { "fieldName": "input_value", "id": "TextOutput-2MS4a", - "inputTypes": [ - "Record", - "Text" - ], + "inputTypes": ["Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "Prompt", "id": "Prompt-amqBu" } @@ -1582,17 +1437,11 @@ "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-uYXZJ", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "Prompt", "id": "Prompt-amqBu" } @@ -1612,20 +1461,11 @@ "targetHandle": { "fieldName": "summary", "id": "Prompt-gTNiz", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "OpenAIModel", "id": "OpenAIModel-uYXZJ" } @@ -1645,17 +1485,11 @@ "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-EJkG3", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "OpenAIModel", "id": "OpenAIModel-uYXZJ" } @@ -1675,18 +1509,11 @@ "targetHandle": { "fieldName": "input_value", "id": "TextOutput-MUDOR", - "inputTypes": [ - "Record", - "Text" - ], + "inputTypes": ["Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "Prompt", "id": "Prompt-gTNiz" } @@ -1706,17 +1533,11 @@ "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-XawYB", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "str", - "Text" - ], + "baseClasses": ["object", "str", "Text"], "dataType": "Prompt", "id": "Prompt-gTNiz" } @@ -1736,17 +1557,11 @@ "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-DNmvg", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "str", - "Text", - "object" - ], + "baseClasses": ["str", "Text", "object"], "dataType": "OpenAIModel", "id": "OpenAIModel-XawYB" } @@ -1768,4 +1583,4 @@ "name": "Prompt Chaining", "last_tested_version": "1.0.0a0", "is_component": false -} \ No newline at end of file +} diff --git a/src/backend/base/langflow/initial_setup/starter_projects/VectorStore-RAG-Flows.json b/src/backend/base/langflow/initial_setup/starter_projects/VectorStore-RAG-Flows.json index 8038ae841..ed9188788 100644 --- a/src/backend/base/langflow/initial_setup/starter_projects/VectorStore-RAG-Flows.json +++ b/src/backend/base/langflow/initial_setup/starter_projects/VectorStore-RAG-Flows.json @@ -81,10 +81,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "name": "sender", "display_name": "Sender Type", "advanced": true, @@ -92,9 +89,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "sender_name": { "type": "str", @@ -114,9 +109,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "session_id": { "type": "str", @@ -135,20 +128,13 @@ "info": "If provided, the message will be stored in the memory.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Get chat inputs from the Playground.", "icon": "ChatInput", - "base_classes": [ - "Text", - "str", - "object", - "Record" - ], + "base_classes": ["Text", "str", "object", "Record"], "display_name": "Chat Input", "documentation": "", "custom_fields": { @@ -158,10 +144,7 @@ "session_id": null, "return_record": null }, - "output_types": [ - "Text", - "Record" - ], + "output_types": ["Text", "Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -198,10 +181,7 @@ "name": "input_value", "display_name": "Value", "advanced": false, - "input_types": [ - "Record", - "Text" - ], + "input_types": ["Record", "Text"], "dynamic": false, "info": "Text or Record to be passed as output.", "load_from_db": false, @@ -243,28 +223,20 @@ "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Display a text output in the Playground.", "icon": "type", - "base_classes": [ - "object", - "Text", - "str" - ], + "base_classes": ["object", "Text", "str"], "display_name": "Extracted Chunks", "documentation": "", "custom_fields": { "input_value": null, "record_template": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -310,9 +282,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "chunk_size": { "type": "int", @@ -424,9 +394,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "disallowed_special": { "type": "str", @@ -435,9 +403,7 @@ "list": false, "show": true, "multiline": false, - "value": [ - "all" - ], + "value": ["all"], "fileTypes": [], "file_path": "", "password": false, @@ -448,9 +414,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "embedding_ctx_length": { "type": "int", @@ -513,9 +477,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "model_kwargs": { "type": "NestedDict", @@ -553,9 +515,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_key": { "type": "str", @@ -574,9 +534,7 @@ "info": "", "load_from_db": true, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "OPENAI_API_KEY" }, "openai_api_type": { @@ -596,9 +554,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_version": { "type": "str", @@ -617,9 +573,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_organization": { "type": "str", @@ -638,9 +592,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_proxy": { "type": "str", @@ -659,9 +611,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "request_timeout": { "type": "float", @@ -761,16 +711,12 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Generate embeddings using OpenAI models.", - "base_classes": [ - "Embeddings" - ], + "base_classes": ["Embeddings"], "display_name": "OpenAI Embeddings", "documentation": "", "custom_fields": { @@ -797,9 +743,7 @@ "tiktoken_enable": null, "tiktoken_model_name": null }, - "output_types": [ - "Embeddings" - ], + "output_types": ["Embeddings"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -840,10 +784,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text", - "Record" - ] + "input_types": ["Text", "Record"] }, "code": { "type": "code", @@ -926,9 +867,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_base": { "type": "str", @@ -947,9 +886,7 @@ "info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_key": { "type": "str", @@ -968,9 +905,7 @@ "info": "The OpenAI API Key to use for the OpenAI model.", "load_from_db": true, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "OPENAI_API_KEY" }, "stream": { @@ -1009,9 +944,7 @@ "info": "System message to pass to the model.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "temperature": { "type": "float", @@ -1042,11 +975,7 @@ }, "description": "Generates text using OpenAI LLMs.", "icon": "OpenAI", - "base_classes": [ - "object", - "Text", - "str" - ], + "base_classes": ["object", "Text", "str"], "display_name": "OpenAI", "documentation": "", "custom_fields": { @@ -1060,9 +989,7 @@ "stream": null, "system_message": null }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "field_formatters": {}, "frozen": false, "field_order": [ @@ -1132,9 +1059,7 @@ "name": "template", "display_name": "Template", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -1199,23 +1124,14 @@ "is_input": null, "is_output": null, "is_composition": null, - "base_classes": [ - "object", - "Text", - "str" - ], + "base_classes": ["object", "Text", "str"], "name": "", "display_name": "Prompt", "documentation": "", "custom_fields": { - "template": [ - "context", - "question" - ] + "template": ["context", "question"] }, - "output_types": [ - "Text" - ], + "output_types": ["Text"], "full_path": null, "field_formatters": {}, "frozen": false, @@ -1278,9 +1194,7 @@ "name": "input_value", "display_name": "Message", "advanced": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "dynamic": false, "info": "", "load_from_db": false, @@ -1304,9 +1218,7 @@ "info": "In case of Message being a Record, this template will be used to convert it to text.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "return_record": { "type": "bool", @@ -1338,10 +1250,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Machine", - "User" - ], + "options": ["Machine", "User"], "name": "sender", "display_name": "Sender Type", "advanced": true, @@ -1349,9 +1258,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "sender_name": { "type": "str", @@ -1371,9 +1278,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "session_id": { "type": "str", @@ -1392,20 +1297,13 @@ "info": "If provided, the message will be stored in the memory.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Display a chat message in the Playground.", "icon": "ChatOutput", - "base_classes": [ - "object", - "Text", - "Record", - "str" - ], + "base_classes": ["object", "Text", "Record", "str"], "display_name": "Chat Output", "documentation": "", "custom_fields": { @@ -1416,10 +1314,7 @@ "return_record": null, "record_template": null }, - "output_types": [ - "Text", - "Record" - ], + "output_types": ["Text", "Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -1526,18 +1421,14 @@ }, "description": "A generic file loader.", "icon": "file-text", - "base_classes": [ - "Record" - ], + "base_classes": ["Record"], "display_name": "File", "documentation": "", "custom_fields": { "path": null, "silent_errors": null }, - "output_types": [ - "Record" - ], + "output_types": ["Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -1578,10 +1469,7 @@ "name": "inputs", "display_name": "Input", "advanced": false, - "input_types": [ - "Document", - "Record" - ], + "input_types": ["Document", "Record"], "dynamic": false, "info": "The texts to split.", "load_from_db": false, @@ -1660,19 +1548,13 @@ "info": "The characters to split on.\nIf left empty defaults to [\"\\n\\n\", \"\\n\", \" \", \"\"].", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ], - "value": [ - "" - ] + "input_types": ["Text"], + "value": [""] }, "_type": "CustomComponent" }, "description": "Split text into chunks of a specified length.", - "base_classes": [ - "Record" - ], + "base_classes": ["Record"], "display_name": "Recursive Character Text Splitter", "documentation": "https://docs.langflow.org/components/text-splitters#recursivecharactertextsplitter", "custom_fields": { @@ -1681,9 +1563,7 @@ "chunk_size": null, "chunk_overlap": null }, - "output_types": [ - "Record" - ], + "output_types": ["Record"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -1746,9 +1626,7 @@ "info": "Input value to search", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "api_endpoint": { "type": "str", @@ -1767,9 +1645,7 @@ "info": "API endpoint URL for the Astra DB service.", "load_from_db": true, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "ASTRA_DB_API_ENDPOINT" }, "batch_size": { @@ -1897,9 +1773,7 @@ "info": "The name of the collection within Astra DB where the vectors will be stored.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "langflow" }, "metadata_indexing_exclude": { @@ -1919,9 +1793,7 @@ "info": "Optional list of metadata fields to exclude from the indexing.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "metadata_indexing_include": { "type": "str", @@ -1940,9 +1812,7 @@ "info": "Optional list of metadata fields to include in the indexing.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "metric": { "type": "str", @@ -1961,9 +1831,7 @@ "info": "Optional distance metric for vector comparisons in the vector store.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "namespace": { "type": "str", @@ -1982,9 +1850,7 @@ "info": "Optional namespace within Astra DB to use for the collection.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "number_of_results": { "type": "int", @@ -2035,10 +1901,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Similarity", - "MMR" - ], + "options": ["Similarity", "MMR"], "name": "search_type", "display_name": "Search Type", "advanced": false, @@ -2046,9 +1909,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "setup_mode": { "type": "str", @@ -2061,11 +1922,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Sync", - "Async", - "Off" - ], + "options": ["Sync", "Async", "Off"], "name": "setup_mode", "display_name": "Setup Mode", "advanced": true, @@ -2073,9 +1930,7 @@ "info": "Configuration mode for setting up the vector store, with options like “Sync”, “Async”, or “Off”.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "token": { "type": "str", @@ -2094,18 +1949,14 @@ "info": "Authentication token for accessing Astra DB.", "load_from_db": true, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "ASTRA_DB_APPLICATION_TOKEN" }, "_type": "CustomComponent" }, "description": "Searches an existing Astra DB Vector Store.", "icon": "AstraDB", - "base_classes": [ - "Record" - ], + "base_classes": ["Record"], "display_name": "Astra DB Search", "documentation": "", "custom_fields": { @@ -2128,9 +1979,7 @@ "metadata_indexing_exclude": null, "collection_indexing_policy": null }, - "output_types": [ - "Record" - ], + "output_types": ["Record"], "field_formatters": {}, "frozen": false, "field_order": [ @@ -2217,9 +2066,7 @@ "info": "API endpoint URL for the Astra DB service.", "load_from_db": true, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "ASTRA_DB_API_ENDPOINT" }, "batch_size": { @@ -2347,9 +2194,7 @@ "info": "The name of the collection within Astra DB where the vectors will be stored.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "langflow" }, "metadata_indexing_exclude": { @@ -2369,9 +2214,7 @@ "info": "Optional list of metadata fields to exclude from the indexing.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "metadata_indexing_include": { "type": "str", @@ -2390,9 +2233,7 @@ "info": "Optional list of metadata fields to include in the indexing.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "metric": { "type": "str", @@ -2411,9 +2252,7 @@ "info": "Optional distance metric for vector comparisons in the vector store.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "namespace": { "type": "str", @@ -2432,9 +2271,7 @@ "info": "Optional namespace within Astra DB to use for the collection.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "pre_delete_collection": { "type": "bool", @@ -2466,11 +2303,7 @@ "fileTypes": [], "file_path": "", "password": false, - "options": [ - "Sync", - "Async", - "Off" - ], + "options": ["Sync", "Async", "Off"], "name": "setup_mode", "display_name": "Setup Mode", "advanced": true, @@ -2478,9 +2311,7 @@ "info": "Configuration mode for setting up the vector store, with options like “Sync”, “Async”, or “Off”.", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "token": { "type": "str", @@ -2499,18 +2330,14 @@ "info": "Authentication token for accessing Astra DB.", "load_from_db": true, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "ASTRA_DB_APPLICATION_TOKEN" }, "_type": "CustomComponent" }, "description": "Builds or loads an Astra DB Vector Store.", "icon": "AstraDB", - "base_classes": [ - "VectorStore" - ], + "base_classes": ["VectorStore"], "display_name": "Astra DB", "documentation": "", "custom_fields": { @@ -2531,9 +2358,7 @@ "metadata_indexing_exclude": null, "collection_indexing_policy": null }, - "output_types": [ - "VectorStore" - ], + "output_types": ["VectorStore"], "field_formatters": {}, "frozen": false, "field_order": [ @@ -2585,9 +2410,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "chunk_size": { "type": "int", @@ -2699,9 +2522,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "disallowed_special": { "type": "str", @@ -2710,9 +2531,7 @@ "list": false, "show": true, "multiline": false, - "value": [ - "all" - ], + "value": ["all"], "fileTypes": [], "file_path": "", "password": false, @@ -2723,9 +2542,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "embedding_ctx_length": { "type": "int", @@ -2788,9 +2605,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "model_kwargs": { "type": "NestedDict", @@ -2828,9 +2643,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_key": { "type": "str", @@ -2849,9 +2662,7 @@ "info": "", "load_from_db": true, "title_case": false, - "input_types": [ - "Text" - ], + "input_types": ["Text"], "value": "OPENAI_API_KEY" }, "openai_api_type": { @@ -2871,9 +2682,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_api_version": { "type": "str", @@ -2892,9 +2701,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_organization": { "type": "str", @@ -2913,9 +2720,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "openai_proxy": { "type": "str", @@ -2934,9 +2739,7 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "request_timeout": { "type": "float", @@ -3036,16 +2839,12 @@ "info": "", "load_from_db": false, "title_case": false, - "input_types": [ - "Text" - ] + "input_types": ["Text"] }, "_type": "CustomComponent" }, "description": "Generate embeddings using OpenAI models.", - "base_classes": [ - "Embeddings" - ], + "base_classes": ["Embeddings"], "display_name": "OpenAI Embeddings", "documentation": "", "custom_fields": { @@ -3072,9 +2871,7 @@ "tiktoken_enable": null, "tiktoken_model_name": null }, - "output_types": [ - "Embeddings" - ], + "output_types": ["Embeddings"], "field_formatters": {}, "frozen": false, "field_order": [], @@ -3103,20 +2900,11 @@ "targetHandle": { "fieldName": "context", "id": "Prompt-xeI6K", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "Text", - "str" - ], + "baseClasses": ["object", "Text", "str"], "dataType": "TextOutput", "id": "TextOutput-BDknO" } @@ -3137,21 +2925,11 @@ "targetHandle": { "fieldName": "question", "id": "Prompt-xeI6K", - "inputTypes": [ - "Document", - "BaseOutputParser", - "Record", - "Text" - ], + "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "Text", - "str", - "object", - "Record" - ], + "baseClasses": ["Text", "str", "object", "Record"], "dataType": "ChatInput", "id": "ChatInput-yxMKE" } @@ -3172,17 +2950,11 @@ "targetHandle": { "fieldName": "input_value", "id": "OpenAIModel-EjXlN", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "Text", - "str" - ], + "baseClasses": ["object", "Text", "str"], "dataType": "Prompt", "id": "Prompt-xeI6K" } @@ -3203,17 +2975,11 @@ "targetHandle": { "fieldName": "input_value", "id": "ChatOutput-Q39I8", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "object", - "Text", - "str" - ], + "baseClasses": ["object", "Text", "str"], "dataType": "OpenAIModel", "id": "OpenAIModel-EjXlN" } @@ -3234,16 +3000,11 @@ "targetHandle": { "fieldName": "inputs", "id": "RecursiveCharacterTextSplitter-tR9QM", - "inputTypes": [ - "Document", - "Record" - ], + "inputTypes": ["Document", "Record"], "type": "Document" }, "sourceHandle": { - "baseClasses": [ - "Record" - ], + "baseClasses": ["Record"], "dataType": "File", "id": "File-t0a6a" } @@ -3267,9 +3028,7 @@ "type": "Embeddings" }, "sourceHandle": { - "baseClasses": [ - "Embeddings" - ], + "baseClasses": ["Embeddings"], "dataType": "OpenAIEmbeddings", "id": "OpenAIEmbeddings-ZlOk1" } @@ -3289,18 +3048,11 @@ "targetHandle": { "fieldName": "input_value", "id": "AstraDBSearch-41nRz", - "inputTypes": [ - "Text" - ], + "inputTypes": ["Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "Text", - "str", - "object", - "Record" - ], + "baseClasses": ["Text", "str", "object", "Record"], "dataType": "ChatInput", "id": "ChatInput-yxMKE" } @@ -3324,9 +3076,7 @@ "type": "Record" }, "sourceHandle": { - "baseClasses": [ - "Record" - ], + "baseClasses": ["Record"], "dataType": "RecursiveCharacterTextSplitter", "id": "RecursiveCharacterTextSplitter-tR9QM" } @@ -3351,9 +3101,7 @@ "type": "Embeddings" }, "sourceHandle": { - "baseClasses": [ - "Embeddings" - ], + "baseClasses": ["Embeddings"], "dataType": "OpenAIEmbeddings", "id": "OpenAIEmbeddings-9TPjc" } @@ -3374,16 +3122,11 @@ "targetHandle": { "fieldName": "input_value", "id": "TextOutput-BDknO", - "inputTypes": [ - "Record", - "Text" - ], + "inputTypes": ["Record", "Text"], "type": "str" }, "sourceHandle": { - "baseClasses": [ - "Record" - ], + "baseClasses": ["Record"], "dataType": "AstraDBSearch", "id": "AstraDBSearch-41nRz" } @@ -3405,4 +3148,4 @@ "name": "Vector Store RAG", "last_tested_version": "1.0.0a0", "is_component": false -} \ No newline at end of file +} diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 4eb8daac6..0fefff800 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -10,6 +10,7 @@ import { RUN_TIMESTAMP_PREFIX, STATUS_BUILD, STATUS_BUILDING, + TOOLTIP_OUTDATED_NODE, } from "../../constants/constants"; import { BuildStatus } from "../../constants/enums"; import { countHandlesFn } from "../helpers/count-handles"; @@ -34,6 +35,8 @@ import useValidationStatusString from "../hooks/use-validation-status-string"; import getFieldTitle from "../utils/get-field-title"; import sortFields from "../utils/sort-fields"; import ParameterComponent from "./components/parameterComponent"; +import { postCustomComponent } from "../../controllers/API"; +import { cloneDeep } from "lodash"; export default function GenericNode({ data, @@ -55,10 +58,10 @@ export default function GenericNode({ const setErrorData = useAlertStore((state) => state.setErrorData); const isDark = useDarkStore((state) => state.dark); const buildStatus = useFlowStore( - (state) => state.flowBuildStatus[data.id]?.status + (state) => state.flowBuildStatus[data.id]?.status, ); const lastRunTime = useFlowStore( - (state) => state.flowBuildStatus[data.id]?.timestamp + (state) => state.flowBuildStatus[data.id]?.timestamp, ); const takeSnapshot = useFlowsManagerStore((state) => state.takeSnapshot); @@ -66,7 +69,7 @@ export default function GenericNode({ const [nodeName, setNodeName] = useState(data.node!.display_name); const [inputDescription, setInputDescription] = useState(false); const [nodeDescription, setNodeDescription] = useState( - data.node?.description! + data.node?.description!, ); const [isOutdated, setIsOutdated] = useState(false); const [validationStatus, setValidationStatus] = @@ -84,7 +87,7 @@ export default function GenericNode({ data.node!, setNode, setIsOutdated, - updateNodeInternals + updateNodeInternals, ); const name = nodeIconsLucide[data.type] ? data.type : types[data.type]; @@ -115,12 +118,12 @@ export default function GenericNode({ selected: boolean, showNode: boolean, buildStatus: BuildStatus | undefined, - validationStatus: VertexBuildTypeAPI | null + validationStatus: VertexBuildTypeAPI | null, ) => { const specificClassFromBuildStatus = getSpecificClassFromBuildStatus( buildStatus, validationStatus, - isDark + isDark, ); const baseBorderClass = getBaseBorderClass(selected); @@ -129,7 +132,7 @@ export default function GenericNode({ baseBorderClass, nodeSizeClass, "generic-node-div group/node", - specificClassFromBuildStatus + specificClassFromBuildStatus, ); return names; }; @@ -170,7 +173,7 @@ export default function GenericNode({ showNode, isEmoji, nodeIconFragment, - checkNodeIconFragment + checkNodeIconFragment, ); function countHandles(): void { @@ -201,6 +204,33 @@ export default function GenericNode({ setShowNode(data.showNode ?? true); }, [data.showNode]); + const [loadingUpdate, setLoadingUpdate] = useState(false); + + const handleUpdateCode = () => { + setLoadingUpdate(true); + takeSnapshot(); + // to update we must get the code from the templates in useTypesStore + const thisNodeTemplate = templates[data.type]?.template; + // if the template does not have a code key + // return + if (!thisNodeTemplate?.code) return; + + const currentCode = thisNodeTemplate.code.value; + if (data.node) { + postCustomComponent(currentCode, data.node) + .then((apiReturn) => { + const { data } = apiReturn; + if (data && updateNodeCode) { + updateNodeCode(data, currentCode, "code"); + setLoadingUpdate(false); + } + }) + .catch((err) => { + console.log(err); + }); + } + }; + const memoizedNodeToolbarComponent = useMemo(() => { return ( @@ -221,8 +251,6 @@ export default function GenericNode({ showNode={showNode} openAdvancedModal={false} onCloseAdvancedModal={() => {}} - updateNodeCode={updateNodeCode} - isOutdated={isOutdated} selected={selected} /> @@ -247,7 +275,7 @@ export default function GenericNode({ selected, showNode, buildStatus, - validationStatus + validationStatus, )} > {data.node?.beta && showNode && ( @@ -378,7 +406,7 @@ export default function GenericNode({ } title={getFieldTitle( data.node?.template!, - templateField + templateField, )} info={data.node?.template[templateField].info} name={templateField} @@ -406,7 +434,7 @@ export default function GenericNode({ proxy={data.node?.template[templateField].proxy} showNode={showNode} /> - ) + ), )} {showNode && ( <> - {STATUS_BUILDING} - ) : !validationStatus ? ( - {STATUS_BUILD} - ) : ( -
-
- {lastRunTime && ( -
-
{RUN_TIMESTAMP_PREFIX}
-
- {lastRunTime} +
+ {isOutdated && ( + + + + )} + {STATUS_BUILDING} + ) : !validationStatus ? ( + {STATUS_BUILD} + ) : ( +
+
+ {lastRunTime && ( +
+
{RUN_TIMESTAMP_PREFIX}
+
+ {lastRunTime} +
+ )} +
+
+
Duration:
+
+ {validationStatus?.data.duration}
- )} -
-
-
Duration:
-
- {validationStatus?.data.duration}
-
- ) - } - side="bottom" - > - -
+
+ {renderIconStatus()} +
+ + +
)}
@@ -552,7 +597,7 @@ export default function GenericNode({ !data.node?.description) && nameEditable ? "font-light italic" - : "" + : "", )} onClick={(e) => { setInputDescription(true); @@ -614,13 +659,13 @@ export default function GenericNode({ } title={getFieldTitle( data.node?.template!, - templateField + templateField, )} info={data.node?.template[templateField].info} name={templateField} tooltipTitle={ data.node?.template[templateField].input_types?.join( - "\n" + "\n", ) ?? data.node?.template[templateField].type } required={data.node!.template[templateField].required} @@ -647,7 +692,7 @@ export default function GenericNode({
{" "} diff --git a/src/frontend/src/CustomNodes/hooks/use-check-code-validity.tsx b/src/frontend/src/CustomNodes/hooks/use-check-code-validity.tsx index 0b83429f8..4cbfbd8df 100644 --- a/src/frontend/src/CustomNodes/hooks/use-check-code-validity.tsx +++ b/src/frontend/src/CustomNodes/hooks/use-check-code-validity.tsx @@ -26,7 +26,8 @@ const useCheckCodeValidity = ( const componentsToIgnore = ["Custom Component", "Prompt"]; if ( currentCode !== thisNodesCode && - !componentsToIgnore.includes(data.node!.display_name) + !componentsToIgnore.includes(data.node!.display_name) && + !(data.node?.edited ?? false) ) { setIsOutdated(true); } else { diff --git a/src/frontend/src/CustomNodes/hooks/use-update-node-code.tsx b/src/frontend/src/CustomNodes/hooks/use-update-node-code.tsx index 28220d141..f1593597f 100644 --- a/src/frontend/src/CustomNodes/hooks/use-update-node-code.tsx +++ b/src/frontend/src/CustomNodes/hooks/use-update-node-code.tsx @@ -19,6 +19,7 @@ const useUpdateNodeCode = ( node: newNodeClass, description: newNodeClass.description ?? dataNode.description, display_name: newNodeClass.display_name ?? dataNode.display_name, + edited: false, }; newNode.data.node.template[name].value = code; diff --git a/src/frontend/src/assets/profile-circle.png b/src/frontend/src/assets/profile-circle.png new file mode 100644 index 000000000..e63f97c59 Binary files /dev/null and b/src/frontend/src/assets/profile-circle.png differ diff --git a/src/frontend/src/components/gradientChooserComponent/index.tsx b/src/frontend/src/components/gradientChooserComponent/index.tsx deleted file mode 100644 index 3467aedb8..000000000 --- a/src/frontend/src/components/gradientChooserComponent/index.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { gradients } from "../../utils/styleUtils"; - -export default function GradientChooserComponent({ value, onChange }) { - return ( -
- {gradients.map((gradient, idx) => ( -
{ - onChange(gradient); - }} - className={ - "duration-400 h-12 w-12 cursor-pointer rounded-full transition-all " + - gradient + - (value === gradient ? " shadow-lg ring-2 ring-primary" : "") - } - key={idx} - >
- ))} -
- ); -} diff --git a/src/frontend/src/components/headerComponent/index.tsx b/src/frontend/src/components/headerComponent/index.tsx index 455cdf8a4..eb27a1482 100644 --- a/src/frontend/src/components/headerComponent/index.tsx +++ b/src/frontend/src/components/headerComponent/index.tsx @@ -1,9 +1,12 @@ import { useContext } from "react"; +import profileCircle from "../../assets/profile-circle.png"; import { FaDiscord, FaGithub } from "react-icons/fa"; import { RiTwitterXFill } from "react-icons/ri"; import { Link, useLocation, useNavigate, useParams } from "react-router-dom"; import AlertDropdown from "../../alerts/alertDropDown"; import { + BACKEND_URL, + BASE_URL_API, LOCATIONS_TO_RETURN, USER_PROJECTS_HEADER, } from "../../constants/constants"; @@ -192,34 +195,35 @@ export default function Header(): JSX.Element { variant="none" size="none" data-testid="user-profile-settings" - className={ - "h-7 w-7 rounded-full focus-visible:outline-0 " + - (userData?.profile_image ?? - (userData?.id - ? gradients[ - parseInt(userData?.id ?? "", 30) % gradients.length - ] - : "bg-gray-500")) - } - /> + > + + {!autoLogin && ( <>
-
+ {userData?.username ?? "User"}
diff --git a/src/frontend/src/components/sidebarComponent/components/sideBarFolderButtons/index.tsx b/src/frontend/src/components/sidebarComponent/components/sideBarFolderButtons/index.tsx index 234eb9304..d43f753c5 100644 --- a/src/frontend/src/components/sidebarComponent/components/sideBarFolderButtons/index.tsx +++ b/src/frontend/src/components/sidebarComponent/components/sideBarFolderButtons/index.tsx @@ -31,7 +31,7 @@ const SideBarFoldersButtonsComponent = ({ const [foldersNames, setFoldersNames] = useState({}); const takeSnapshot = useFlowsManagerStore((state) => state.takeSnapshot); const [editFolders, setEditFolderName] = useState( - folders.map((obj) => ({ name: obj.name, edit: false })) + folders.map((obj) => ({ name: obj.name, edit: false })), ); const uploadFolder = useFolderStore((state) => state.uploadFolder); const currentFolder = pathname.split("/"); @@ -58,7 +58,7 @@ const SideBarFoldersButtonsComponent = ({ const { dragOver, dragEnter, dragLeave, onDrop } = useFileDrop( folderId, - handleFolderChange + handleFolderChange, ); const handleUploadFlowsToFolder = () => { @@ -86,7 +86,7 @@ const SideBarFoldersButtonsComponent = ({ addFolder({ name: "New Folder", parent_id: null, description: "" }).then( (res) => { getFoldersApi(true); - } + }, ); } @@ -132,7 +132,7 @@ const SideBarFoldersButtonsComponent = ({ <> {folders.map((item, index) => { const editFolderName = editFolders?.filter( - (folder) => folder.name === item.name + (folder) => folder.name === item.name, )[0]; return (
handleChangeFolder!(item.id!)} > @@ -218,7 +218,7 @@ const SideBarFoldersButtonsComponent = ({ folders.map((obj) => ({ name: obj.name, edit: false, - })) + })), ); } if (e.key === "Enter") { @@ -251,10 +251,10 @@ const SideBarFoldersButtonsComponent = ({ }; const updatedFolder = await updateFolder( body, - item.id! + item.id!, ); const updateFolders = folders.filter( - (f) => f.name !== item.name + (f) => f.name !== item.name, ); setFolders([...updateFolders, updatedFolder]); setFoldersNames({}); @@ -262,7 +262,7 @@ const SideBarFoldersButtonsComponent = ({ folders.map((obj) => ({ name: obj.name, edit: false, - })) + })), ); } else { setFoldersNames((old) => ({ diff --git a/src/frontend/src/components/tableComponent/components/tableNodeCellRender/index.tsx b/src/frontend/src/components/tableComponent/components/tableNodeCellRender/index.tsx index 6351d5d98..86db7de9c 100644 --- a/src/frontend/src/components/tableComponent/components/tableNodeCellRender/index.tsx +++ b/src/frontend/src/components/tableComponent/components/tableNodeCellRender/index.tsx @@ -63,8 +63,8 @@ export default function TableNodeCellRender({ ...id, proxy: templateData.proxy, } - : id - ) + : id, + ), ) ?? false; function getCellType() { switch (templateData.type) { @@ -135,7 +135,7 @@ export default function TableNodeCellRender({
1 ? "my-3" : "" + templateValue?.length > 1 ? "my-3" : "", )} > { const checkRequest = checkDuplicateRequestAndStoreRequest(config); + const controller = new AbortController(); + if (!checkRequest) { - return Promise.reject("Duplicate request."); + controller.abort("Duplicate Request"); } const accessToken = cookies.get("access_token_lf"); @@ -92,7 +94,10 @@ function ApiInterceptor() { config.headers["Authorization"] = `Bearer ${accessToken}`; } - return config; + return { + ...config, + signal: controller.signal, + }; }, (error) => { return Promise.reject(error); diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index 28a87bcaf..fd3847e97 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -8,6 +8,7 @@ import { APITemplateType, Component, LoginType, + ProfilePicturesTypeAPI, Users, VertexBuildTypeAPI, VerticesOrderTypeAPI, @@ -62,7 +63,7 @@ export async function sendAll(data: sendAllProps) { } export async function postValidateCode( - code: string + code: string, ): Promise> { return await api.post(`${BASE_URL_API}validate/code`, { code }); } @@ -77,7 +78,7 @@ export async function postValidateCode( export async function postValidatePrompt( name: string, template: string, - frontend_node: APIClassType + frontend_node: APIClassType, ): Promise> { return api.post(`${BASE_URL_API}validate/prompt`, { name, @@ -150,7 +151,7 @@ export async function saveFlowToDatabase(newFlow: { * @throws Will throw an error if the update fails. */ export async function updateFlowInDatabase( - updatedFlow: FlowType + updatedFlow: FlowType, ): Promise { try { const response = await api.patch(`${BASE_URL_API}flows/${updatedFlow.id}`, { @@ -328,7 +329,7 @@ export async function getHealth() { * */ export async function getBuildStatus( - flowId: string + flowId: string, ): Promise> { return await api.get(`${BASE_URL_API}build/${flowId}/status`); } @@ -341,7 +342,7 @@ export async function getBuildStatus( * */ export async function postBuildInit( - flow: FlowType + flow: FlowType, ): Promise> { return await api.post(`${BASE_URL_API}build/init/${flow.id}`, flow); } @@ -357,16 +358,29 @@ export async function postBuildInit( */ export async function uploadFile( file: File, - id: string + id: string, ): Promise> { const formData = new FormData(); formData.append("file", file); return await api.post(`${BASE_URL_API}files/upload/${id}`, formData); } +export async function getProfilePictures(): Promise { + try { + const res = await api.get(`${BASE_URL_API}files/profile_pictures/list`); + + if (res.status === 200) { + return res.data; + } + } catch (error) { + throw error; + } + return null; +} + export async function postCustomComponent( code: string, - apiClass: APIClassType + apiClass: APIClassType, ): Promise> { // let template = apiClass.template; return await api.post(`${BASE_URL_API}custom_component`, { @@ -379,7 +393,7 @@ export async function postCustomComponentUpdate( code: string, template: APITemplateType, field: string, - field_value: any + field_value: any, ): Promise> { return await api.post(`${BASE_URL_API}custom_component/update`, { code, @@ -401,7 +415,7 @@ export async function onLogin(user: LoginType) { headers: { "Content-Type": "application/x-www-form-urlencoded", }, - } + }, ); if (response.status === 200) { @@ -463,11 +477,11 @@ export async function addUser(user: UserInputType): Promise> { export async function getUsersPage( skip: number, - limit: number + limit: number, ): Promise> { try { const res = await api.get( - `${BASE_URL_API}users/?skip=${skip}&limit=${limit}` + `${BASE_URL_API}users/?skip=${skip}&limit=${limit}`, ); if (res.status === 200) { return res.data; @@ -504,7 +518,7 @@ export async function resetPassword(user_id: string, user: resetPasswordType) { try { const res = await api.patch( `${BASE_URL_API}users/${user_id}/reset-password`, - user + user, ); if (res.status === 200) { return res.data; @@ -578,7 +592,7 @@ export async function saveFlowStore( last_tested_version?: string; }, tags: string[], - publicFlow = false + publicFlow = false, ): Promise { try { const response = await api.post(`${BASE_URL_API}store/components/`, { @@ -707,7 +721,7 @@ export async function postStoreComponents(component: Component) { export async function getComponent(component_id: string) { try { const res = await api.get( - `${BASE_URL_API}store/components/${component_id}` + `${BASE_URL_API}store/components/${component_id}`, ); if (res.status === 200) { return res.data; @@ -722,7 +736,7 @@ export async function searchComponent( page?: number | null, limit?: number | null, status?: string | null, - tags?: string[] + tags?: string[], ): Promise { try { let url = `${BASE_URL_API}store/components/`; @@ -834,7 +848,7 @@ export async function updateFlowStore( }, tags: string[], publicFlow = false, - id: string + id: string, ): Promise { try { const response = await api.patch(`${BASE_URL_API}store/components/${id}`, { @@ -918,7 +932,7 @@ export async function deleteGlobalVariable(id: string) { export async function updateGlobalVariable( name: string, value: string, - id: string + id: string, ) { try { const response = api.patch(`${BASE_URL_API}variables/${id}`, { @@ -937,7 +951,7 @@ export async function getVerticesOrder( startNodeId?: string | null, stopNodeId?: string | null, nodes?: Node[], - Edges?: Edge[] + Edges?: Edge[], ): Promise> { // nodeId is optional and is a query parameter // if nodeId is not provided, the API will return all vertices @@ -957,7 +971,7 @@ export async function getVerticesOrder( return await api.post( `${BASE_URL_API}build/${flowId}/vertices`, data, - config + config, ); } @@ -965,7 +979,7 @@ export async function postBuildVertex( flowId: string, vertexId: string, input_value: string, - files?: string[] + files?: string[], ): Promise> { // input_value is optional and is a query parameter const data = { inputs: { input_value: input_value ?? "" } }; @@ -974,7 +988,7 @@ export async function postBuildVertex( } return await api.post( `${BASE_URL_API}build/${flowId}/vertices/${vertexId}`, - data + data, ); } @@ -998,7 +1012,7 @@ export async function getFlowPool({ } export async function deleteFlowPool( - flowId: string + flowId: string, ): Promise> { const config = {}; config["params"] = { flow_id: flowId }; @@ -1012,7 +1026,7 @@ export async function deleteFlowPool( * @returns A promise that resolves to an array of AxiosResponse objects representing the delete responses. */ export async function multipleDeleteFlowsComponents( - flowIds: string[] + flowIds: string[], ): Promise[]> { const batches: string[][] = []; @@ -1035,7 +1049,7 @@ export async function multipleDeleteFlowsComponents( // Execute all delete requests const responses: Promise>[] = batches.map((batch) => - deleteBatch(batch) + deleteBatch(batch), ); // Return the responses after all requests are completed @@ -1045,7 +1059,7 @@ export async function multipleDeleteFlowsComponents( export async function getTransactionTable( id: string, mode: "intersection" | "union", - params = {} + params = {}, ): Promise<{ rows: Array; columns: Array }> { const config = {}; config["params"] = { flow_id: id }; @@ -1061,7 +1075,7 @@ export async function getMessagesTable( mode: "intersection" | "union", id?: string, excludedFields?: string[], - params = {} + params = {}, ): Promise<{ rows: Array; columns: Array }> { const config = {}; if (id) { diff --git a/src/frontend/src/modals/baseModal/index.tsx b/src/frontend/src/modals/baseModal/index.tsx index 8ac883bb3..a95d615af 100644 --- a/src/frontend/src/modals/baseModal/index.tsx +++ b/src/frontend/src/modals/baseModal/index.tsx @@ -103,7 +103,7 @@ interface BaseModalProps { React.ReactElement, React.ReactElement, React.ReactElement?, - React.ReactElement? + React.ReactElement?, ]; open?: boolean; setOpen?: (open: boolean) => void; @@ -139,16 +139,16 @@ function BaseModal({ onSubmit, }: BaseModalProps) { const headerChild = React.Children.toArray(children).find( - (child) => (child as React.ReactElement).type === Header + (child) => (child as React.ReactElement).type === Header, ); const triggerChild = React.Children.toArray(children).find( - (child) => (child as React.ReactElement).type === Trigger + (child) => (child as React.ReactElement).type === Trigger, ); const ContentChild = React.Children.toArray(children).find( - (child) => (child as React.ReactElement).type === Content + (child) => (child as React.ReactElement).type === Content, ); const ContentFooter = React.Children.toArray(children).find( - (child) => (child as React.ReactElement).type === Footer + (child) => (child as React.ReactElement).type === Footer, ); let { minWidth, height } = switchCaseModalSize(size); diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx index e3bef9114..8636907d8 100644 --- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx @@ -40,10 +40,8 @@ export default function NodeToolbarComponent({ showNode, name = "code", selected, - updateNodeCode, setShowState, onCloseAdvancedModal, - isOutdated, }: nodeToolbarPropsType): JSX.Element { const nodeLength = Object.keys(data.node!.template).filter( (templateField) => @@ -179,37 +177,6 @@ export default function NodeToolbarComponent({ paneY: nodes.find((node) => node.id === data.id)?.position.y, }, ); - break; - case "update": - takeSnapshot(); - // to update we must get the code from the templates in useTypesStore - const thisNodeTemplate = templates[data.type]?.template; - // if the template does not have a code key - // return - if (!thisNodeTemplate?.code) return; - - const currentCode = thisNodeTemplate.code.value; - if (data.node) { - postCustomComponent(currentCode, data.node) - .then((apiReturn) => { - const { data } = apiReturn; - if (data && updateNodeCode) { - updateNodeCode(data, currentCode, "code"); - } - }) - .catch((err) => { - console.log(err); - }); - setNode(data.id, (oldNode) => { - let newNode = cloneDeep(oldNode); - newNode.data = { - ...data, - }; - newNode.data.node.template.code.value = currentCode; - return newNode; - }); - } - break; } }; @@ -508,19 +475,6 @@ export default function NodeToolbarComponent({ dataTestId="copy-button-modal" /> - {isOutdated && ( - - - - )} {hasStore && ( state.allFlows); const flowsFromFolder = useFolderStore( - (state) => state.selectedFolder?.flows + (state) => state.selectedFolder?.flows, ); const setSuccessData = useAlertStore((state) => state.setSuccessData); const setErrorData = useAlertStore((state) => state.setErrorData); const [openDelete, setOpenDelete] = useState(false); const searchFlowsComponents = useFlowsManagerStore( - (state) => state.searchFlowsComponents + (state) => state.searchFlowsComponents, ); const setSelectedFlowsComponentsCards = useFlowsManagerStore( - (state) => state.setSelectedFlowsComponentsCards + (state) => state.setSelectedFlowsComponentsCards, ); const selectedFlowsComponentsCards = useFlowsManagerStore( - (state) => state.selectedFlowsComponentsCards + (state) => state.selectedFlowsComponentsCards, ); const [handleFileDrop] = useFileDrop(uploadFlow, type)!; @@ -109,7 +109,7 @@ export default function ComponentsComponent({ const { handleSelectAll } = useSelectAll( flowsFromFolder, getValues, - setValue + setValue, ); const { handleDuplicate } = useDuplicateFlows( @@ -124,7 +124,7 @@ export default function ComponentsComponent({ setSuccessData, setSelectedFlowsComponentsCards, handleSelectAll, - cardTypes + cardTypes, ); const version = useDarkStore((state) => state.version); @@ -138,7 +138,7 @@ export default function ComponentsComponent({ setSuccessData, setSelectedFlowsComponentsCards, handleSelectAll, - cardTypes + cardTypes, ); const { handleSelectOptionsChange } = useSelectOptionsChange( @@ -146,7 +146,7 @@ export default function ComponentsComponent({ setErrorData, setOpenDelete, handleDuplicate, - handleExport + handleExport, ); const { handleDeleteMultiple } = useDeleteMultipleFlows( @@ -158,21 +158,21 @@ export default function ComponentsComponent({ myCollectionId, getFolderById, setSuccessData, - setErrorData + setErrorData, ); useSelectedFlows(entireFormValues, setSelectedFlowsComponentsCards); const descriptionModal = useDescriptionModal( selectedFlowsComponentsCards, - type + type, ); const getTotalRowsCount = () => { if (type === "all") return allFlows?.length; return allFlows?.filter( - (f) => (f.is_component ?? false) === (type === "component") + (f) => (f.is_component ?? false) === (type === "component"), )?.length; }; diff --git a/src/frontend/src/pages/MainPage/components/headerComponent/index.tsx b/src/frontend/src/pages/MainPage/components/headerComponent/index.tsx index bd8c7d107..f4e518e19 100644 --- a/src/frontend/src/pages/MainPage/components/headerComponent/index.tsx +++ b/src/frontend/src/pages/MainPage/components/headerComponent/index.tsx @@ -107,7 +107,7 @@ const HeaderComponent = ({ name="Trash2" className={cn( "h-5 w-5 text-primary transition-all", - disableFunctions ? "" : "hover:text-destructive" + disableFunctions ? "" : "hover:text-destructive", )} /> diff --git a/src/frontend/src/pages/ProfileSettingsPage/index.tsx b/src/frontend/src/pages/ProfileSettingsPage/index.tsx index a7af7c86a..78e328623 100644 --- a/src/frontend/src/pages/ProfileSettingsPage/index.tsx +++ b/src/frontend/src/pages/ProfileSettingsPage/index.tsx @@ -2,7 +2,7 @@ import * as Form from "@radix-ui/react-form"; import { cloneDeep } from "lodash"; import { useContext, useEffect, useState } from "react"; import IconComponent from "../../components/genericIconComponent"; -import GradientChooserComponent from "../../components/gradientChooserComponent"; +import GradientChooserComponent from "../SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent"; import Header from "../../components/headerComponent"; import InputComponent from "../../components/inputComponent"; import { Button } from "../../components/ui/button"; @@ -24,11 +24,11 @@ import { import { gradients } from "../../utils/styleUtils"; export default function ProfileSettingsPage(): JSX.Element { const setCurrentFlowId = useFlowsManagerStore( - (state) => state.setCurrentFlowId + (state) => state.setCurrentFlowId, ); const [inputState, setInputState] = useState( - CONTROL_PATCH_USER_STATE + CONTROL_PATCH_USER_STATE, ); // set null id diff --git a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfileGradientForm/index.tsx b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfileGradientForm/index.tsx deleted file mode 100644 index a92a00103..000000000 --- a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfileGradientForm/index.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import * as Form from "@radix-ui/react-form"; -import GradientChooserComponent from "../../../../../../components/gradientChooserComponent"; -import { Button } from "../../../../../../components/ui/button"; -import { - Card, - CardContent, - CardDescription, - CardFooter, - CardHeader, - CardTitle, -} from "../../../../../../components/ui/card"; -import { gradients } from "../../../../../../utils/styleUtils"; - -type ProfileGradientFormComponentProps = { - gradient: string; - handleInput: (event: any) => void; - handlePatchGradient: (gradient: string) => void; - userData: any; -}; -const ProfileGradientFormComponent = ({ - gradient, - handleInput, - handlePatchGradient, - userData, -}: ProfileGradientFormComponentProps) => { - return ( - <> - { - handlePatchGradient(gradient); - event.preventDefault(); - }} - > - - - Profile Gradient - - Choose the gradient that appears as your profile picture. - - - -
- { - handleInput({ target: { name: "gradient", value } }); - }} - /> -
-
- - - - - -
-
- - ); -}; -export default ProfileGradientFormComponent; diff --git a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/hooks/use-get-profile-pictures.ts b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/hooks/use-get-profile-pictures.ts new file mode 100644 index 000000000..2997a4b2f --- /dev/null +++ b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/hooks/use-get-profile-pictures.ts @@ -0,0 +1,26 @@ +import { reject } from "lodash"; +import { PROFILE_PICTURES_GET_ERROR_ALERT } from "../../../../../../../../../constants/alerts_constants"; +import { getProfilePictures } from "../../../../../../../../../controllers/API"; +import axios from "axios"; + +const useGetProfilePictures = (setErrorData) => { + const handleGetProfilePictures = async () => { + try { + const profilePictures = await getProfilePictures(); + return profilePictures!.files; + } catch (error) { + if (axios.isCancel(error)) { + console.warn("Request canceled: ", error.message); + } else { + setErrorData({ + title: PROFILE_PICTURES_GET_ERROR_ALERT, + list: [(error as any)?.response?.data?.detail], + }); + } + } + }; + + return { handleGetProfilePictures }; +}; + +export default useGetProfilePictures; diff --git a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/index.tsx b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/index.tsx new file mode 100644 index 000000000..5e2cee180 --- /dev/null +++ b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/components/profilePictureChooserComponent/index.tsx @@ -0,0 +1,80 @@ +import { useEffect, useRef, useState } from "react"; +import useAlertStore from "../../../../../../../../stores/alertStore"; +import { gradients } from "../../../../../../../../utils/styleUtils"; +import useGetProfilePictures from "./hooks/use-get-profile-pictures"; +import { Label } from "../../../../../../../../components/ui/label"; +import { + BACKEND_URL, + BASE_URL_API, +} from "../../../../../../../../constants/constants"; +import HorizontalScrollFadeComponent from "../../../../../../../../components/horizontalScrollFadeComponent"; +import LoadingComponent from "../../../../../../../../components/loadingComponent"; +import Loading from "../../../../../../../../components/ui/loading"; +import { cn } from "../../../../../../../../utils/utils"; +import { Button } from "../../../../../../../../components/ui/button"; + +type ProfilePictureChooserComponentProps = { + profilePictures: { [key: string]: string[] }; + loading: boolean; + value: string; + onChange: (value: string) => void; +}; + +export default function ProfilePictureChooserComponent({ + profilePictures, + loading, + value, + onChange, +}: ProfilePictureChooserComponentProps) { + const ref = useRef(null); + + useEffect(() => { + if (value && ref) { + ref.current?.scrollIntoView({ behavior: "smooth", block: "center" }); + } + }, [ref]); + + return ( +
+ {loading ? ( + + ) : ( + Object.keys(profilePictures).map((folder, idx) => ( +
+
+ {folder} +
+
+
+ {profilePictures[folder].map((path, idx) => ( + + ))} +
+
+
+ )) + )} +
+ ); +} diff --git a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/index.tsx b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/index.tsx new file mode 100644 index 000000000..a841ecc5e --- /dev/null +++ b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/components/ProfilePictureForm/index.tsx @@ -0,0 +1,109 @@ +import * as Form from "@radix-ui/react-form"; +import { Button } from "../../../../../../components/ui/button"; +import { + Card, + CardContent, + CardDescription, + CardFooter, + CardHeader, + CardTitle, +} from "../../../../../../components/ui/card"; +import { gradients } from "../../../../../../utils/styleUtils"; +import ProfilePictureChooserComponent from "./components/profilePictureChooserComponent"; +import { useEffect, useState } from "react"; +import { GenericAbortSignal } from "axios"; + +type ProfilePictureFormComponentProps = { + profilePicture: string; + handleInput: (event: any) => void; + handlePatchProfilePicture: (gradient: string) => void; + handleGetProfilePictures: () => Promise; + userData: any; +}; +const ProfilePictureFormComponent = ({ + profilePicture, + handleInput, + handlePatchProfilePicture, + handleGetProfilePictures, + userData, +}: ProfilePictureFormComponentProps) => { + const [profilePictures, setProfilePictures] = useState<{ + [key: string]: string[]; + }>({}); + const [loading, setLoading] = useState(true); + + useEffect(() => { + const abortController = new AbortController(); + + handleGetProfilePictures() + .then((data) => { + if (data) { + data.forEach((profile_picture) => { + const [folder, path] = profile_picture.split("/"); + setProfilePictures((prev) => { + if (prev[folder]) { + prev[folder].push(path); + } else { + prev[folder] = [path]; + } + return prev; + }); + setLoading(false); + }); + } + }) + .catch(() => { + setLoading(false); + }); + + /* + Abort the request as it isn't needed anymore, the component being + unmounted. It helps avoid, among other things, the well-known "can't + perform a React state update on an unmounted component" warning. + */ + return () => abortController.abort(); + }, []); + + return ( + { + handlePatchProfilePicture(profilePicture); + event.preventDefault(); + }} + > + + + Profile Picture + + Choose the image that appears as your profile picture. + + + +
+ { + handleInput({ target: { name: "profilePicture", value } }); + }} + /> +
+
+ + + + + +
+
+ ); +}; +export default ProfilePictureFormComponent; diff --git a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/index.tsx b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/index.tsx index 718097152..3c81bdb1c 100644 --- a/src/frontend/src/pages/SettingsPage/pages/GeneralPage/index.tsx +++ b/src/frontend/src/pages/SettingsPage/pages/GeneralPage/index.tsx @@ -9,14 +9,15 @@ import { inputHandlerEventType, patchUserInputStateType, } from "../../../../types/components"; -import usePatchGradient from "../hooks/use-patch-gradient"; +import usePatchProfilePicture from "../hooks/use-patch-profile-picture"; import usePatchPassword from "../hooks/use-patch-password"; import useSaveKey from "../hooks/use-save-key"; import useScrollToElement from "../hooks/use-scroll-to-element"; import GeneralPageHeaderComponent from "./components/GeneralPageHeader"; import PasswordFormComponent from "./components/PasswordForm"; -import ProfileGradientFormComponent from "./components/ProfileGradientForm"; +import ProfilePictureFormComponent from "./components/ProfilePictureForm"; import StoreApiKeyFormComponent from "./components/StoreApiKeyForm"; +import useGetProfilePictures from "./components/ProfilePictureForm/components/profilePictureChooserComponent/hooks/use-get-profile-pictures"; export default function GeneralPage() { const setCurrentFlowId = useFlowsManagerStore( @@ -42,7 +43,7 @@ export default function GeneralPage() { const loadingApiKey = useStoreStore((state) => state.loadingApiKey); const setValidApiKey = useStoreStore((state) => state.updateValidApiKey); const setLoadingApiKey = useStoreStore((state) => state.updateLoadingApiKey); - const { password, cnfPassword, gradient, apikey } = inputState; + const { password, cnfPassword, profilePicture, apikey } = inputState; const { handlePatchPassword } = usePatchPassword( userData, @@ -50,7 +51,9 @@ export default function GeneralPage() { setErrorData, ); - const { handlePatchGradient } = usePatchGradient( + const { handleGetProfilePictures } = useGetProfilePictures(setErrorData); + + const { handlePatchProfilePicture } = usePatchProfilePicture( setSuccessData, setErrorData, userData, @@ -78,10 +81,11 @@ export default function GeneralPage() {
- diff --git a/src/frontend/src/pages/SettingsPage/pages/hooks/use-patch-gradient.tsx b/src/frontend/src/pages/SettingsPage/pages/hooks/use-patch-profile-picture.tsx similarity index 63% rename from src/frontend/src/pages/SettingsPage/pages/hooks/use-patch-gradient.tsx rename to src/frontend/src/pages/SettingsPage/pages/hooks/use-patch-profile-picture.tsx index ea61d4722..584300fdf 100644 --- a/src/frontend/src/pages/SettingsPage/pages/hooks/use-patch-gradient.tsx +++ b/src/frontend/src/pages/SettingsPage/pages/hooks/use-patch-profile-picture.tsx @@ -5,18 +5,20 @@ import { } from "../../../../constants/alerts_constants"; import { updateUser } from "../../../../controllers/API"; -const usePatchGradient = ( +const usePatchProfilePicture = ( setSuccessData, setErrorData, currentUserData, setUserData, ) => { - const handlePatchGradient = async (gradient) => { + const handlePatchProfilePicture = async (profile_picture) => { try { - if (gradient !== "") { - await updateUser(currentUserData.id, { profile_image: gradient }); + if (profile_picture !== "") { + await updateUser(currentUserData.id, { + profile_image: profile_picture, + }); let newUserData = cloneDeep(currentUserData); - newUserData.profile_image = gradient; + newUserData.profile_image = profile_picture; setUserData(newUserData); } setSuccessData({ title: SAVE_SUCCESS_ALERT }); @@ -30,8 +32,8 @@ const usePatchGradient = ( return { currentUserData, - handlePatchGradient, + handlePatchProfilePicture, }; }; -export default usePatchGradient; +export default usePatchProfilePicture; diff --git a/src/frontend/src/types/api/index.ts b/src/frontend/src/types/api/index.ts index 86dd13c87..2ae8b20f6 100644 --- a/src/frontend/src/types/api/index.ts +++ b/src/frontend/src/types/api/index.ts @@ -93,6 +93,10 @@ export type UploadFileTypeAPI = { flowId: string; }; +export type ProfilePicturesTypeAPI = { + files: string[]; +}; + export type LoginType = { grant_type?: string; username: string; diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 31e75e094..895cf22b7 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -396,7 +396,7 @@ export type loginInputStateType = { export type patchUserInputStateType = { password: string; cnfPassword: string; - gradient: string; + profilePicture: string; apikey: string; }; @@ -491,7 +491,7 @@ export type ChatInputType = { isDragging: boolean; files: FilePreviewType[]; setFiles: ( - files: FilePreviewType[] | ((prev: FilePreviewType[]) => FilePreviewType[]) + files: FilePreviewType[] | ((prev: FilePreviewType[]) => FilePreviewType[]), ) => void; chatValue: string; inputRef: { @@ -544,13 +544,7 @@ export type nodeToolbarPropsType = { openAdvancedModal?: boolean; onCloseAdvancedModal?: (close: boolean) => void; selected: boolean; - updateNodeCode?: ( - newNodeClass: APIClassType, - code: string, - name: string, - ) => void; setShowState: (show: boolean | SetStateAction) => void; - isOutdated?: boolean; }; export type parsedDataType = { diff --git a/src/frontend/src/types/zustand/flow/index.ts b/src/frontend/src/types/zustand/flow/index.ts index e8b88e8d3..7449f7bc1 100644 --- a/src/frontend/src/types/zustand/flow/index.ts +++ b/src/frontend/src/types/zustand/flow/index.ts @@ -86,7 +86,7 @@ export type FlowStoreType = { state: | FlowState | undefined - | ((oldState: FlowState | undefined) => FlowState) + | ((oldState: FlowState | undefined) => FlowState), ) => void; nodes: Node[]; edges: Edge[]; @@ -94,11 +94,11 @@ export type FlowStoreType = { onEdgesChange: OnEdgesChange; setNodes: ( update: Node[] | ((oldState: Node[]) => Node[]), - skipSave?: boolean + skipSave?: boolean, ) => void; setEdges: ( update: Edge[] | ((oldState: Edge[]) => Edge[]), - skipSave?: boolean + skipSave?: boolean, ) => void; setNode: (id: string, update: Node | ((oldState: Node) => Node)) => void; getNode: (id: string) => Node | undefined; @@ -106,12 +106,12 @@ export type FlowStoreType = { deleteEdge: (edgeId: string | Array) => void; paste: ( selection: { nodes: any; edges: any }, - position: { x: number; y: number; paneX?: number; paneY?: number } + position: { x: number; y: number; paneX?: number; paneY?: number }, ) => void; lastCopiedSelection: { nodes: any; edges: any } | null; setLastCopiedSelection: ( newSelection: { nodes: any; edges: any } | null, - isCrop?: boolean + isCrop?: boolean, ) => void; cleanFlow: () => void; setFilterEdge: (newState) => void; @@ -138,7 +138,7 @@ export type FlowStoreType = { verticesLayers: VertexLayerElementType[][]; runId: string; verticesToRun: string[]; - } | null + } | null, ) => void; addToVerticesBuild: (vertices: string[]) => void; removeFromVerticesBuild: (vertices: string[]) => void; @@ -156,7 +156,7 @@ export type FlowStoreType = { updateFlowPool: ( nodeId: string, data: VertexBuildTypeAPI | ChatOutputType | ChatInputType, - buildId?: string + buildId?: string, ) => void; getNodePosition: (nodeId: string) => { x: number; y: number }; }; diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts index fc7f677d3..52adb4b70 100644 --- a/src/frontend/src/utils/styleUtils.ts +++ b/src/frontend/src/utils/styleUtils.ts @@ -116,6 +116,7 @@ import { Settings, Settings2, Share, + AlertTriangle, Share2, Shield, Sliders, @@ -432,6 +433,7 @@ export const nodeIconsLucide: iconsType = { SunIcon, MoonIcon, Bell, + AlertTriangle, ChevronLeft, SlidersHorizontal, Palette,