From cbc8f648491900317d753a20f19d85e118a80bd6 Mon Sep 17 00:00:00 2001 From: harini-venkataraman <115449948+harini-venkataraman@users.noreply.github.com> Date: Mon, 27 Jan 2025 17:12:29 +0530 Subject: [PATCH 01/15] [FIX] Adding execution source for Prompt run (#1094) Adding execution source for fetch response --- .../prompt_studio/prompt_studio_core_v2/prompt_studio_helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/prompt_studio/prompt_studio_core_v2/prompt_studio_helper.py b/backend/prompt_studio/prompt_studio_core_v2/prompt_studio_helper.py index f5ccf5419..3c6044223 100644 --- a/backend/prompt_studio/prompt_studio_core_v2/prompt_studio_helper.py +++ b/backend/prompt_studio/prompt_studio_core_v2/prompt_studio_helper.py @@ -902,6 +902,7 @@ def _fetch_response( TSPKeys.FILE_HASH: file_hash, TSPKeys.FILE_PATH: doc_path, Common.LOG_EVENTS_ID: StateStore.get(Common.LOG_EVENTS_ID), + TSPKeys.EXECUTION_SOURCE: ExecutionSource.IDE.value, } util = PromptIdeBaseTool(log_level=LogLevel.INFO, org_id=org_id) From 77c84720027ea2441dd9ab528d53a9113128ccb6 Mon Sep 17 00:00:00 2001 From: Gayathri <142381512+gaya3-zipstack@users.noreply.github.com> Date: Tue, 28 Jan 2025 09:09:00 +0530 Subject: [PATCH 02/15] Version roll for sdk 0.56.0rc4 (#1097) * SDK version 0.56.0rc4 roll * Commit pdm.lock changes --- backend/pdm.lock | 68 ++++++++-------- backend/pyproject.toml | 2 +- backend/sample.env | 4 +- pdm.lock | 68 ++++++++-------- platform-service/pdm.lock | 78 +++++++++---------- platform-service/pyproject.toml | 2 +- prompt-service/pdm.lock | 64 +++++++-------- prompt-service/pyproject.toml | 2 +- pyproject.toml | 2 +- tools/classifier/requirements.txt | 2 +- tools/classifier/src/config/properties.json | 2 +- tools/structure/requirements.txt | 2 +- tools/structure/src/config/properties.json | 2 +- tools/text_extractor/requirements.txt | 2 +- .../text_extractor/src/config/properties.json | 2 +- unstract/filesystem/pdm.lock | 78 +++++++++---------- unstract/filesystem/pyproject.toml | 2 +- unstract/tool-registry/pyproject.toml | 2 +- .../tool_registry_config/public_tools.json | 12 +-- 19 files changed, 198 insertions(+), 198 deletions(-) diff --git a/backend/pdm.lock b/backend/pdm.lock index 4b623c155..c9b2ee969 100644 --- a/backend/pdm.lock +++ b/backend/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "deploy", "dev", "test"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.4.2" -content_hash = "sha256:082fcff0302d049c12d2ad56e54cc76ad29a4c9e5c52d242a63190c5ce8ac2a1" +content_hash = "sha256:91a2107cba5ace82af1ff886802662781f7736cb1c414561d6de9b4b4c3f77d4" [[package]] name = "adlfs" @@ -328,13 +328,13 @@ files = [ [[package]] name = "attrs" -version = "24.3.0" +version = "25.1.0" requires_python = ">=3.8" summary = "Classes Without Boilerplate" groups = ["default", "dev"] files = [ - {file = "attrs-24.3.0-py3-none-any.whl", hash = "sha256:ac96cd038792094f438ad1f6ff80837353805ac950cd2aa0e0625ef19850c308"}, - {file = "attrs-24.3.0.tar.gz", hash = "sha256:8f5c07333d543103541ba7be0e2ce16eeee8130cb0b3f9238ab904ce1e85baff"}, + {file = "attrs-25.1.0-py3-none-any.whl", hash = "sha256:c75a69e28a550a7e93789579c22aa26b0f5b83b75dc4e08fe092980051e1090a"}, + {file = "attrs-25.1.0.tar.gz", hash = "sha256:1c97078a80c814273a76b2a298a932eb681c87415c11dee0a6921de7f1b02c3e"}, ] [[package]] @@ -915,7 +915,7 @@ files = [ [[package]] name = "deprecated" -version = "1.2.15" +version = "1.2.18" requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" summary = "Python @deprecated decorator to deprecate old python classes, functions or methods." groups = ["default", "dev"] @@ -923,8 +923,8 @@ dependencies = [ "wrapt<2,>=1.10", ] files = [ - {file = "Deprecated-1.2.15-py2.py3-none-any.whl", hash = "sha256:353bc4a8ac4bfc96800ddab349d89c25dec1079f65fd53acdcc1e0b975b21320"}, - {file = "deprecated-1.2.15.tar.gz", hash = "sha256:683e561a90de76239796e6b6feac66b99030d2dd3fcf61ef996330f14bbb9b0d"}, + {file = "Deprecated-1.2.18-py2.py3-none-any.whl", hash = "sha256:bd5011788200372a32418f888e326a09ff80d0214bd961147cfed01b5c018eec"}, + {file = "deprecated-1.2.18.tar.gz", hash = "sha256:422b6f6d859da6f2ef57857761bfb392480502a64c3028ca9bbe86085d72115d"}, ] [[package]] @@ -2260,7 +2260,7 @@ files = [ [[package]] name = "llama-index-core" -version = "0.12.13" +version = "0.12.14" requires_python = "<4.0,>=3.9" summary = "Interface between LLMs and your data" groups = ["default", "dev"] @@ -2290,8 +2290,8 @@ dependencies = [ "wrapt", ] files = [ - {file = "llama_index_core-0.12.13-py3-none-any.whl", hash = "sha256:9708bb594bbddffd6ff0767242e49d8978d1ba60a2e62e071d9d123ad2f17e6f"}, - {file = "llama_index_core-0.12.13.tar.gz", hash = "sha256:77af0161246ce1de38efc17cb6438dfff9e9558af00bcfac7dd4d0b7325efa4b"}, + {file = "llama_index_core-0.12.14-py3-none-any.whl", hash = "sha256:6fdb30e3fadf98e7df75f9db5d06f6a7f8503ca545a71e048d786ff88012bd50"}, + {file = "llama_index_core-0.12.14.tar.gz", hash = "sha256:378bbf5bf4d1a8c692d3a980c1a6ed3be7a9afb676a4960429dea15f62d06cd3"}, ] [[package]] @@ -2987,7 +2987,7 @@ files = [ [[package]] name = "openai" -version = "1.60.0" +version = "1.60.1" requires_python = ">=3.8" summary = "The official Python library for the openai API" groups = ["default", "dev"] @@ -3002,8 +3002,8 @@ dependencies = [ "typing-extensions<5,>=4.11", ] files = [ - {file = "openai-1.60.0-py3-none-any.whl", hash = "sha256:df06c43be8018274980ac363da07d4b417bd835ead1c66e14396f6f15a0d5dda"}, - {file = "openai-1.60.0.tar.gz", hash = "sha256:7fa536cd4b644718645b874d2706e36dbbef38b327e42ca0623275da347ee1a9"}, + {file = "openai-1.60.1-py3-none-any.whl", hash = "sha256:714181ec1c452353d456f143c22db892de7b373e3165063d02a2b798ed575ba1"}, + {file = "openai-1.60.1.tar.gz", hash = "sha256:beb1541dfc38b002bd629ab68b0d6fe35b870c5f4311d9bc4404d85af3214d5e"}, ] [[package]] @@ -3381,20 +3381,20 @@ files = [ [[package]] name = "protobuf" -version = "4.25.5" +version = "4.25.6" requires_python = ">=3.8" summary = "" groups = ["default", "dev"] files = [ - {file = "protobuf-4.25.5-cp310-abi3-win32.whl", hash = "sha256:5e61fd921603f58d2f5acb2806a929b4675f8874ff5f330b7d6f7e2e784bbcd8"}, - {file = "protobuf-4.25.5-cp310-abi3-win_amd64.whl", hash = "sha256:4be0571adcbe712b282a330c6e89eae24281344429ae95c6d85e79e84780f5ea"}, - {file = "protobuf-4.25.5-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:b2fde3d805354df675ea4c7c6338c1aecd254dfc9925e88c6d31a2bcb97eb173"}, - {file = "protobuf-4.25.5-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:919ad92d9b0310070f8356c24b855c98df2b8bd207ebc1c0c6fcc9ab1e007f3d"}, - {file = "protobuf-4.25.5-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:fe14e16c22be926d3abfcb500e60cab068baf10b542b8c858fa27e098123e331"}, - {file = "protobuf-4.25.5-cp39-cp39-win32.whl", hash = "sha256:abe32aad8561aa7cc94fc7ba4fdef646e576983edb94a73381b03c53728a626f"}, - {file = "protobuf-4.25.5-cp39-cp39-win_amd64.whl", hash = "sha256:7a183f592dc80aa7c8da7ad9e55091c4ffc9497b3054452d629bb85fa27c2a45"}, - {file = "protobuf-4.25.5-py3-none-any.whl", hash = "sha256:0aebecb809cae990f8129ada5ca273d9d670b76d9bfc9b1809f0a9c02b7dbf41"}, - {file = "protobuf-4.25.5.tar.gz", hash = "sha256:7f8249476b4a9473645db7f8ab42b02fe1488cbe5fb72fddd445e0665afd8584"}, + {file = "protobuf-4.25.6-cp310-abi3-win32.whl", hash = "sha256:61df6b5786e2b49fc0055f636c1e8f0aff263808bb724b95b164685ac1bcc13a"}, + {file = "protobuf-4.25.6-cp310-abi3-win_amd64.whl", hash = "sha256:b8f837bfb77513fe0e2f263250f423217a173b6d85135be4d81e96a4653bcd3c"}, + {file = "protobuf-4.25.6-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:6d4381f2417606d7e01750e2729fe6fbcda3f9883aa0c32b51d23012bded6c91"}, + {file = "protobuf-4.25.6-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:5dd800da412ba7f6f26d2c08868a5023ce624e1fdb28bccca2dc957191e81fb5"}, + {file = "protobuf-4.25.6-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:4434ff8bb5576f9e0c78f47c41cdf3a152c0b44de475784cd3fd170aef16205a"}, + {file = "protobuf-4.25.6-cp39-cp39-win32.whl", hash = "sha256:3f3b0b39db04b509859361ac9bca65a265fe9342e6b9406eda58029f5b1d10b2"}, + {file = "protobuf-4.25.6-cp39-cp39-win_amd64.whl", hash = "sha256:6ef2045f89d4ad8d95fd43cd84621487832a61d15b49500e4c1350e8a0ef96be"}, + {file = "protobuf-4.25.6-py3-none-any.whl", hash = "sha256:07972021c8e30b870cfc0863409d033af940213e0e7f64e27fe017b929d2c9f7"}, + {file = "protobuf-4.25.6.tar.gz", hash = "sha256:f8cfbae7c5afd0d0eaccbe73267339bff605a2315860bb1ba08eb66670a9a91f"}, ] [[package]] @@ -3765,7 +3765,7 @@ files = [ [[package]] name = "pypdf" -version = "5.1.0" +version = "5.2.0" requires_python = ">=3.8" summary = "A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files" groups = ["default", "dev"] @@ -3773,8 +3773,8 @@ dependencies = [ "typing-extensions>=4.0; python_version < \"3.11\"", ] files = [ - {file = "pypdf-5.1.0-py3-none-any.whl", hash = "sha256:3bd4f503f4ebc58bae40d81e81a9176c400cbbac2ba2d877367595fb524dfdfc"}, - {file = "pypdf-5.1.0.tar.gz", hash = "sha256:425a129abb1614183fd1aca6982f650b47f8026867c0ce7c4b9f281c443d2740"}, + {file = "pypdf-5.2.0-py3-none-any.whl", hash = "sha256:d107962ec45e65e3bd10c1d9242bdbbedaa38193c9e3a6617bd6d996e5747b19"}, + {file = "pypdf-5.2.0.tar.gz", hash = "sha256:7c38e68420f038f2c4998fd9d6717b6db4f6cef1642e9cf384d519c9cf094663"}, ] [[package]] @@ -4024,7 +4024,7 @@ files = [ [[package]] name = "referencing" -version = "0.36.1" +version = "0.36.2" requires_python = ">=3.9" summary = "JSON Referencing + Python" groups = ["default", "dev"] @@ -4034,8 +4034,8 @@ dependencies = [ "typing-extensions>=4.4.0; python_version < \"3.13\"", ] files = [ - {file = "referencing-0.36.1-py3-none-any.whl", hash = "sha256:363d9c65f080d0d70bc41c721dce3c7f3e77fc09f269cd5c8813da18069a6794"}, - {file = "referencing-0.36.1.tar.gz", hash = "sha256:ca2e6492769e3602957e9b831b94211599d2aade9477f5d44110d2530cf9aade"}, + {file = "referencing-0.36.2-py3-none-any.whl", hash = "sha256:e8699adbbf8b5c7de96d8ffa0eb5c158b3beafce084968e2ea8bb08c6794dcd0"}, + {file = "referencing-0.36.2.tar.gz", hash = "sha256:df2e89862cd09deabbdba16944cc3f10feb6b3e6f18e902f7cc25609a34775aa"}, ] [[package]] @@ -4991,7 +4991,7 @@ path = "../unstract/filesystem" summary = "Unstract filesystem package" groups = ["default", "dev"] dependencies = [ - "unstract-sdk~=0.56.0rc3", + "unstract-sdk~=0.56.0rc4", ] [[package]] @@ -5009,7 +5009,7 @@ dependencies = [ [[package]] name = "unstract-sdk" -version = "0.56.0rc3" +version = "0.56.0rc4" requires_python = "<3.11.1,>=3.9" summary = "A framework for writing Unstract Tools/Apps" groups = ["default", "dev"] @@ -5048,8 +5048,8 @@ dependencies = [ "transformers==4.37.0", ] files = [ - {file = "unstract_sdk-0.56.0rc3-py3-none-any.whl", hash = "sha256:abc8ee27b4eaa9694f272460b2696ed2798ff60b9b12539d327cdeaacbb02914"}, - {file = "unstract_sdk-0.56.0rc3.tar.gz", hash = "sha256:f09db70f91fe5405918a27b91b3807d812b223dae54b9ad1f688f02a88512bb1"}, + {file = "unstract_sdk-0.56.0rc4-py3-none-any.whl", hash = "sha256:e9128fc444b6d5fa5bc3dc9cd533113abb13bb4ff4ffd9195b18ca5e2450419c"}, + {file = "unstract_sdk-0.56.0rc4.tar.gz", hash = "sha256:ac5430ac48094aa15c45fb90f05c11c8d5a62d79c8cc8fd48a4639724588b897"}, ] [[package]] @@ -5065,7 +5065,7 @@ dependencies = [ "docker~=6.1.3", "jsonschema~=4.18.2", "unstract-flags", - "unstract-sdk~=0.56.0rc3", + "unstract-sdk~=0.56.0rc4", "unstract-tool-sandbox", ] diff --git a/backend/pyproject.toml b/backend/pyproject.toml index c0bb2bd01..4b9b59092 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -32,7 +32,7 @@ dependencies = [ "python-socketio==5.9.0", # For log_events "social-auth-app-django==5.3.0", # For OAuth "social-auth-core==4.4.2", # For OAuth - "unstract-sdk~=0.56.0rc3", + "unstract-sdk~=0.56.0rc4", # ! IMPORTANT! # Indirect local dependencies usually need to be added in their own projects # as: https://pdm-project.org/latest/usage/dependency/#local-dependencies. diff --git a/backend/sample.env b/backend/sample.env index 2ee45e4ad..b81af5053 100644 --- a/backend/sample.env +++ b/backend/sample.env @@ -82,9 +82,9 @@ REMOTE_PROMPT_STUDIO_FILE_PATH= # Structure Tool Image (Runs prompt studio exported tools) # https://hub.docker.com/r/unstract/tool-structure -STRUCTURE_TOOL_IMAGE_URL="docker:unstract/tool-structure:0.0.59" +STRUCTURE_TOOL_IMAGE_URL="docker:unstract/tool-structure:0.0.60" STRUCTURE_TOOL_IMAGE_NAME="unstract/tool-structure" -STRUCTURE_TOOL_IMAGE_TAG="0.0.59" +STRUCTURE_TOOL_IMAGE_TAG="0.0.60" # Feature Flags EVALUATION_SERVER_IP=unstract-flipt diff --git a/pdm.lock b/pdm.lock index 584b93e1e..5e87c74b2 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "hook-check-django-migrations", "lint"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.4.2" -content_hash = "sha256:d993c122bcfa80cbba27d8290731522e4fe18415b2054ca313bab38e994513ae" +content_hash = "sha256:9dc5e146b58d8cf31432d2a076127c65181c5bbffc5e8ef79ec87287fe3b30d3" [[package]] name = "adlfs" @@ -328,13 +328,13 @@ files = [ [[package]] name = "attrs" -version = "24.3.0" +version = "25.1.0" requires_python = ">=3.8" summary = "Classes Without Boilerplate" groups = ["hook-check-django-migrations"] files = [ - {file = "attrs-24.3.0-py3-none-any.whl", hash = "sha256:ac96cd038792094f438ad1f6ff80837353805ac950cd2aa0e0625ef19850c308"}, - {file = "attrs-24.3.0.tar.gz", hash = "sha256:8f5c07333d543103541ba7be0e2ce16eeee8130cb0b3f9238ab904ce1e85baff"}, + {file = "attrs-25.1.0-py3-none-any.whl", hash = "sha256:c75a69e28a550a7e93789579c22aa26b0f5b83b75dc4e08fe092980051e1090a"}, + {file = "attrs-25.1.0.tar.gz", hash = "sha256:1c97078a80c814273a76b2a298a932eb681c87415c11dee0a6921de7f1b02c3e"}, ] [[package]] @@ -909,7 +909,7 @@ files = [ [[package]] name = "deprecated" -version = "1.2.15" +version = "1.2.18" requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" summary = "Python @deprecated decorator to deprecate old python classes, functions or methods." groups = ["hook-check-django-migrations"] @@ -917,8 +917,8 @@ dependencies = [ "wrapt<2,>=1.10", ] files = [ - {file = "Deprecated-1.2.15-py2.py3-none-any.whl", hash = "sha256:353bc4a8ac4bfc96800ddab349d89c25dec1079f65fd53acdcc1e0b975b21320"}, - {file = "deprecated-1.2.15.tar.gz", hash = "sha256:683e561a90de76239796e6b6feac66b99030d2dd3fcf61ef996330f14bbb9b0d"}, + {file = "Deprecated-1.2.18-py2.py3-none-any.whl", hash = "sha256:bd5011788200372a32418f888e326a09ff80d0214bd961147cfed01b5c018eec"}, + {file = "deprecated-1.2.18.tar.gz", hash = "sha256:422b6f6d859da6f2ef57857761bfb392480502a64c3028ca9bbe86085d72115d"}, ] [[package]] @@ -2231,7 +2231,7 @@ files = [ [[package]] name = "llama-index-core" -version = "0.12.13" +version = "0.12.14" requires_python = "<4.0,>=3.9" summary = "Interface between LLMs and your data" groups = ["hook-check-django-migrations"] @@ -2261,8 +2261,8 @@ dependencies = [ "wrapt", ] files = [ - {file = "llama_index_core-0.12.13-py3-none-any.whl", hash = "sha256:9708bb594bbddffd6ff0767242e49d8978d1ba60a2e62e071d9d123ad2f17e6f"}, - {file = "llama_index_core-0.12.13.tar.gz", hash = "sha256:77af0161246ce1de38efc17cb6438dfff9e9558af00bcfac7dd4d0b7325efa4b"}, + {file = "llama_index_core-0.12.14-py3-none-any.whl", hash = "sha256:6fdb30e3fadf98e7df75f9db5d06f6a7f8503ca545a71e048d786ff88012bd50"}, + {file = "llama_index_core-0.12.14.tar.gz", hash = "sha256:378bbf5bf4d1a8c692d3a980c1a6ed3be7a9afb676a4960429dea15f62d06cd3"}, ] [[package]] @@ -2993,7 +2993,7 @@ files = [ [[package]] name = "openai" -version = "1.60.0" +version = "1.60.1" requires_python = ">=3.8" summary = "The official Python library for the openai API" groups = ["hook-check-django-migrations"] @@ -3008,8 +3008,8 @@ dependencies = [ "typing-extensions<5,>=4.11", ] files = [ - {file = "openai-1.60.0-py3-none-any.whl", hash = "sha256:df06c43be8018274980ac363da07d4b417bd835ead1c66e14396f6f15a0d5dda"}, - {file = "openai-1.60.0.tar.gz", hash = "sha256:7fa536cd4b644718645b874d2706e36dbbef38b327e42ca0623275da347ee1a9"}, + {file = "openai-1.60.1-py3-none-any.whl", hash = "sha256:714181ec1c452353d456f143c22db892de7b373e3165063d02a2b798ed575ba1"}, + {file = "openai-1.60.1.tar.gz", hash = "sha256:beb1541dfc38b002bd629ab68b0d6fe35b870c5f4311d9bc4404d85af3214d5e"}, ] [[package]] @@ -3394,20 +3394,20 @@ files = [ [[package]] name = "protobuf" -version = "4.25.5" +version = "4.25.6" requires_python = ">=3.8" summary = "" groups = ["hook-check-django-migrations"] files = [ - {file = "protobuf-4.25.5-cp310-abi3-win32.whl", hash = "sha256:5e61fd921603f58d2f5acb2806a929b4675f8874ff5f330b7d6f7e2e784bbcd8"}, - {file = "protobuf-4.25.5-cp310-abi3-win_amd64.whl", hash = "sha256:4be0571adcbe712b282a330c6e89eae24281344429ae95c6d85e79e84780f5ea"}, - {file = "protobuf-4.25.5-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:b2fde3d805354df675ea4c7c6338c1aecd254dfc9925e88c6d31a2bcb97eb173"}, - {file = "protobuf-4.25.5-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:919ad92d9b0310070f8356c24b855c98df2b8bd207ebc1c0c6fcc9ab1e007f3d"}, - {file = "protobuf-4.25.5-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:fe14e16c22be926d3abfcb500e60cab068baf10b542b8c858fa27e098123e331"}, - {file = "protobuf-4.25.5-cp39-cp39-win32.whl", hash = "sha256:abe32aad8561aa7cc94fc7ba4fdef646e576983edb94a73381b03c53728a626f"}, - {file = "protobuf-4.25.5-cp39-cp39-win_amd64.whl", hash = "sha256:7a183f592dc80aa7c8da7ad9e55091c4ffc9497b3054452d629bb85fa27c2a45"}, - {file = "protobuf-4.25.5-py3-none-any.whl", hash = "sha256:0aebecb809cae990f8129ada5ca273d9d670b76d9bfc9b1809f0a9c02b7dbf41"}, - {file = "protobuf-4.25.5.tar.gz", hash = "sha256:7f8249476b4a9473645db7f8ab42b02fe1488cbe5fb72fddd445e0665afd8584"}, + {file = "protobuf-4.25.6-cp310-abi3-win32.whl", hash = "sha256:61df6b5786e2b49fc0055f636c1e8f0aff263808bb724b95b164685ac1bcc13a"}, + {file = "protobuf-4.25.6-cp310-abi3-win_amd64.whl", hash = "sha256:b8f837bfb77513fe0e2f263250f423217a173b6d85135be4d81e96a4653bcd3c"}, + {file = "protobuf-4.25.6-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:6d4381f2417606d7e01750e2729fe6fbcda3f9883aa0c32b51d23012bded6c91"}, + {file = "protobuf-4.25.6-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:5dd800da412ba7f6f26d2c08868a5023ce624e1fdb28bccca2dc957191e81fb5"}, + {file = "protobuf-4.25.6-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:4434ff8bb5576f9e0c78f47c41cdf3a152c0b44de475784cd3fd170aef16205a"}, + {file = "protobuf-4.25.6-cp39-cp39-win32.whl", hash = "sha256:3f3b0b39db04b509859361ac9bca65a265fe9342e6b9406eda58029f5b1d10b2"}, + {file = "protobuf-4.25.6-cp39-cp39-win_amd64.whl", hash = "sha256:6ef2045f89d4ad8d95fd43cd84621487832a61d15b49500e4c1350e8a0ef96be"}, + {file = "protobuf-4.25.6-py3-none-any.whl", hash = "sha256:07972021c8e30b870cfc0863409d033af940213e0e7f64e27fe017b929d2c9f7"}, + {file = "protobuf-4.25.6.tar.gz", hash = "sha256:f8cfbae7c5afd0d0eaccbe73267339bff605a2315860bb1ba08eb66670a9a91f"}, ] [[package]] @@ -3800,7 +3800,7 @@ files = [ [[package]] name = "pypdf" -version = "5.1.0" +version = "5.2.0" requires_python = ">=3.8" summary = "A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files" groups = ["hook-check-django-migrations"] @@ -3808,8 +3808,8 @@ dependencies = [ "typing-extensions>=4.0; python_version < \"3.11\"", ] files = [ - {file = "pypdf-5.1.0-py3-none-any.whl", hash = "sha256:3bd4f503f4ebc58bae40d81e81a9176c400cbbac2ba2d877367595fb524dfdfc"}, - {file = "pypdf-5.1.0.tar.gz", hash = "sha256:425a129abb1614183fd1aca6982f650b47f8026867c0ce7c4b9f281c443d2740"}, + {file = "pypdf-5.2.0-py3-none-any.whl", hash = "sha256:d107962ec45e65e3bd10c1d9242bdbbedaa38193c9e3a6617bd6d996e5747b19"}, + {file = "pypdf-5.2.0.tar.gz", hash = "sha256:7c38e68420f038f2c4998fd9d6717b6db4f6cef1642e9cf384d519c9cf094663"}, ] [[package]] @@ -3997,7 +3997,7 @@ files = [ [[package]] name = "referencing" -version = "0.36.1" +version = "0.36.2" requires_python = ">=3.9" summary = "JSON Referencing + Python" groups = ["hook-check-django-migrations"] @@ -4007,8 +4007,8 @@ dependencies = [ "typing-extensions>=4.4.0; python_version < \"3.13\"", ] files = [ - {file = "referencing-0.36.1-py3-none-any.whl", hash = "sha256:363d9c65f080d0d70bc41c721dce3c7f3e77fc09f269cd5c8813da18069a6794"}, - {file = "referencing-0.36.1.tar.gz", hash = "sha256:ca2e6492769e3602957e9b831b94211599d2aade9477f5d44110d2530cf9aade"}, + {file = "referencing-0.36.2-py3-none-any.whl", hash = "sha256:e8699adbbf8b5c7de96d8ffa0eb5c158b3beafce084968e2ea8bb08c6794dcd0"}, + {file = "referencing-0.36.2.tar.gz", hash = "sha256:df2e89862cd09deabbdba16944cc3f10feb6b3e6f18e902f7cc25609a34775aa"}, ] [[package]] @@ -5056,7 +5056,7 @@ path = "./unstract/filesystem" summary = "Unstract filesystem package" groups = ["hook-check-django-migrations"] dependencies = [ - "unstract-sdk~=0.56.0rc3", + "unstract-sdk~=0.56.0rc4", ] [[package]] @@ -5074,7 +5074,7 @@ dependencies = [ [[package]] name = "unstract-sdk" -version = "0.56.0rc3" +version = "0.56.0rc4" requires_python = "<3.11.1,>=3.9" summary = "A framework for writing Unstract Tools/Apps" groups = ["hook-check-django-migrations"] @@ -5113,8 +5113,8 @@ dependencies = [ "transformers==4.37.0", ] files = [ - {file = "unstract_sdk-0.56.0rc3-py3-none-any.whl", hash = "sha256:abc8ee27b4eaa9694f272460b2696ed2798ff60b9b12539d327cdeaacbb02914"}, - {file = "unstract_sdk-0.56.0rc3.tar.gz", hash = "sha256:f09db70f91fe5405918a27b91b3807d812b223dae54b9ad1f688f02a88512bb1"}, + {file = "unstract_sdk-0.56.0rc4-py3-none-any.whl", hash = "sha256:e9128fc444b6d5fa5bc3dc9cd533113abb13bb4ff4ffd9195b18ca5e2450419c"}, + {file = "unstract_sdk-0.56.0rc4.tar.gz", hash = "sha256:ac5430ac48094aa15c45fb90f05c11c8d5a62d79c8cc8fd48a4639724588b897"}, ] [[package]] @@ -5130,7 +5130,7 @@ dependencies = [ "docker~=6.1.3", "jsonschema~=4.18.2", "unstract-flags", - "unstract-sdk~=0.56.0rc3", + "unstract-sdk~=0.56.0rc4", "unstract-tool-sandbox", ] diff --git a/platform-service/pdm.lock b/platform-service/pdm.lock index 332594542..1887fe542 100644 --- a/platform-service/pdm.lock +++ b/platform-service/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "deploy", "test"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.4.2" -content_hash = "sha256:9940aa58ddcb8af9387e35b778efcac832eb0a5fcaff4c6f50edde59f5f49d96" +content_hash = "sha256:dd32742fd92bdfef161dbc96c10c753e8dded5271b6185cb9b39dd4fcf5263a8" [[package]] name = "aiohappyeyeballs" @@ -214,13 +214,13 @@ files = [ [[package]] name = "attrs" -version = "24.3.0" +version = "25.1.0" requires_python = ">=3.8" summary = "Classes Without Boilerplate" groups = ["default"] files = [ - {file = "attrs-24.3.0-py3-none-any.whl", hash = "sha256:ac96cd038792094f438ad1f6ff80837353805ac950cd2aa0e0625ef19850c308"}, - {file = "attrs-24.3.0.tar.gz", hash = "sha256:8f5c07333d543103541ba7be0e2ce16eeee8130cb0b3f9238ab904ce1e85baff"}, + {file = "attrs-25.1.0-py3-none-any.whl", hash = "sha256:c75a69e28a550a7e93789579c22aa26b0f5b83b75dc4e08fe092980051e1090a"}, + {file = "attrs-25.1.0.tar.gz", hash = "sha256:1c97078a80c814273a76b2a298a932eb681c87415c11dee0a6921de7f1b02c3e"}, ] [[package]] @@ -298,23 +298,23 @@ files = [ [[package]] name = "boto3" -version = "1.36.5" +version = "1.36.6" requires_python = ">=3.8" summary = "The AWS SDK for Python" groups = ["default"] dependencies = [ - "botocore<1.37.0,>=1.36.5", + "botocore<1.37.0,>=1.36.6", "jmespath<2.0.0,>=0.7.1", "s3transfer<0.12.0,>=0.11.0", ] files = [ - {file = "boto3-1.36.5-py3-none-any.whl", hash = "sha256:a404ad5ec94ff40c176215a991bf62f0db5514a93a3dd361b7b2ab9660f811f4"}, - {file = "boto3-1.36.5.tar.gz", hash = "sha256:58a6b7c3d5145b3ac04d4b6caa76223b8ef88004b4237444e553041e29581a11"}, + {file = "boto3-1.36.6-py3-none-any.whl", hash = "sha256:6d473f0f340d02b4e9ad5b8e68786a09728101a8b950231b89ebdaf72b6dca21"}, + {file = "boto3-1.36.6.tar.gz", hash = "sha256:b36feae061dc0793cf311468956a0a9e99215ce38bc99a1a4e55a5b105f16297"}, ] [[package]] name = "botocore" -version = "1.36.5" +version = "1.36.6" requires_python = ">=3.8" summary = "Low-level, data-driven core of boto 3." groups = ["default"] @@ -325,8 +325,8 @@ dependencies = [ "urllib3<1.27,>=1.25.4; python_version < \"3.10\"", ] files = [ - {file = "botocore-1.36.5-py3-none-any.whl", hash = "sha256:6d9f70afa9bf9d21407089dc22b8cc8ec6fa44866d4660858c062c74fc8555eb"}, - {file = "botocore-1.36.5.tar.gz", hash = "sha256:234ed3d29a8954c37a551c933453bf14c6ae44a69a4f273ffef377a2612ca6a6"}, + {file = "botocore-1.36.6-py3-none-any.whl", hash = "sha256:f77bbbb03fb420e260174650fb5c0cc142ec20a96967734eed2b0ef24334ef34"}, + {file = "botocore-1.36.6.tar.gz", hash = "sha256:4864c53d638da191a34daf3ede3ff1371a3719d952cc0c6bd24ce2836a38dd77"}, ] [[package]] @@ -544,7 +544,7 @@ files = [ [[package]] name = "deprecated" -version = "1.2.15" +version = "1.2.18" requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" summary = "Python @deprecated decorator to deprecate old python classes, functions or methods." groups = ["default"] @@ -552,8 +552,8 @@ dependencies = [ "wrapt<2,>=1.10", ] files = [ - {file = "Deprecated-1.2.15-py2.py3-none-any.whl", hash = "sha256:353bc4a8ac4bfc96800ddab349d89c25dec1079f65fd53acdcc1e0b975b21320"}, - {file = "deprecated-1.2.15.tar.gz", hash = "sha256:683e561a90de76239796e6b6feac66b99030d2dd3fcf61ef996330f14bbb9b0d"}, + {file = "Deprecated-1.2.18-py2.py3-none-any.whl", hash = "sha256:bd5011788200372a32418f888e326a09ff80d0214bd961147cfed01b5c018eec"}, + {file = "deprecated-1.2.18.tar.gz", hash = "sha256:422b6f6d859da6f2ef57857761bfb392480502a64c3028ca9bbe86085d72115d"}, ] [[package]] @@ -1618,7 +1618,7 @@ files = [ [[package]] name = "llama-index-core" -version = "0.12.13" +version = "0.12.14" requires_python = "<4.0,>=3.9" summary = "Interface between LLMs and your data" groups = ["default"] @@ -1648,8 +1648,8 @@ dependencies = [ "wrapt", ] files = [ - {file = "llama_index_core-0.12.13-py3-none-any.whl", hash = "sha256:9708bb594bbddffd6ff0767242e49d8978d1ba60a2e62e071d9d123ad2f17e6f"}, - {file = "llama_index_core-0.12.13.tar.gz", hash = "sha256:77af0161246ce1de38efc17cb6438dfff9e9558af00bcfac7dd4d0b7325efa4b"}, + {file = "llama_index_core-0.12.14-py3-none-any.whl", hash = "sha256:6fdb30e3fadf98e7df75f9db5d06f6a7f8503ca545a71e048d786ff88012bd50"}, + {file = "llama_index_core-0.12.14.tar.gz", hash = "sha256:378bbf5bf4d1a8c692d3a980c1a6ed3be7a9afb676a4960429dea15f62d06cd3"}, ] [[package]] @@ -2357,7 +2357,7 @@ files = [ [[package]] name = "openai" -version = "1.60.0" +version = "1.60.1" requires_python = ">=3.8" summary = "The official Python library for the openai API" groups = ["default"] @@ -2372,8 +2372,8 @@ dependencies = [ "typing-extensions<5,>=4.11", ] files = [ - {file = "openai-1.60.0-py3-none-any.whl", hash = "sha256:df06c43be8018274980ac363da07d4b417bd835ead1c66e14396f6f15a0d5dda"}, - {file = "openai-1.60.0.tar.gz", hash = "sha256:7fa536cd4b644718645b874d2706e36dbbef38b327e42ca0623275da347ee1a9"}, + {file = "openai-1.60.1-py3-none-any.whl", hash = "sha256:714181ec1c452353d456f143c22db892de7b373e3165063d02a2b798ed575ba1"}, + {file = "openai-1.60.1.tar.gz", hash = "sha256:beb1541dfc38b002bd629ab68b0d6fe35b870c5f4311d9bc4404d85af3214d5e"}, ] [[package]] @@ -2673,20 +2673,20 @@ files = [ [[package]] name = "protobuf" -version = "4.25.5" +version = "4.25.6" requires_python = ">=3.8" summary = "" groups = ["default"] files = [ - {file = "protobuf-4.25.5-cp310-abi3-win32.whl", hash = "sha256:5e61fd921603f58d2f5acb2806a929b4675f8874ff5f330b7d6f7e2e784bbcd8"}, - {file = "protobuf-4.25.5-cp310-abi3-win_amd64.whl", hash = "sha256:4be0571adcbe712b282a330c6e89eae24281344429ae95c6d85e79e84780f5ea"}, - {file = "protobuf-4.25.5-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:b2fde3d805354df675ea4c7c6338c1aecd254dfc9925e88c6d31a2bcb97eb173"}, - {file = "protobuf-4.25.5-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:919ad92d9b0310070f8356c24b855c98df2b8bd207ebc1c0c6fcc9ab1e007f3d"}, - {file = "protobuf-4.25.5-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:fe14e16c22be926d3abfcb500e60cab068baf10b542b8c858fa27e098123e331"}, - {file = "protobuf-4.25.5-cp39-cp39-win32.whl", hash = "sha256:abe32aad8561aa7cc94fc7ba4fdef646e576983edb94a73381b03c53728a626f"}, - {file = "protobuf-4.25.5-cp39-cp39-win_amd64.whl", hash = "sha256:7a183f592dc80aa7c8da7ad9e55091c4ffc9497b3054452d629bb85fa27c2a45"}, - {file = "protobuf-4.25.5-py3-none-any.whl", hash = "sha256:0aebecb809cae990f8129ada5ca273d9d670b76d9bfc9b1809f0a9c02b7dbf41"}, - {file = "protobuf-4.25.5.tar.gz", hash = "sha256:7f8249476b4a9473645db7f8ab42b02fe1488cbe5fb72fddd445e0665afd8584"}, + {file = "protobuf-4.25.6-cp310-abi3-win32.whl", hash = "sha256:61df6b5786e2b49fc0055f636c1e8f0aff263808bb724b95b164685ac1bcc13a"}, + {file = "protobuf-4.25.6-cp310-abi3-win_amd64.whl", hash = "sha256:b8f837bfb77513fe0e2f263250f423217a173b6d85135be4d81e96a4653bcd3c"}, + {file = "protobuf-4.25.6-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:6d4381f2417606d7e01750e2729fe6fbcda3f9883aa0c32b51d23012bded6c91"}, + {file = "protobuf-4.25.6-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:5dd800da412ba7f6f26d2c08868a5023ce624e1fdb28bccca2dc957191e81fb5"}, + {file = "protobuf-4.25.6-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:4434ff8bb5576f9e0c78f47c41cdf3a152c0b44de475784cd3fd170aef16205a"}, + {file = "protobuf-4.25.6-cp39-cp39-win32.whl", hash = "sha256:3f3b0b39db04b509859361ac9bca65a265fe9342e6b9406eda58029f5b1d10b2"}, + {file = "protobuf-4.25.6-cp39-cp39-win_amd64.whl", hash = "sha256:6ef2045f89d4ad8d95fd43cd84621487832a61d15b49500e4c1350e8a0ef96be"}, + {file = "protobuf-4.25.6-py3-none-any.whl", hash = "sha256:07972021c8e30b870cfc0863409d033af940213e0e7f64e27fe017b929d2c9f7"}, + {file = "protobuf-4.25.6.tar.gz", hash = "sha256:f8cfbae7c5afd0d0eaccbe73267339bff605a2315860bb1ba08eb66670a9a91f"}, ] [[package]] @@ -2919,7 +2919,7 @@ files = [ [[package]] name = "pypdf" -version = "5.1.0" +version = "5.2.0" requires_python = ">=3.8" summary = "A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files" groups = ["default"] @@ -2927,8 +2927,8 @@ dependencies = [ "typing-extensions>=4.0; python_version < \"3.11\"", ] files = [ - {file = "pypdf-5.1.0-py3-none-any.whl", hash = "sha256:3bd4f503f4ebc58bae40d81e81a9176c400cbbac2ba2d877367595fb524dfdfc"}, - {file = "pypdf-5.1.0.tar.gz", hash = "sha256:425a129abb1614183fd1aca6982f650b47f8026867c0ce7c4b9f281c443d2740"}, + {file = "pypdf-5.2.0-py3-none-any.whl", hash = "sha256:d107962ec45e65e3bd10c1d9242bdbbedaa38193c9e3a6617bd6d996e5747b19"}, + {file = "pypdf-5.2.0.tar.gz", hash = "sha256:7c38e68420f038f2c4998fd9d6717b6db4f6cef1642e9cf384d519c9cf094663"}, ] [[package]] @@ -3109,7 +3109,7 @@ files = [ [[package]] name = "referencing" -version = "0.36.1" +version = "0.36.2" requires_python = ">=3.9" summary = "JSON Referencing + Python" groups = ["default"] @@ -3119,8 +3119,8 @@ dependencies = [ "typing-extensions>=4.4.0; python_version < \"3.13\"", ] files = [ - {file = "referencing-0.36.1-py3-none-any.whl", hash = "sha256:363d9c65f080d0d70bc41c721dce3c7f3e77fc09f269cd5c8813da18069a6794"}, - {file = "referencing-0.36.1.tar.gz", hash = "sha256:ca2e6492769e3602957e9b831b94211599d2aade9477f5d44110d2530cf9aade"}, + {file = "referencing-0.36.2-py3-none-any.whl", hash = "sha256:e8699adbbf8b5c7de96d8ffa0eb5c158b3beafce084968e2ea8bb08c6794dcd0"}, + {file = "referencing-0.36.2.tar.gz", hash = "sha256:df2e89862cd09deabbdba16944cc3f10feb6b3e6f18e902f7cc25609a34775aa"}, ] [[package]] @@ -3798,7 +3798,7 @@ dependencies = [ [[package]] name = "unstract-sdk" -version = "0.56.0rc3" +version = "0.56.0rc4" requires_python = "<3.11.1,>=3.9" summary = "A framework for writing Unstract Tools/Apps" groups = ["default"] @@ -3837,8 +3837,8 @@ dependencies = [ "transformers==4.37.0", ] files = [ - {file = "unstract_sdk-0.56.0rc3-py3-none-any.whl", hash = "sha256:abc8ee27b4eaa9694f272460b2696ed2798ff60b9b12539d327cdeaacbb02914"}, - {file = "unstract_sdk-0.56.0rc3.tar.gz", hash = "sha256:f09db70f91fe5405918a27b91b3807d812b223dae54b9ad1f688f02a88512bb1"}, + {file = "unstract_sdk-0.56.0rc4-py3-none-any.whl", hash = "sha256:e9128fc444b6d5fa5bc3dc9cd533113abb13bb4ff4ffd9195b18ca5e2450419c"}, + {file = "unstract_sdk-0.56.0rc4.tar.gz", hash = "sha256:ac5430ac48094aa15c45fb90f05c11c8d5a62d79c8cc8fd48a4639724588b897"}, ] [[package]] diff --git a/platform-service/pyproject.toml b/platform-service/pyproject.toml index b64804b1e..4884daee9 100644 --- a/platform-service/pyproject.toml +++ b/platform-service/pyproject.toml @@ -13,7 +13,7 @@ dependencies = [ "redis~=5.2.1", "cryptography>=41.0.7", "requests>=2.31.0", - "unstract-sdk~=0.56.0rc3", + "unstract-sdk~=0.56.0rc4", "gcsfs==2024.10.0", "unstract-flags @ file:///${PROJECT_ROOT}/../unstract/flags", ] diff --git a/prompt-service/pdm.lock b/prompt-service/pdm.lock index 13377409d..525ca2318 100644 --- a/prompt-service/pdm.lock +++ b/prompt-service/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "deploy"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.4.2" -content_hash = "sha256:9d7ce6b714514f621bd8bd3ac42172b526cd79cb67d77b10634f274e44575f84" +content_hash = "sha256:f0bc9f8759075827a9083394dff530f3733b42534be1d35d5685b299c58b0ab4" [[package]] name = "aiohappyeyeballs" @@ -228,13 +228,13 @@ files = [ [[package]] name = "attrs" -version = "24.3.0" +version = "25.1.0" requires_python = ">=3.8" summary = "Classes Without Boilerplate" groups = ["default"] files = [ - {file = "attrs-24.3.0-py3-none-any.whl", hash = "sha256:ac96cd038792094f438ad1f6ff80837353805ac950cd2aa0e0625ef19850c308"}, - {file = "attrs-24.3.0.tar.gz", hash = "sha256:8f5c07333d543103541ba7be0e2ce16eeee8130cb0b3f9238ab904ce1e85baff"}, + {file = "attrs-25.1.0-py3-none-any.whl", hash = "sha256:c75a69e28a550a7e93789579c22aa26b0f5b83b75dc4e08fe092980051e1090a"}, + {file = "attrs-25.1.0.tar.gz", hash = "sha256:1c97078a80c814273a76b2a298a932eb681c87415c11dee0a6921de7f1b02c3e"}, ] [[package]] @@ -547,7 +547,7 @@ files = [ [[package]] name = "deprecated" -version = "1.2.15" +version = "1.2.18" requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" summary = "Python @deprecated decorator to deprecate old python classes, functions or methods." groups = ["default"] @@ -555,8 +555,8 @@ dependencies = [ "wrapt<2,>=1.10", ] files = [ - {file = "Deprecated-1.2.15-py2.py3-none-any.whl", hash = "sha256:353bc4a8ac4bfc96800ddab349d89c25dec1079f65fd53acdcc1e0b975b21320"}, - {file = "deprecated-1.2.15.tar.gz", hash = "sha256:683e561a90de76239796e6b6feac66b99030d2dd3fcf61ef996330f14bbb9b0d"}, + {file = "Deprecated-1.2.18-py2.py3-none-any.whl", hash = "sha256:bd5011788200372a32418f888e326a09ff80d0214bd961147cfed01b5c018eec"}, + {file = "deprecated-1.2.18.tar.gz", hash = "sha256:422b6f6d859da6f2ef57857761bfb392480502a64c3028ca9bbe86085d72115d"}, ] [[package]] @@ -1591,7 +1591,7 @@ files = [ [[package]] name = "llama-index-core" -version = "0.12.13" +version = "0.12.14" requires_python = "<4.0,>=3.9" summary = "Interface between LLMs and your data" groups = ["default"] @@ -1621,8 +1621,8 @@ dependencies = [ "wrapt", ] files = [ - {file = "llama_index_core-0.12.13-py3-none-any.whl", hash = "sha256:9708bb594bbddffd6ff0767242e49d8978d1ba60a2e62e071d9d123ad2f17e6f"}, - {file = "llama_index_core-0.12.13.tar.gz", hash = "sha256:77af0161246ce1de38efc17cb6438dfff9e9558af00bcfac7dd4d0b7325efa4b"}, + {file = "llama_index_core-0.12.14-py3-none-any.whl", hash = "sha256:6fdb30e3fadf98e7df75f9db5d06f6a7f8503ca545a71e048d786ff88012bd50"}, + {file = "llama_index_core-0.12.14.tar.gz", hash = "sha256:378bbf5bf4d1a8c692d3a980c1a6ed3be7a9afb676a4960429dea15f62d06cd3"}, ] [[package]] @@ -2319,7 +2319,7 @@ files = [ [[package]] name = "openai" -version = "1.60.0" +version = "1.60.1" requires_python = ">=3.8" summary = "The official Python library for the openai API" groups = ["default"] @@ -2334,8 +2334,8 @@ dependencies = [ "typing-extensions<5,>=4.11", ] files = [ - {file = "openai-1.60.0-py3-none-any.whl", hash = "sha256:df06c43be8018274980ac363da07d4b417bd835ead1c66e14396f6f15a0d5dda"}, - {file = "openai-1.60.0.tar.gz", hash = "sha256:7fa536cd4b644718645b874d2706e36dbbef38b327e42ca0623275da347ee1a9"}, + {file = "openai-1.60.1-py3-none-any.whl", hash = "sha256:714181ec1c452353d456f143c22db892de7b373e3165063d02a2b798ed575ba1"}, + {file = "openai-1.60.1.tar.gz", hash = "sha256:beb1541dfc38b002bd629ab68b0d6fe35b870c5f4311d9bc4404d85af3214d5e"}, ] [[package]] @@ -2624,20 +2624,20 @@ files = [ [[package]] name = "protobuf" -version = "4.25.5" +version = "4.25.6" requires_python = ">=3.8" summary = "" groups = ["default"] files = [ - {file = "protobuf-4.25.5-cp310-abi3-win32.whl", hash = "sha256:5e61fd921603f58d2f5acb2806a929b4675f8874ff5f330b7d6f7e2e784bbcd8"}, - {file = "protobuf-4.25.5-cp310-abi3-win_amd64.whl", hash = "sha256:4be0571adcbe712b282a330c6e89eae24281344429ae95c6d85e79e84780f5ea"}, - {file = "protobuf-4.25.5-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:b2fde3d805354df675ea4c7c6338c1aecd254dfc9925e88c6d31a2bcb97eb173"}, - {file = "protobuf-4.25.5-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:919ad92d9b0310070f8356c24b855c98df2b8bd207ebc1c0c6fcc9ab1e007f3d"}, - {file = "protobuf-4.25.5-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:fe14e16c22be926d3abfcb500e60cab068baf10b542b8c858fa27e098123e331"}, - {file = "protobuf-4.25.5-cp39-cp39-win32.whl", hash = "sha256:abe32aad8561aa7cc94fc7ba4fdef646e576983edb94a73381b03c53728a626f"}, - {file = "protobuf-4.25.5-cp39-cp39-win_amd64.whl", hash = "sha256:7a183f592dc80aa7c8da7ad9e55091c4ffc9497b3054452d629bb85fa27c2a45"}, - {file = "protobuf-4.25.5-py3-none-any.whl", hash = "sha256:0aebecb809cae990f8129ada5ca273d9d670b76d9bfc9b1809f0a9c02b7dbf41"}, - {file = "protobuf-4.25.5.tar.gz", hash = "sha256:7f8249476b4a9473645db7f8ab42b02fe1488cbe5fb72fddd445e0665afd8584"}, + {file = "protobuf-4.25.6-cp310-abi3-win32.whl", hash = "sha256:61df6b5786e2b49fc0055f636c1e8f0aff263808bb724b95b164685ac1bcc13a"}, + {file = "protobuf-4.25.6-cp310-abi3-win_amd64.whl", hash = "sha256:b8f837bfb77513fe0e2f263250f423217a173b6d85135be4d81e96a4653bcd3c"}, + {file = "protobuf-4.25.6-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:6d4381f2417606d7e01750e2729fe6fbcda3f9883aa0c32b51d23012bded6c91"}, + {file = "protobuf-4.25.6-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:5dd800da412ba7f6f26d2c08868a5023ce624e1fdb28bccca2dc957191e81fb5"}, + {file = "protobuf-4.25.6-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:4434ff8bb5576f9e0c78f47c41cdf3a152c0b44de475784cd3fd170aef16205a"}, + {file = "protobuf-4.25.6-cp39-cp39-win32.whl", hash = "sha256:3f3b0b39db04b509859361ac9bca65a265fe9342e6b9406eda58029f5b1d10b2"}, + {file = "protobuf-4.25.6-cp39-cp39-win_amd64.whl", hash = "sha256:6ef2045f89d4ad8d95fd43cd84621487832a61d15b49500e4c1350e8a0ef96be"}, + {file = "protobuf-4.25.6-py3-none-any.whl", hash = "sha256:07972021c8e30b870cfc0863409d033af940213e0e7f64e27fe017b929d2c9f7"}, + {file = "protobuf-4.25.6.tar.gz", hash = "sha256:f8cfbae7c5afd0d0eaccbe73267339bff605a2315860bb1ba08eb66670a9a91f"}, ] [[package]] @@ -2870,7 +2870,7 @@ files = [ [[package]] name = "pypdf" -version = "5.1.0" +version = "5.2.0" requires_python = ">=3.8" summary = "A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files" groups = ["default"] @@ -2878,8 +2878,8 @@ dependencies = [ "typing-extensions>=4.0; python_version < \"3.11\"", ] files = [ - {file = "pypdf-5.1.0-py3-none-any.whl", hash = "sha256:3bd4f503f4ebc58bae40d81e81a9176c400cbbac2ba2d877367595fb524dfdfc"}, - {file = "pypdf-5.1.0.tar.gz", hash = "sha256:425a129abb1614183fd1aca6982f650b47f8026867c0ce7c4b9f281c443d2740"}, + {file = "pypdf-5.2.0-py3-none-any.whl", hash = "sha256:d107962ec45e65e3bd10c1d9242bdbbedaa38193c9e3a6617bd6d996e5747b19"}, + {file = "pypdf-5.2.0.tar.gz", hash = "sha256:7c38e68420f038f2c4998fd9d6717b6db4f6cef1642e9cf384d519c9cf094663"}, ] [[package]] @@ -3041,7 +3041,7 @@ files = [ [[package]] name = "referencing" -version = "0.36.1" +version = "0.36.2" requires_python = ">=3.9" summary = "JSON Referencing + Python" groups = ["default"] @@ -3051,8 +3051,8 @@ dependencies = [ "typing-extensions>=4.4.0; python_version < \"3.13\"", ] files = [ - {file = "referencing-0.36.1-py3-none-any.whl", hash = "sha256:363d9c65f080d0d70bc41c721dce3c7f3e77fc09f269cd5c8813da18069a6794"}, - {file = "referencing-0.36.1.tar.gz", hash = "sha256:ca2e6492769e3602957e9b831b94211599d2aade9477f5d44110d2530cf9aade"}, + {file = "referencing-0.36.2-py3-none-any.whl", hash = "sha256:e8699adbbf8b5c7de96d8ffa0eb5c158b3beafce084968e2ea8bb08c6794dcd0"}, + {file = "referencing-0.36.2.tar.gz", hash = "sha256:df2e89862cd09deabbdba16944cc3f10feb6b3e6f18e902f7cc25609a34775aa"}, ] [[package]] @@ -3710,7 +3710,7 @@ dependencies = [ [[package]] name = "unstract-sdk" -version = "0.56.0rc3" +version = "0.56.0rc4" requires_python = "<3.11.1,>=3.9" summary = "A framework for writing Unstract Tools/Apps" groups = ["default"] @@ -3749,8 +3749,8 @@ dependencies = [ "transformers==4.37.0", ] files = [ - {file = "unstract_sdk-0.56.0rc3-py3-none-any.whl", hash = "sha256:abc8ee27b4eaa9694f272460b2696ed2798ff60b9b12539d327cdeaacbb02914"}, - {file = "unstract_sdk-0.56.0rc3.tar.gz", hash = "sha256:f09db70f91fe5405918a27b91b3807d812b223dae54b9ad1f688f02a88512bb1"}, + {file = "unstract_sdk-0.56.0rc4-py3-none-any.whl", hash = "sha256:e9128fc444b6d5fa5bc3dc9cd533113abb13bb4ff4ffd9195b18ca5e2450419c"}, + {file = "unstract_sdk-0.56.0rc4.tar.gz", hash = "sha256:ac5430ac48094aa15c45fb90f05c11c8d5a62d79c8cc8fd48a4639724588b897"}, ] [[package]] diff --git a/prompt-service/pyproject.toml b/prompt-service/pyproject.toml index 54ae937da..253125eaa 100644 --- a/prompt-service/pyproject.toml +++ b/prompt-service/pyproject.toml @@ -15,7 +15,7 @@ dependencies = [ "flask~=3.0", "llama-index==0.12.8", "python-dotenv==1.0.0", - "unstract-sdk~=0.56.0rc3", + "unstract-sdk~=0.56.0rc4", "redis>=5.0.3", "unstract-core @ file:///${PROJECT_ROOT}/../unstract/core", "unstract-flags @ file:///${PROJECT_ROOT}/../unstract/flags", diff --git a/pyproject.toml b/pyproject.toml index a8417e9c1..37f1b4544 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ hook-check-django-migrations = [ "psycopg2-binary==2.9.9", "python-dotenv==1.0.0", "python-magic==0.4.27", - "unstract-sdk~=0.56.0rc3", + "unstract-sdk~=0.56.0rc4", "-e unstract-connectors @ file:///${PROJECT_ROOT}/unstract/connectors", "-e unstract-core @ file:///${PROJECT_ROOT}/unstract/core", "-e unstract-flags @ file:///${PROJECT_ROOT}/unstract/flags", diff --git a/tools/classifier/requirements.txt b/tools/classifier/requirements.txt index beac09d05..352bd4212 100644 --- a/tools/classifier/requirements.txt +++ b/tools/classifier/requirements.txt @@ -1,6 +1,6 @@ # Add your dependencies here # Required for all unstract tools -unstract-sdk~=0.56.0rc3 +unstract-sdk~=0.56.0rc4 # Required for remote storage support s3fs[boto3]==2024.6.0 diff --git a/tools/classifier/src/config/properties.json b/tools/classifier/src/config/properties.json index a6d737b87..c80d4c84b 100644 --- a/tools/classifier/src/config/properties.json +++ b/tools/classifier/src/config/properties.json @@ -2,7 +2,7 @@ "schemaVersion": "0.0.1", "displayName": "File Classifier", "functionName": "classify", - "toolVersion": "0.0.49", + "toolVersion": "0.0.50", "description": "Classifies a file into a bin based on its contents", "input": { "description": "File to be classified" diff --git a/tools/structure/requirements.txt b/tools/structure/requirements.txt index beac09d05..352bd4212 100644 --- a/tools/structure/requirements.txt +++ b/tools/structure/requirements.txt @@ -1,6 +1,6 @@ # Add your dependencies here # Required for all unstract tools -unstract-sdk~=0.56.0rc3 +unstract-sdk~=0.56.0rc4 # Required for remote storage support s3fs[boto3]==2024.6.0 diff --git a/tools/structure/src/config/properties.json b/tools/structure/src/config/properties.json index 50d41130b..c0e8ce2c6 100644 --- a/tools/structure/src/config/properties.json +++ b/tools/structure/src/config/properties.json @@ -2,7 +2,7 @@ "schemaVersion": "0.0.1", "displayName": "Structure Tool", "functionName": "structure_tool", - "toolVersion": "0.0.59", + "toolVersion": "0.0.60", "description": "This is a template tool which can answer set of input prompts designed in the Prompt Studio", "input": { "description": "File that needs to be indexed and parsed for answers" diff --git a/tools/text_extractor/requirements.txt b/tools/text_extractor/requirements.txt index beac09d05..352bd4212 100644 --- a/tools/text_extractor/requirements.txt +++ b/tools/text_extractor/requirements.txt @@ -1,6 +1,6 @@ # Add your dependencies here # Required for all unstract tools -unstract-sdk~=0.56.0rc3 +unstract-sdk~=0.56.0rc4 # Required for remote storage support s3fs[boto3]==2024.6.0 diff --git a/tools/text_extractor/src/config/properties.json b/tools/text_extractor/src/config/properties.json index 1c4a6b9c3..6e102c6c0 100644 --- a/tools/text_extractor/src/config/properties.json +++ b/tools/text_extractor/src/config/properties.json @@ -2,7 +2,7 @@ "schemaVersion": "0.0.1", "displayName": "Text Extractor", "functionName": "text_extractor", - "toolVersion": "0.0.46", + "toolVersion": "0.0.47", "description": "The Text Extractor is a powerful tool designed to convert documents to its text form or Extract texts from documents", "input": { "description": "Document" diff --git a/unstract/filesystem/pdm.lock b/unstract/filesystem/pdm.lock index fd28836ad..fb734f7ac 100644 --- a/unstract/filesystem/pdm.lock +++ b/unstract/filesystem/pdm.lock @@ -5,7 +5,7 @@ groups = ["default"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.4.2" -content_hash = "sha256:0feefc31b976567b21f22a884beec5e403b86fc5dda1eb7be2ad6e8c8be76205" +content_hash = "sha256:8ee9130ddcfdcf15a71d0f27371cbd6af5a1823cc2db739fc90d744438f6dff8" [[package]] name = "aiohappyeyeballs" @@ -214,13 +214,13 @@ files = [ [[package]] name = "attrs" -version = "24.3.0" +version = "25.1.0" requires_python = ">=3.8" summary = "Classes Without Boilerplate" groups = ["default"] files = [ - {file = "attrs-24.3.0-py3-none-any.whl", hash = "sha256:ac96cd038792094f438ad1f6ff80837353805ac950cd2aa0e0625ef19850c308"}, - {file = "attrs-24.3.0.tar.gz", hash = "sha256:8f5c07333d543103541ba7be0e2ce16eeee8130cb0b3f9238ab904ce1e85baff"}, + {file = "attrs-25.1.0-py3-none-any.whl", hash = "sha256:c75a69e28a550a7e93789579c22aa26b0f5b83b75dc4e08fe092980051e1090a"}, + {file = "attrs-25.1.0.tar.gz", hash = "sha256:1c97078a80c814273a76b2a298a932eb681c87415c11dee0a6921de7f1b02c3e"}, ] [[package]] @@ -287,23 +287,23 @@ files = [ [[package]] name = "boto3" -version = "1.36.5" +version = "1.36.6" requires_python = ">=3.8" summary = "The AWS SDK for Python" groups = ["default"] dependencies = [ - "botocore<1.37.0,>=1.36.5", + "botocore<1.37.0,>=1.36.6", "jmespath<2.0.0,>=0.7.1", "s3transfer<0.12.0,>=0.11.0", ] files = [ - {file = "boto3-1.36.5-py3-none-any.whl", hash = "sha256:a404ad5ec94ff40c176215a991bf62f0db5514a93a3dd361b7b2ab9660f811f4"}, - {file = "boto3-1.36.5.tar.gz", hash = "sha256:58a6b7c3d5145b3ac04d4b6caa76223b8ef88004b4237444e553041e29581a11"}, + {file = "boto3-1.36.6-py3-none-any.whl", hash = "sha256:6d473f0f340d02b4e9ad5b8e68786a09728101a8b950231b89ebdaf72b6dca21"}, + {file = "boto3-1.36.6.tar.gz", hash = "sha256:b36feae061dc0793cf311468956a0a9e99215ce38bc99a1a4e55a5b105f16297"}, ] [[package]] name = "botocore" -version = "1.36.5" +version = "1.36.6" requires_python = ">=3.8" summary = "Low-level, data-driven core of boto 3." groups = ["default"] @@ -314,8 +314,8 @@ dependencies = [ "urllib3<1.27,>=1.25.4; python_version < \"3.10\"", ] files = [ - {file = "botocore-1.36.5-py3-none-any.whl", hash = "sha256:6d9f70afa9bf9d21407089dc22b8cc8ec6fa44866d4660858c062c74fc8555eb"}, - {file = "botocore-1.36.5.tar.gz", hash = "sha256:234ed3d29a8954c37a551c933453bf14c6ae44a69a4f273ffef377a2612ca6a6"}, + {file = "botocore-1.36.6-py3-none-any.whl", hash = "sha256:f77bbbb03fb420e260174650fb5c0cc142ec20a96967734eed2b0ef24334ef34"}, + {file = "botocore-1.36.6.tar.gz", hash = "sha256:4864c53d638da191a34daf3ede3ff1371a3719d952cc0c6bd24ce2836a38dd77"}, ] [[package]] @@ -522,7 +522,7 @@ files = [ [[package]] name = "deprecated" -version = "1.2.15" +version = "1.2.18" requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" summary = "Python @deprecated decorator to deprecate old python classes, functions or methods." groups = ["default"] @@ -530,8 +530,8 @@ dependencies = [ "wrapt<2,>=1.10", ] files = [ - {file = "Deprecated-1.2.15-py2.py3-none-any.whl", hash = "sha256:353bc4a8ac4bfc96800ddab349d89c25dec1079f65fd53acdcc1e0b975b21320"}, - {file = "deprecated-1.2.15.tar.gz", hash = "sha256:683e561a90de76239796e6b6feac66b99030d2dd3fcf61ef996330f14bbb9b0d"}, + {file = "Deprecated-1.2.18-py2.py3-none-any.whl", hash = "sha256:bd5011788200372a32418f888e326a09ff80d0214bd961147cfed01b5c018eec"}, + {file = "deprecated-1.2.18.tar.gz", hash = "sha256:422b6f6d859da6f2ef57857761bfb392480502a64c3028ca9bbe86085d72115d"}, ] [[package]] @@ -1474,7 +1474,7 @@ files = [ [[package]] name = "llama-index-core" -version = "0.12.13" +version = "0.12.14" requires_python = "<4.0,>=3.9" summary = "Interface between LLMs and your data" groups = ["default"] @@ -1504,8 +1504,8 @@ dependencies = [ "wrapt", ] files = [ - {file = "llama_index_core-0.12.13-py3-none-any.whl", hash = "sha256:9708bb594bbddffd6ff0767242e49d8978d1ba60a2e62e071d9d123ad2f17e6f"}, - {file = "llama_index_core-0.12.13.tar.gz", hash = "sha256:77af0161246ce1de38efc17cb6438dfff9e9558af00bcfac7dd4d0b7325efa4b"}, + {file = "llama_index_core-0.12.14-py3-none-any.whl", hash = "sha256:6fdb30e3fadf98e7df75f9db5d06f6a7f8503ca545a71e048d786ff88012bd50"}, + {file = "llama_index_core-0.12.14.tar.gz", hash = "sha256:378bbf5bf4d1a8c692d3a980c1a6ed3be7a9afb676a4960429dea15f62d06cd3"}, ] [[package]] @@ -2162,7 +2162,7 @@ files = [ [[package]] name = "openai" -version = "1.60.0" +version = "1.60.1" requires_python = ">=3.8" summary = "The official Python library for the openai API" groups = ["default"] @@ -2177,8 +2177,8 @@ dependencies = [ "typing-extensions<5,>=4.11", ] files = [ - {file = "openai-1.60.0-py3-none-any.whl", hash = "sha256:df06c43be8018274980ac363da07d4b417bd835ead1c66e14396f6f15a0d5dda"}, - {file = "openai-1.60.0.tar.gz", hash = "sha256:7fa536cd4b644718645b874d2706e36dbbef38b327e42ca0623275da347ee1a9"}, + {file = "openai-1.60.1-py3-none-any.whl", hash = "sha256:714181ec1c452353d456f143c22db892de7b373e3165063d02a2b798ed575ba1"}, + {file = "openai-1.60.1.tar.gz", hash = "sha256:beb1541dfc38b002bd629ab68b0d6fe35b870c5f4311d9bc4404d85af3214d5e"}, ] [[package]] @@ -2458,20 +2458,20 @@ files = [ [[package]] name = "protobuf" -version = "4.25.5" +version = "4.25.6" requires_python = ">=3.8" summary = "" groups = ["default"] files = [ - {file = "protobuf-4.25.5-cp310-abi3-win32.whl", hash = "sha256:5e61fd921603f58d2f5acb2806a929b4675f8874ff5f330b7d6f7e2e784bbcd8"}, - {file = "protobuf-4.25.5-cp310-abi3-win_amd64.whl", hash = "sha256:4be0571adcbe712b282a330c6e89eae24281344429ae95c6d85e79e84780f5ea"}, - {file = "protobuf-4.25.5-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:b2fde3d805354df675ea4c7c6338c1aecd254dfc9925e88c6d31a2bcb97eb173"}, - {file = "protobuf-4.25.5-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:919ad92d9b0310070f8356c24b855c98df2b8bd207ebc1c0c6fcc9ab1e007f3d"}, - {file = "protobuf-4.25.5-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:fe14e16c22be926d3abfcb500e60cab068baf10b542b8c858fa27e098123e331"}, - {file = "protobuf-4.25.5-cp39-cp39-win32.whl", hash = "sha256:abe32aad8561aa7cc94fc7ba4fdef646e576983edb94a73381b03c53728a626f"}, - {file = "protobuf-4.25.5-cp39-cp39-win_amd64.whl", hash = "sha256:7a183f592dc80aa7c8da7ad9e55091c4ffc9497b3054452d629bb85fa27c2a45"}, - {file = "protobuf-4.25.5-py3-none-any.whl", hash = "sha256:0aebecb809cae990f8129ada5ca273d9d670b76d9bfc9b1809f0a9c02b7dbf41"}, - {file = "protobuf-4.25.5.tar.gz", hash = "sha256:7f8249476b4a9473645db7f8ab42b02fe1488cbe5fb72fddd445e0665afd8584"}, + {file = "protobuf-4.25.6-cp310-abi3-win32.whl", hash = "sha256:61df6b5786e2b49fc0055f636c1e8f0aff263808bb724b95b164685ac1bcc13a"}, + {file = "protobuf-4.25.6-cp310-abi3-win_amd64.whl", hash = "sha256:b8f837bfb77513fe0e2f263250f423217a173b6d85135be4d81e96a4653bcd3c"}, + {file = "protobuf-4.25.6-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:6d4381f2417606d7e01750e2729fe6fbcda3f9883aa0c32b51d23012bded6c91"}, + {file = "protobuf-4.25.6-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:5dd800da412ba7f6f26d2c08868a5023ce624e1fdb28bccca2dc957191e81fb5"}, + {file = "protobuf-4.25.6-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:4434ff8bb5576f9e0c78f47c41cdf3a152c0b44de475784cd3fd170aef16205a"}, + {file = "protobuf-4.25.6-cp39-cp39-win32.whl", hash = "sha256:3f3b0b39db04b509859361ac9bca65a265fe9342e6b9406eda58029f5b1d10b2"}, + {file = "protobuf-4.25.6-cp39-cp39-win_amd64.whl", hash = "sha256:6ef2045f89d4ad8d95fd43cd84621487832a61d15b49500e4c1350e8a0ef96be"}, + {file = "protobuf-4.25.6-py3-none-any.whl", hash = "sha256:07972021c8e30b870cfc0863409d033af940213e0e7f64e27fe017b929d2c9f7"}, + {file = "protobuf-4.25.6.tar.gz", hash = "sha256:f8cfbae7c5afd0d0eaccbe73267339bff605a2315860bb1ba08eb66670a9a91f"}, ] [[package]] @@ -2704,7 +2704,7 @@ files = [ [[package]] name = "pypdf" -version = "5.1.0" +version = "5.2.0" requires_python = ">=3.8" summary = "A pure-python PDF library capable of splitting, merging, cropping, and transforming PDF files" groups = ["default"] @@ -2712,8 +2712,8 @@ dependencies = [ "typing-extensions>=4.0; python_version < \"3.11\"", ] files = [ - {file = "pypdf-5.1.0-py3-none-any.whl", hash = "sha256:3bd4f503f4ebc58bae40d81e81a9176c400cbbac2ba2d877367595fb524dfdfc"}, - {file = "pypdf-5.1.0.tar.gz", hash = "sha256:425a129abb1614183fd1aca6982f650b47f8026867c0ce7c4b9f281c443d2740"}, + {file = "pypdf-5.2.0-py3-none-any.whl", hash = "sha256:d107962ec45e65e3bd10c1d9242bdbbedaa38193c9e3a6617bd6d996e5747b19"}, + {file = "pypdf-5.2.0.tar.gz", hash = "sha256:7c38e68420f038f2c4998fd9d6717b6db4f6cef1642e9cf384d519c9cf094663"}, ] [[package]] @@ -2875,7 +2875,7 @@ files = [ [[package]] name = "referencing" -version = "0.36.1" +version = "0.36.2" requires_python = ">=3.9" summary = "JSON Referencing + Python" groups = ["default"] @@ -2885,8 +2885,8 @@ dependencies = [ "typing-extensions>=4.4.0; python_version < \"3.13\"", ] files = [ - {file = "referencing-0.36.1-py3-none-any.whl", hash = "sha256:363d9c65f080d0d70bc41c721dce3c7f3e77fc09f269cd5c8813da18069a6794"}, - {file = "referencing-0.36.1.tar.gz", hash = "sha256:ca2e6492769e3602957e9b831b94211599d2aade9477f5d44110d2530cf9aade"}, + {file = "referencing-0.36.2-py3-none-any.whl", hash = "sha256:e8699adbbf8b5c7de96d8ffa0eb5c158b3beafce084968e2ea8bb08c6794dcd0"}, + {file = "referencing-0.36.2.tar.gz", hash = "sha256:df2e89862cd09deabbdba16944cc3f10feb6b3e6f18e902f7cc25609a34775aa"}, ] [[package]] @@ -3515,7 +3515,7 @@ files = [ [[package]] name = "unstract-sdk" -version = "0.56.0rc3" +version = "0.56.0rc4" requires_python = "<3.11.1,>=3.9" summary = "A framework for writing Unstract Tools/Apps" groups = ["default"] @@ -3554,8 +3554,8 @@ dependencies = [ "transformers==4.37.0", ] files = [ - {file = "unstract_sdk-0.56.0rc3-py3-none-any.whl", hash = "sha256:abc8ee27b4eaa9694f272460b2696ed2798ff60b9b12539d327cdeaacbb02914"}, - {file = "unstract_sdk-0.56.0rc3.tar.gz", hash = "sha256:f09db70f91fe5405918a27b91b3807d812b223dae54b9ad1f688f02a88512bb1"}, + {file = "unstract_sdk-0.56.0rc4-py3-none-any.whl", hash = "sha256:e9128fc444b6d5fa5bc3dc9cd533113abb13bb4ff4ffd9195b18ca5e2450419c"}, + {file = "unstract_sdk-0.56.0rc4.tar.gz", hash = "sha256:ac5430ac48094aa15c45fb90f05c11c8d5a62d79c8cc8fd48a4639724588b897"}, ] [[package]] diff --git a/unstract/filesystem/pyproject.toml b/unstract/filesystem/pyproject.toml index 8cb87aa01..a30cf45b9 100644 --- a/unstract/filesystem/pyproject.toml +++ b/unstract/filesystem/pyproject.toml @@ -10,7 +10,7 @@ authors = [ {name = "Zipstack Inc.", email = "devsupport@zipstack.com"}, ] dependencies = [ - "unstract-sdk~=0.56.0rc3", + "unstract-sdk~=0.56.0rc4", ] requires-python = ">=3.9,<3.11.1" readme = "README.md" diff --git a/unstract/tool-registry/pyproject.toml b/unstract/tool-registry/pyproject.toml index de9edf549..813e1ef93 100644 --- a/unstract/tool-registry/pyproject.toml +++ b/unstract/tool-registry/pyproject.toml @@ -13,7 +13,7 @@ dependencies = [ "docker~=6.1.3", "jsonschema~=4.18.2", "PyYAML~=6.0.1", - "unstract-sdk~=0.56.0rc3", + "unstract-sdk~=0.56.0rc4", # ! IMPORTANT! # Local dependencies usually need to be added as: # https://pdm-project.org/latest/usage/dependency/#local-dependencies diff --git a/unstract/tool-registry/tool_registry_config/public_tools.json b/unstract/tool-registry/tool_registry_config/public_tools.json index 29c00087b..1bd11ee4a 100644 --- a/unstract/tool-registry/tool_registry_config/public_tools.json +++ b/unstract/tool-registry/tool_registry_config/public_tools.json @@ -5,7 +5,7 @@ "schemaVersion": "0.0.1", "displayName": "File Classifier", "functionName": "classify", - "toolVersion": "0.0.49", + "toolVersion": "0.0.50", "description": "Classifies a file into a bin based on its contents", "input": { "description": "File to be classified" @@ -106,9 +106,9 @@ "properties": {} }, "icon": "\n\n \n \n \n \n \n \n \n \n \n \n \n\n", - "image_url": "docker:unstract/tool-classifier:0.0.49", + "image_url": "docker:unstract/tool-classifier:0.0.50", "image_name": "unstract/tool-classifier", - "image_tag": "0.0.49" + "image_tag": "0.0.50" }, "text_extractor": { "tool_uid": "text_extractor", @@ -116,7 +116,7 @@ "schemaVersion": "0.0.1", "displayName": "Text Extractor", "functionName": "text_extractor", - "toolVersion": "0.0.46", + "toolVersion": "0.0.47", "description": "The Text Extractor is a powerful tool designed to convert documents to its text form or Extract texts from documents", "input": { "description": "Document" @@ -191,8 +191,8 @@ } }, "icon": "\n\n \n \n \n \n \n \n \n \n \n \n \n\n", - "image_url": "docker:unstract/tool-text-extractor:0.0.46", + "image_url": "docker:unstract/tool-text-extractor:0.0.47", "image_name": "unstract/tool-text-extractor", - "image_tag": "0.0.46" + "image_tag": "0.0.47" } } From d5a342d6e54c73417d625a18e9402afbe5282193 Mon Sep 17 00:00:00 2001 From: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com> Date: Tue, 28 Jan 2025 10:34:33 +0530 Subject: [PATCH 03/15] feat: API changes for listing logs with file / level based filter support (#1083) * v2 API for listing logs with file / level based filter support * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Commented code removed * Minor pre-commit fix and markdown text changes * refactor: Removed v2 API support for execution logs, using filters instead * Fixed org middleware behaviour for whitelisted paths --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Rahul Johny <116638720+johnyrahul@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- backend/backend/public_urls_v2.py | 3 --- backend/backend/settings/base.py | 7 ++++++- backend/file_management/constants.py | 6 ------ backend/middleware/organization_middleware.py | 7 +++---- .../workflow_manager/endpoint_v2/source.py | 7 ++++--- backend/workflow_manager/urls.py | 2 +- .../workflow_v2/execution_log_view.py | 21 +++++++++++++++---- .../workflow_v2/urls/__init__.py | 0 .../workflow_v2/{urls.py => urls/workflow.py} | 0 10 files changed, 32 insertions(+), 23 deletions(-) create mode 100644 backend/workflow_manager/workflow_v2/urls/__init__.py rename backend/workflow_manager/workflow_v2/{urls.py => urls/workflow.py} (100%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7792b3e33..6e80808bc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -80,7 +80,7 @@ repos: --settings-path=pyproject.toml, ] - repo: https://github.com/hadialqattan/pycln - rev: v2.4.0 + rev: v2.5.0 hooks: - id: pycln args: [--config=pyproject.toml] diff --git a/backend/backend/public_urls_v2.py b/backend/backend/public_urls_v2.py index 366fc695f..bc1eca2ac 100644 --- a/backend/backend/public_urls_v2.py +++ b/backend/backend/public_urls_v2.py @@ -20,9 +20,6 @@ from django.conf.urls.static import static from django.urls import include, path -path_prefix = settings.PATH_PREFIX -api_path_prefix = settings.API_DEPLOYMENT_PATH_PREFIX - urlpatterns = [ path("", include("account_v2.urls")), # Connector OAuth diff --git a/backend/backend/settings/base.py b/backend/backend/settings/base.py index c49673d06..104ffc9f6 100644 --- a/backend/backend/settings/base.py +++ b/backend/backend/settings/base.py @@ -323,7 +323,7 @@ def get_required_setting( "middleware.cache_control.CacheControlMiddleware", ] -TENANT_SUBFOLDER_PREFIX = f"/{PATH_PREFIX}/unstract" +TENANT_SUBFOLDER_PREFIX = f"{PATH_PREFIX}/unstract" SHOW_PUBLIC_IF_NO_TENANT_FOUND = True TEMPLATES = [ @@ -435,6 +435,11 @@ def get_required_setting( "django_filters.rest_framework.DjangoFilterBackend", "rest_framework.filters.OrderingFilter", ], + # For API versioning + "DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.URLPathVersioning", + "DEFAULT_VERSION": "v1", + "ALLOWED_VERSIONS": ["v1"], + "VERSION_PARAM": "version", } # These paths will work without authentication diff --git a/backend/file_management/constants.py b/backend/file_management/constants.py index a17b60b4c..b348066ad 100644 --- a/backend/file_management/constants.py +++ b/backend/file_management/constants.py @@ -6,9 +6,3 @@ class FileInformationKey: FILE_UPLOAD_MAX_SIZE = 100 * 1024 * 1024 FILE_UPLOAD_ALLOWED_EXT = ["pdf"] FILE_UPLOAD_ALLOWED_MIME = ["application/pdf"] - - -class FileViewTypes: - ORIGINAL = "ORIGINAL" - EXTRACT = "EXTRACT" - SUMMARIZE = "SUMMARIZE" diff --git a/backend/middleware/organization_middleware.py b/backend/middleware/organization_middleware.py index 848dd2c2c..5b0ffa605 100644 --- a/backend/middleware/organization_middleware.py +++ b/backend/middleware/organization_middleware.py @@ -6,8 +6,7 @@ class OrganizationMiddleware(MiddlewareMixin): def process_request(self, request): - tenant_prefix = settings.TENANT_SUBFOLDER_PREFIX.rstrip("/") + "/" - pattern = rf"^{tenant_prefix}(?P[^/]+)/" + pattern = r"^/api/(?Pv[12])/unstract/(?P[^/]+)/" # Check if the URL matches the pattern with organization ID match = re.match(pattern, request.path) @@ -17,12 +16,12 @@ def process_request(self, request): re.match(path, request.path) for path in settings.ORGANIZATION_MIDDLEWARE_WHITELISTED_PATHS ): - request.path_info = "/" + request.path_info return org_id = match.group("org_id") + version = match.group("version") request.organization_id = org_id - new_path = re.sub(pattern, "/" + tenant_prefix, request.path_info) + new_path = re.sub(pattern, f"/api/{version}/unstract/", request.path_info) request.path_info = new_path else: request.organization_id = None diff --git a/backend/workflow_manager/endpoint_v2/source.py b/backend/workflow_manager/endpoint_v2/source.py index 194b321ce..633d4db6e 100644 --- a/backend/workflow_manager/endpoint_v2/source.py +++ b/backend/workflow_manager/endpoint_v2/source.py @@ -244,7 +244,7 @@ def publish_input_output_list_file_logs( return None folders_list = "\n".join(f"- `{folder.strip()}`" for folder in folders) - input_log = f"##Folders to process:\n\n{folders_list}\n\n" + input_log = f"## Folders to process:\n\n{folders_list}\n\n" self.execution_service.publish_update_log( state=LogState.INPUT_UPDATE, message=input_log ) @@ -256,9 +256,10 @@ def publish_input_output_list_file_logs( def publish_input_file_content(self, input_file_path: str, input_text: str) -> None: if not self.execution_service: return None - output_log_message = f"##Input text:\n\n```text\n{input_text}\n```\n\n" + output_log_message = f"## Input text:\n\n```text\n{input_text}\n```\n\n" input_log_message = ( - "##Input file:\n\n```text\n" f"{os.path.basename(input_file_path)}\n```\n\n" + "## Input file:\n\n```text\n" + f"{os.path.basename(input_file_path)}\n```\n\n" ) self.execution_service.publish_update_log( state=LogState.INPUT_UPDATE, message=input_log_message diff --git a/backend/workflow_manager/urls.py b/backend/workflow_manager/urls.py index 42c972973..43ee3ccb2 100644 --- a/backend/workflow_manager/urls.py +++ b/backend/workflow_manager/urls.py @@ -1,6 +1,6 @@ from django.urls import include, path from workflow_manager.endpoint_v2 import urls as endpoint_urls -from workflow_manager.workflow_v2 import urls as workflow_urls +from workflow_manager.workflow_v2.urls import workflow as workflow_urls urlpatterns = [ path("endpoint/", include(endpoint_urls)), diff --git a/backend/workflow_manager/workflow_v2/execution_log_view.py b/backend/workflow_manager/workflow_v2/execution_log_view.py index 96f557b77..711789e8f 100644 --- a/backend/workflow_manager/workflow_v2/execution_log_view.py +++ b/backend/workflow_manager/workflow_v2/execution_log_view.py @@ -1,5 +1,6 @@ import logging +from django.db.models.query import QuerySet from permissions.permission import IsOwner from rest_framework import viewsets from rest_framework.versioning import URLPathVersioning @@ -16,12 +17,24 @@ class WorkflowExecutionLogViewSet(viewsets.ModelViewSet): serializer_class = WorkflowExecutionLogSerializer pagination_class = CustomPagination - EVENT_TIME_FELID_ASC = "event_time" + EVENT_TIME_FIELD_ASC = "event_time" - def get_queryset(self): + def get_queryset(self) -> QuerySet: # Get the execution_id:pk from the URL path execution_id = self.kwargs.get("pk") - queryset = ExecutionLog.objects.filter(execution_id=execution_id).order_by( - self.EVENT_TIME_FELID_ASC + filter_param = {"execution_id": execution_id} + + file_execution_id = self.request.query_params.get("file_execution_id") + if file_execution_id and file_execution_id == "null": + filter_param["file_execution_id"] = None + elif file_execution_id: + filter_param["file_execution_id"] = file_execution_id + + log_level = self.request.query_params.get("log_level") + if log_level: + filter_param["data__level"] = log_level.upper() + + queryset = ExecutionLog.objects.filter(**filter_param).order_by( + self.EVENT_TIME_FIELD_ASC ) return queryset diff --git a/backend/workflow_manager/workflow_v2/urls/__init__.py b/backend/workflow_manager/workflow_v2/urls/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/backend/workflow_manager/workflow_v2/urls.py b/backend/workflow_manager/workflow_v2/urls/workflow.py similarity index 100% rename from backend/workflow_manager/workflow_v2/urls.py rename to backend/workflow_manager/workflow_v2/urls/workflow.py From df47b4ab79ce4916ad43ef412e43f300b027e4e4 Mon Sep 17 00:00:00 2001 From: ali <117142933+muhammad-ali-e@users.noreply.github.com> Date: Tue, 28 Jan 2025 10:51:11 +0530 Subject: [PATCH 04/15] fix for duplicate container while retrying executions (#1096) Co-authored-by: Rahul Johny <116638720+johnyrahul@users.noreply.github.com> --- unstract/core/src/unstract/core/utilities.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unstract/core/src/unstract/core/utilities.py b/unstract/core/src/unstract/core/utilities.py index 89213e49f..34d5c1729 100644 --- a/unstract/core/src/unstract/core/utilities.py +++ b/unstract/core/src/unstract/core/utilities.py @@ -1,5 +1,6 @@ import logging import os +import uuid from typing import Optional logger = logging.getLogger() @@ -31,7 +32,10 @@ def get_env(env_key: str, default: Optional[str] = None, raise_err=False) -> str def build_tool_container_name( tool_image: str, tool_version: str, run_id: str ) -> str: - container_name = f"{tool_image.split('/')[-1]}-{tool_version}-{run_id}" + tool_name = tool_image.split("/")[-1] + # TODO: Add execution attempt to better track instead of uuid + short_uuid = uuid.uuid4().hex[:6] # To avoid duplicate name collision + container_name = f"{tool_name}-{tool_version}-{short_uuid}-{run_id}" # To support limits of container clients like K8s if len(container_name) > 63: From 28250629742683311f3d33822ce825ccc5c9eb80 Mon Sep 17 00:00:00 2001 From: Praveen Kumar Date: Tue, 28 Jan 2025 12:26:23 +0530 Subject: [PATCH 05/15] Fixed invalid api key format raising 500 (#1079) * Fixed invalid api key format raising 500 * Modified the validate_api_key method to capture validation error and raise a UnauthorizedKey() error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Gayathri <142381512+gaya3-zipstack@users.noreply.github.com> --- backend/api_v2/key_helper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/api_v2/key_helper.py b/backend/api_v2/key_helper.py index 2ff10654c..22421ff86 100644 --- a/backend/api_v2/key_helper.py +++ b/backend/api_v2/key_helper.py @@ -4,6 +4,7 @@ from api_v2.exceptions import UnauthorizedKey from api_v2.models import APIDeployment, APIKey from api_v2.serializers import APIKeySerializer +from django.core.exceptions import ValidationError from pipeline_v2.models import Pipeline from rest_framework.request import Request from workflow_manager.workflow_v2.workflow_helper import WorkflowHelper @@ -29,7 +30,7 @@ def validate_api_key( api_key_instance: APIKey = APIKey.objects.get(api_key=api_key) if not KeyHelper.has_access(api_key_instance, instance): raise UnauthorizedKey() - except APIKey.DoesNotExist: + except (APIKey.DoesNotExist, ValidationError): raise UnauthorizedKey() @staticmethod From 9719818bfdf293b291caff3fb44138002bbfb314 Mon Sep 17 00:00:00 2001 From: Tahier Hussain <89440263+tahierhussain@users.noreply.github.com> Date: Tue, 28 Jan 2025 16:37:16 +0530 Subject: [PATCH 06/15] FIX: Improvements in the Unstract Subscription Plugins Integration (#1098) * Fixed related to unstract subscription plugins * Restrict routing from top navbar if case if subscription expired * Modified the to keep the time as optional in the response * Fixed the bugs in disabling the navigation menu items * Fixed sonar cloud issues * Reverted back the approach to call the global store conditionally, as it is intentional * Fix sonar cloud issues * Minor fix * Removed useEffect * Minor fix --- .../navigations/side-nav-bar/SideNavBar.jsx | 136 +++++++++++------- .../navigations/top-nav-bar/TopNavBar.jsx | 38 +++++ frontend/src/helpers/GetStaticData.js | 25 ++-- frontend/src/routes/useMainAppRoutes.js | 5 +- 4 files changed, 145 insertions(+), 59 deletions(-) diff --git a/frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx b/frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx index 2d58d5cd8..57d0820bd 100644 --- a/frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx +++ b/frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx @@ -16,6 +16,7 @@ import task from "../../../assets/task.svg"; import VectorDbIcon from "../../../assets/vector-db.svg"; import TextExtractorIcon from "../../../assets/text-extractor.svg"; import { useSessionStore } from "../../../store/session-store"; +import { useMemo } from "react"; let getMenuItem; try { @@ -31,10 +32,16 @@ try { // Plugin unavailable. } +let unstractSubscriptionPlan; +let unstractSubscriptionPlanStore; let dashboardSideMenuItem; +let UNSTRACT_SUBSCRIPTION_PLANS; try { - dashboardSideMenuItem = - require("../../../plugins/unstract-subscription/helper/constants").dashboardSideMenuItem; + unstractSubscriptionPlanStore = require("../../../plugins/store/unstract-subscription-plan-store"); + const unstractSubscriptionConstants = require("../../../plugins/unstract-subscription/helper/constants"); + dashboardSideMenuItem = unstractSubscriptionConstants?.dashboardSideMenuItem; + UNSTRACT_SUBSCRIPTION_PLANS = + unstractSubscriptionConstants?.UNSTRACT_SUBSCRIPTION_PLANS; } catch (err) { // Plugin unavailable. } @@ -43,6 +50,18 @@ const SideNavBar = ({ collapsed }) => { const navigate = useNavigate(); const { sessionDetails } = useSessionStore(); const { orgName, flags } = sessionDetails; + + try { + if (unstractSubscriptionPlanStore?.useUnstractSubscriptionPlanStore) { + unstractSubscriptionPlan = + unstractSubscriptionPlanStore?.useUnstractSubscriptionPlanStore( + (state) => state?.unstractSubscriptionPlan + ); + } + } catch (error) { + // Do nothing + } + let menu; if (sideMenu) { menu = sideMenu.useSideMenu(); @@ -170,7 +189,26 @@ const SideNavBar = ({ collapsed }) => { const data = menu || unstractMenuItems; if (getMenuItem && flags?.app_deployment) { - data[0]?.subMenu?.splice(1, 0, getMenuItem?.default(orgName)); + data[0]?.subMenu?.splice(1, 0, getMenuItem.default(orgName)); + } + + const shouldDisableAll = useMemo(() => { + if (!unstractSubscriptionPlan || !UNSTRACT_SUBSCRIPTION_PLANS) { + return false; + } + + return ( + !unstractSubscriptionPlan?.subscriptionId && + unstractSubscriptionPlan?.planType !== UNSTRACT_SUBSCRIPTION_PLANS?.TRIAL + ); + }, [unstractSubscriptionPlan]); + + if (shouldDisableAll) { + data.forEach((mainMenuItem) => { + mainMenuItem.subMenu.forEach((subMenuItem) => { + subMenuItem.disable = true; + }); + }); } return ( @@ -184,53 +222,51 @@ const SideNavBar = ({ collapsed }) => { >
- {data?.map((item, index) => { - return ( -
- {!collapsed && ( - - {item.mainTitle} - - )} - - {item.subMenu.map((el) => { - return ( - - { - !el.disable && navigate(el.path); - }} - > - side_icon - {!collapsed && ( -
- - {el.title} - - - {el.description} - -
- )} -
-
- ); - })} -
- {index < data.length - 1 && ( - - )} -
- ); - })} + {data?.map((item, index) => ( +
+ {!collapsed && ( + + {item.mainTitle} + + )} + + {item.subMenu.map((el) => ( + + { + if (!el.disable) { + navigate(el.path); + } + }} + > + side_icon + {!collapsed && ( +
+ + {el.title} + + + {el.description} + +
+ )} +
+
+ ))} +
+ {index < data.length - 1 && ( + + )} +
+ ))}
diff --git a/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx b/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx index 2dd2d23ed..7cf512ad4 100644 --- a/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx +++ b/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx @@ -68,6 +68,17 @@ try { // Ignore if hook not available } +let unstractSubscriptionPlan; +let unstractSubscriptionPlanStore; +let UNSTRACT_SUBSCRIPTION_PLANS; +try { + unstractSubscriptionPlanStore = require("../../../plugins/store/unstract-subscription-plan-store"); + UNSTRACT_SUBSCRIPTION_PLANS = + require("../../../plugins/unstract-subscription/helper/constants").UNSTRACT_SUBSCRIPTION_PLANS; +} catch (err) { + // Plugin unavailable. +} + function TopNavBar({ isSimpleLayout, topNavBarOptions }) { const navigate = useNavigate(); const { sessionDetails } = useSessionStore(); @@ -89,6 +100,28 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) { ); } + try { + if (unstractSubscriptionPlanStore?.useUnstractSubscriptionPlanStore) { + unstractSubscriptionPlan = + unstractSubscriptionPlanStore?.useUnstractSubscriptionPlanStore( + (state) => state?.unstractSubscriptionPlan + ); + } + } catch (error) { + // Do nothing + } + + const shouldDisableRouting = useMemo(() => { + if (!unstractSubscriptionPlan || !UNSTRACT_SUBSCRIPTION_PLANS) { + return false; + } + + return ( + !unstractSubscriptionPlan?.subscriptionId && + unstractSubscriptionPlan?.planType !== UNSTRACT_SUBSCRIPTION_PLANS?.TRIAL + ); + }, [unstractSubscriptionPlan]); + const isUnstract = !(selectedProduct && selectedProduct !== "unstract"); // Check user role and whether the onboarding is incomplete @@ -185,6 +218,7 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) { @@ -223,6 +257,7 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) { @@ -238,6 +273,7 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) { @@ -250,6 +286,7 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) { @@ -277,6 +314,7 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) { cascadeOptions, orgName, orgId, + shouldDisableRouting, ]); // Function to get the initials from the user name diff --git a/frontend/src/helpers/GetStaticData.js b/frontend/src/helpers/GetStaticData.js index e75e1e560..fc597d652 100644 --- a/frontend/src/helpers/GetStaticData.js +++ b/frontend/src/helpers/GetStaticData.js @@ -170,21 +170,30 @@ const listOfAppDeployments = [ }, ]; -const getReadableDateAndTime = (timestamp) => { +const getReadableDateAndTime = (timestamp, includeTime = true) => { const currentDate = new Date(timestamp); - // Options for formatting the date and time - const options = { - year: "numeric", - month: "long", - day: "numeric", + if (isNaN(currentDate)) { + return "Invalid date"; + } + + // Options for formatting the date + const dateOptions = { year: "numeric", month: "long", day: "numeric" }; + const formattedDate = currentDate.toLocaleDateString("en-US", dateOptions); + + if (!includeTime) { + return formattedDate; + } + + // Options for formatting the time + const timeOptions = { hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: "short", }; - const formattedDate = currentDate.toLocaleDateString("en-US", options); - const formattedTime = currentDate.toLocaleTimeString("en-US", options); + const formattedTime = currentDate.toLocaleTimeString("en-US", timeOptions); + return formattedDate + ", " + formattedTime; }; diff --git a/frontend/src/routes/useMainAppRoutes.js b/frontend/src/routes/useMainAppRoutes.js index f77e96ad5..7309a63b7 100644 --- a/frontend/src/routes/useMainAppRoutes.js +++ b/frontend/src/routes/useMainAppRoutes.js @@ -109,7 +109,10 @@ function useMainAppRoutes() { } /> )} {UnstractSubscriptionPage && ( - } /> + } + /> )} } /> Date: Tue, 28 Jan 2025 18:56:34 +0530 Subject: [PATCH 07/15] added supported plugin and constants for db rules functionality (#1092) * added supported plugin and constants for db rules functionality * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .../workflow_manager/workflow_v2/constants.py | 1 + frontend/package-lock.json | 397 +++++++++++++++++- frontend/package.json | 1 + 3 files changed, 381 insertions(+), 18 deletions(-) diff --git a/backend/workflow_manager/workflow_v2/constants.py b/backend/workflow_manager/workflow_v2/constants.py index c36a435da..29d400ffe 100644 --- a/backend/workflow_manager/workflow_v2/constants.py +++ b/backend/workflow_manager/workflow_v2/constants.py @@ -63,3 +63,4 @@ class WorkflowMessages: class ResultKeys: METADATA = "metadata" CONFIDENCE_DATA = "confidence_data" + OUTPUT = "output" diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 97e09de0d..b566f0ef2 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.0", "dependencies": { "@ant-design/icons": "^5.1.4", + "@react-awesome-query-builder/antd": "^6.6.10", "@react-pdf-viewer/core": "^3.12.0", "@react-pdf-viewer/default-layout": "^3.12.0", "@react-pdf-viewer/highlight": "^3.12.0", @@ -2135,9 +2136,10 @@ "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==" }, "node_modules/@babel/runtime": { - "version": "7.23.8", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.8.tgz", - "integrity": "sha512-Y7KbAP984rn1VGMbGqKmBLio9V7y5Je9GvU4rQPCPinCyNfUcToxIXl06d59URp/F3LwinvODxab5N/G6qggkw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", + "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", + "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -3716,6 +3718,119 @@ "react-dom": ">=16.9.0" } }, + "node_modules/@react-awesome-query-builder/antd": { + "version": "6.6.10", + "resolved": "https://registry.npmjs.org/@react-awesome-query-builder/antd/-/antd-6.6.10.tgz", + "integrity": "sha512-PSIaEk+jVN/x6gK/kOKiK8yjZhazui91sjmKojIQNT9OT1I0GOEmusZVvhHNGKQuUl5sJcn0CdYqsBVL4ECv5A==", + "license": "MIT", + "dependencies": { + "@react-awesome-query-builder/ui": "^6.6.10", + "lodash": "^4.17.21", + "prop-types": "^15.8.1", + "rc-picker": "^4.5.0" + }, + "peerDependencies": { + "@ant-design/icons": "^4.0.0 || ^5.0.0", + "antd": "^4.17.0 || ^5.0.0", + "react": "^16.8.4 || ^17.0.1 || ^18.0.0", + "react-dom": "^16.8.4 || ^17.0.1 || ^18.0.0" + } + }, + "node_modules/@react-awesome-query-builder/antd/node_modules/@rc-component/trigger": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/@rc-component/trigger/-/trigger-2.2.6.tgz", + "integrity": "sha512-/9zuTnWwhQ3S3WT1T8BubuFTT46kvnXgaERR9f4BTKyn61/wpf/BvbImzYBubzJibU707FxwbKszLlHjcLiv1Q==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.2", + "@rc-component/portal": "^1.1.0", + "classnames": "^2.3.2", + "rc-motion": "^2.0.0", + "rc-resize-observer": "^1.3.1", + "rc-util": "^5.44.0" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@react-awesome-query-builder/antd/node_modules/rc-picker": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/rc-picker/-/rc-picker-4.9.2.tgz", + "integrity": "sha512-SLW4PRudODOomipKI0dvykxW4P8LOqtMr17MOaLU6NQJhkh9SZeh44a/8BMxwv5T6e3kiIeYc9k5jFg2Mv35Pg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.24.7", + "@rc-component/trigger": "^2.0.0", + "classnames": "^2.2.1", + "rc-overflow": "^1.3.2", + "rc-resize-observer": "^1.4.0", + "rc-util": "^5.43.0" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "date-fns": ">= 2.x", + "dayjs": ">= 1.x", + "luxon": ">= 3.x", + "moment": ">= 2.x", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + }, + "peerDependenciesMeta": { + "date-fns": { + "optional": true + }, + "dayjs": { + "optional": true + }, + "luxon": { + "optional": true + }, + "moment": { + "optional": true + } + } + }, + "node_modules/@react-awesome-query-builder/core": { + "version": "6.6.10", + "resolved": "https://registry.npmjs.org/@react-awesome-query-builder/core/-/core-6.6.10.tgz", + "integrity": "sha512-6CaQS12LTnYQUfH/Y8jDaiJUcdowKaI9i5Azz8oNvPtZI3hO940fJSdX5brUPD29/H4u888JEh3PQ9u/ANNtbg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.24.5", + "clone": "^2.1.2", + "i18next": "^23.11.5", + "immutable": "^4.3.6", + "json-logic-js": "^2.0.2", + "lodash": "^4.17.21", + "moment": "^2.30.1", + "spel2js": "^0.2.8", + "sqlstring": "^2.3.3" + } + }, + "node_modules/@react-awesome-query-builder/ui": { + "version": "6.6.10", + "resolved": "https://registry.npmjs.org/@react-awesome-query-builder/ui/-/ui-6.6.10.tgz", + "integrity": "sha512-k52hXSWC7emcBfubOyoGSzhxSBSQyLuhCq+3Abnn+zeA70W6kHyy31DjjFryERCg73WJDNESmYjSlu7S3C6n5Q==", + "license": "MIT", + "dependencies": { + "@react-awesome-query-builder/core": "^6.6.10", + "classnames": "^2.5.1", + "lodash": "^4.17.21", + "prop-types": "^15.8.1", + "react-redux": "^8.1.3", + "redux": "^4.2.1" + }, + "peerDependencies": { + "react": "^16.8.4 || ^17.0.1 || ^18.0.0", + "react-dom": "^16.8.4 || ^17.0.1 || ^18.0.0" + } + }, "node_modules/@react-dnd/asap": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@react-dnd/asap/-/asap-5.0.2.tgz", @@ -4659,6 +4774,16 @@ "@types/node": "*" } }, + "node_modules/@types/hoist-non-react-statics": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.6.tgz", + "integrity": "sha512-lPByRJUer/iN/xa4qpyL0qmL11DqNW81iU/IG1S3uvRUq4oKagz8VCxZjiWkumgt66YT3vOdDgZ0o32sGKtCEw==", + "license": "MIT", + "dependencies": { + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0" + } + }, "node_modules/@types/html-minifier-terser": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", @@ -4887,6 +5012,12 @@ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.7.tgz", "integrity": "sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==" }, + "node_modules/@types/use-sync-external-store": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz", + "integrity": "sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA==", + "license": "MIT" + }, "node_modules/@types/ws": { "version": "8.5.5", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz", @@ -6682,6 +6813,15 @@ "wrap-ansi": "^7.0.0" } }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, "node_modules/co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -10198,6 +10338,29 @@ "node": ">=10.17.0" } }, + "node_modules/i18next": { + "version": "23.16.8", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.16.8.tgz", + "integrity": "sha512-06r/TitrM88Mg5FdUXAKL96dJMzgqLE5dv3ryBAra4KCwD9mJ4ndOTS95ZuymIGoE+2hzfdaMak2X11/es7ZWg==", + "funding": [ + { + "type": "individual", + "url": "https://locize.com" + }, + { + "type": "individual", + "url": "https://locize.com/i18next.html" + }, + { + "type": "individual", + "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" + } + ], + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.2" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -10253,6 +10416,12 @@ "url": "https://opencollective.com/immer" } }, + "node_modules/immutable": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", + "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", + "license": "MIT" + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -12834,6 +13003,12 @@ "node": ">= 16" } }, + "node_modules/json-logic-js": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/json-logic-js/-/json-logic-js-2.0.5.tgz", + "integrity": "sha512-rTT2+lqcuUmj4DgWfmzupZqQDA64AdmYqizzMPWj3DxGdfFNsxPpcNVSaTj4l8W2tG/+hg7/mQhxjU3aPacO6g==", + "license": "MIT" + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -14116,9 +14291,10 @@ } }, "node_modules/moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "license": "MIT", "engines": { "node": "*" } @@ -17011,9 +17187,10 @@ } }, "node_modules/rc-util": { - "version": "5.38.1", - "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-5.38.1.tgz", - "integrity": "sha512-e4ZMs7q9XqwTuhIK7zBIVFltUtMSjphuPPQXHoHlzRzNdOwUxDejo0Zls5HYaJfRKNURcsS/ceKVULlhjBrxng==", + "version": "5.44.3", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-5.44.3.tgz", + "integrity": "sha512-q6KCcOFk3rv/zD3MckhJteZxb0VjAIFuf622B7ElK4vfrZdAzs16XR5p3VTdy3+U5jfJU5ACz4QnhLSuAGe5dA==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.18.3", "react-is": "^18.2.0" @@ -17237,6 +17414,45 @@ "react": ">= 17.0.0" } }, + "node_modules/react-redux": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.1.3.tgz", + "integrity": "sha512-n0ZrutD7DaX/j9VscF+uTALI3oUPa/pO4Z3soOBIjuRn/FzVu6aehhysxZCLi6y7duMf52WNZGMl7CtuK5EnRw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.1", + "@types/hoist-non-react-statics": "^3.3.1", + "@types/use-sync-external-store": "^0.0.3", + "hoist-non-react-statics": "^3.3.2", + "react-is": "^18.0.0", + "use-sync-external-store": "^1.0.0" + }, + "peerDependencies": { + "@types/react": "^16.8 || ^17.0 || ^18.0", + "@types/react-dom": "^16.8 || ^17.0 || ^18.0", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0", + "react-native": ">=0.59", + "redux": "^4 || ^5.0.0-beta.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + }, + "redux": { + "optional": true + } + } + }, "node_modules/react-refresh": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", @@ -18425,11 +18641,28 @@ "wbuf": "^1.7.3" } }, + "node_modules/spel2js": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/spel2js/-/spel2js-0.2.8.tgz", + "integrity": "sha512-dzYq+v4YV7SPIdNrmvFAUjc0HcgI7b0yoMw7kzOBmlj/GjdOb/+8dVn1I7nLuOS5X2SW+LK3tf2SVkXRjCkWBA==", + "engines": { + "node": ">=8" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/stable": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", @@ -22066,9 +22299,9 @@ "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==" }, "@babel/runtime": { - "version": "7.23.8", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.8.tgz", - "integrity": "sha512-Y7KbAP984rn1VGMbGqKmBLio9V7y5Je9GvU4rQPCPinCyNfUcToxIXl06d59URp/F3LwinvODxab5N/G6qggkw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz", + "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==", "requires": { "regenerator-runtime": "^0.14.0" }, @@ -23217,6 +23450,74 @@ "rc-util": "^5.38.0" } }, + "@react-awesome-query-builder/antd": { + "version": "6.6.10", + "resolved": "https://registry.npmjs.org/@react-awesome-query-builder/antd/-/antd-6.6.10.tgz", + "integrity": "sha512-PSIaEk+jVN/x6gK/kOKiK8yjZhazui91sjmKojIQNT9OT1I0GOEmusZVvhHNGKQuUl5sJcn0CdYqsBVL4ECv5A==", + "requires": { + "@react-awesome-query-builder/ui": "^6.6.10", + "lodash": "^4.17.21", + "prop-types": "^15.8.1", + "rc-picker": "^4.5.0" + }, + "dependencies": { + "@rc-component/trigger": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/@rc-component/trigger/-/trigger-2.2.6.tgz", + "integrity": "sha512-/9zuTnWwhQ3S3WT1T8BubuFTT46kvnXgaERR9f4BTKyn61/wpf/BvbImzYBubzJibU707FxwbKszLlHjcLiv1Q==", + "requires": { + "@babel/runtime": "^7.23.2", + "@rc-component/portal": "^1.1.0", + "classnames": "^2.3.2", + "rc-motion": "^2.0.0", + "rc-resize-observer": "^1.3.1", + "rc-util": "^5.44.0" + } + }, + "rc-picker": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/rc-picker/-/rc-picker-4.9.2.tgz", + "integrity": "sha512-SLW4PRudODOomipKI0dvykxW4P8LOqtMr17MOaLU6NQJhkh9SZeh44a/8BMxwv5T6e3kiIeYc9k5jFg2Mv35Pg==", + "requires": { + "@babel/runtime": "^7.24.7", + "@rc-component/trigger": "^2.0.0", + "classnames": "^2.2.1", + "rc-overflow": "^1.3.2", + "rc-resize-observer": "^1.4.0", + "rc-util": "^5.43.0" + } + } + } + }, + "@react-awesome-query-builder/core": { + "version": "6.6.10", + "resolved": "https://registry.npmjs.org/@react-awesome-query-builder/core/-/core-6.6.10.tgz", + "integrity": "sha512-6CaQS12LTnYQUfH/Y8jDaiJUcdowKaI9i5Azz8oNvPtZI3hO940fJSdX5brUPD29/H4u888JEh3PQ9u/ANNtbg==", + "requires": { + "@babel/runtime": "^7.24.5", + "clone": "^2.1.2", + "i18next": "^23.11.5", + "immutable": "^4.3.6", + "json-logic-js": "^2.0.2", + "lodash": "^4.17.21", + "moment": "^2.30.1", + "spel2js": "^0.2.8", + "sqlstring": "^2.3.3" + } + }, + "@react-awesome-query-builder/ui": { + "version": "6.6.10", + "resolved": "https://registry.npmjs.org/@react-awesome-query-builder/ui/-/ui-6.6.10.tgz", + "integrity": "sha512-k52hXSWC7emcBfubOyoGSzhxSBSQyLuhCq+3Abnn+zeA70W6kHyy31DjjFryERCg73WJDNESmYjSlu7S3C6n5Q==", + "requires": { + "@react-awesome-query-builder/core": "^6.6.10", + "classnames": "^2.5.1", + "lodash": "^4.17.21", + "prop-types": "^15.8.1", + "react-redux": "^8.1.3", + "redux": "^4.2.1" + } + }, "@react-dnd/asap": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@react-dnd/asap/-/asap-5.0.2.tgz", @@ -23890,6 +24191,15 @@ "@types/node": "*" } }, + "@types/hoist-non-react-statics": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.6.tgz", + "integrity": "sha512-lPByRJUer/iN/xa4qpyL0qmL11DqNW81iU/IG1S3uvRUq4oKagz8VCxZjiWkumgt66YT3vOdDgZ0o32sGKtCEw==", + "requires": { + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0" + } + }, "@types/html-minifier-terser": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", @@ -24111,6 +24421,11 @@ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.7.tgz", "integrity": "sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==" }, + "@types/use-sync-external-store": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz", + "integrity": "sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA==" + }, "@types/ws": { "version": "8.5.5", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz", @@ -25417,6 +25732,11 @@ "wrap-ansi": "^7.0.0" } }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==" + }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -27990,6 +28310,14 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" }, + "i18next": { + "version": "23.16.8", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.16.8.tgz", + "integrity": "sha512-06r/TitrM88Mg5FdUXAKL96dJMzgqLE5dv3ryBAra4KCwD9mJ4ndOTS95ZuymIGoE+2hzfdaMak2X11/es7ZWg==", + "requires": { + "@babel/runtime": "^7.23.2" + } + }, "iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -28027,6 +28355,11 @@ "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.21.tgz", "integrity": "sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==" }, + "immutable": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", + "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==" + }, "import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -30007,6 +30340,11 @@ "doc-path": "4.1.1" } }, + "json-logic-js": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/json-logic-js/-/json-logic-js-2.0.5.tgz", + "integrity": "sha512-rTT2+lqcuUmj4DgWfmzupZqQDA64AdmYqizzMPWj3DxGdfFNsxPpcNVSaTj4l8W2tG/+hg7/mQhxjU3aPacO6g==" + }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -30861,9 +31199,9 @@ } }, "moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==" + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==" }, "moment-timezone": { "version": "0.5.45", @@ -32753,9 +33091,9 @@ } }, "rc-util": { - "version": "5.38.1", - "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-5.38.1.tgz", - "integrity": "sha512-e4ZMs7q9XqwTuhIK7zBIVFltUtMSjphuPPQXHoHlzRzNdOwUxDejo0Zls5HYaJfRKNURcsS/ceKVULlhjBrxng==", + "version": "5.44.3", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-5.44.3.tgz", + "integrity": "sha512-q6KCcOFk3rv/zD3MckhJteZxb0VjAIFuf622B7ElK4vfrZdAzs16XR5p3VTdy3+U5jfJU5ACz4QnhLSuAGe5dA==", "requires": { "@babel/runtime": "^7.18.3", "react-is": "^18.2.0" @@ -32922,6 +33260,19 @@ "product-fruits": "^1.0.25" } }, + "react-redux": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.1.3.tgz", + "integrity": "sha512-n0ZrutD7DaX/j9VscF+uTALI3oUPa/pO4Z3soOBIjuRn/FzVu6aehhysxZCLi6y7duMf52WNZGMl7CtuK5EnRw==", + "requires": { + "@babel/runtime": "^7.12.1", + "@types/hoist-non-react-statics": "^3.3.1", + "@types/use-sync-external-store": "^0.0.3", + "hoist-non-react-statics": "^3.3.2", + "react-is": "^18.0.0", + "use-sync-external-store": "^1.0.0" + } + }, "react-refresh": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", @@ -33797,11 +34148,21 @@ "wbuf": "^1.7.3" } }, + "spel2js": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/spel2js/-/spel2js-0.2.8.tgz", + "integrity": "sha512-dzYq+v4YV7SPIdNrmvFAUjc0HcgI7b0yoMw7kzOBmlj/GjdOb/+8dVn1I7nLuOS5X2SW+LK3tf2SVkXRjCkWBA==" + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, + "sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==" + }, "stable": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", diff --git a/frontend/package.json b/frontend/package.json index f0d9aea24..101b61d62 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -4,6 +4,7 @@ "private": true, "dependencies": { "@ant-design/icons": "^5.1.4", + "@react-awesome-query-builder/antd": "^6.6.10", "@react-pdf-viewer/core": "^3.12.0", "@react-pdf-viewer/default-layout": "^3.12.0", "@react-pdf-viewer/highlight": "^3.12.0", From 10f48e098afb051e5bd12372ea84f3db7546de1d Mon Sep 17 00:00:00 2001 From: ali <117142933+muhammad-ali-e@users.noreply.github.com> Date: Wed, 29 Jan 2025 12:37:49 +0530 Subject: [PATCH 08/15] file validation in serailizer with number of file (#1099) --- backend/api_v2/api_deployment_views.py | 6 ++---- backend/api_v2/serializers.py | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/backend/api_v2/api_deployment_views.py b/backend/api_v2/api_deployment_views.py index 580c7494f..656a33ae7 100644 --- a/backend/api_v2/api_deployment_views.py +++ b/backend/api_v2/api_deployment_views.py @@ -4,7 +4,7 @@ from api_v2.constants import ApiExecution from api_v2.deployment_helper import DeploymentHelper -from api_v2.exceptions import InvalidAPIRequest, NoActiveAPIKeyError +from api_v2.exceptions import NoActiveAPIKeyError from api_v2.models import APIDeployment from api_v2.postman_collection.dto import PostmanCollection from api_v2.serializers import ( @@ -47,16 +47,14 @@ def initialize_request( def post( self, request: Request, org_name: str, api_name: str, api: APIDeployment ) -> Response: - file_objs = request.FILES.getlist(ApiExecution.FILES_FORM_DATA) serializer = ExecutionRequestSerializer(data=request.data) serializer.is_valid(raise_exception=True) + file_objs = serializer.validated_data.get(ApiExecution.FILES_FORM_DATA) timeout = serializer.validated_data.get(ApiExecution.TIMEOUT_FORM_DATA) include_metadata = serializer.validated_data.get(ApiExecution.INCLUDE_METADATA) include_metrics = serializer.validated_data.get(ApiExecution.INCLUDE_METRICS) use_file_history = serializer.validated_data.get(ApiExecution.USE_FILE_HISTORY) tag_names = serializer.validated_data.get(ApiExecution.TAGS) - if not file_objs or len(file_objs) == 0: - raise InvalidAPIRequest("File shouldn't be empty") response = DeploymentHelper.execute_workflow( organization_name=org_name, api=api, diff --git a/backend/api_v2/serializers.py b/backend/api_v2/serializers.py index 24bba28cc..611f4079f 100644 --- a/backend/api_v2/serializers.py +++ b/backend/api_v2/serializers.py @@ -9,8 +9,10 @@ from rest_framework.serializers import ( BooleanField, CharField, + FileField, IntegerField, JSONField, + ListField, ModelSerializer, Serializer, ValidationError, @@ -115,12 +117,31 @@ class ExecutionRequestSerializer(TagParamsSerializer): e.g:'tag1,tag2-name,tag3_name' """ + MAX_FILES_ALLOWED = 32 + timeout = IntegerField( min_value=-1, max_value=ApiExecution.MAXIMUM_TIMEOUT_IN_SEC, default=-1 ) include_metadata = BooleanField(default=False) include_metrics = BooleanField(default=False) use_file_history = BooleanField(default=False) + files = ListField( + child=FileField(), + required=True, + allow_empty=False, + error_messages={ + "required": "At least one file must be provided.", + "empty": "The file list cannot be empty.", + }, + ) + + def validate_files(self, value): + """Validate the files field.""" + if len(value) == 0: + raise ValidationError("The file list cannot be empty.") + if len(value) > self.MAX_FILES_ALLOWED: + raise ValidationError(f"Maximum '{self.MAX_FILES_ALLOWED}' files allowed.") + return value class ExecutionQuerySerializer(Serializer): From 33978af957da8feedf6687af9fc3d7aa6a7149ed Mon Sep 17 00:00:00 2001 From: Tahier Hussain <89440263+tahierhussain@users.noreply.github.com> Date: Fri, 31 Jan 2025 15:05:23 +0530 Subject: [PATCH 09/15] FIX: Unstract Payment Integration Related Improvements in the Plugins Usage (#1104) * Added a conditional top navbar dropdown link for the pricing page * Updated the route from /subscription-plans to /pricing --- .../components/navigations/top-nav-bar/TopNavBar.jsx | 10 ++++++++++ frontend/src/routes/useMainAppRoutes.js | 5 +---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx b/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx index 7cf512ad4..1d7951849 100644 --- a/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx +++ b/frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx @@ -71,10 +71,13 @@ try { let unstractSubscriptionPlan; let unstractSubscriptionPlanStore; let UNSTRACT_SUBSCRIPTION_PLANS; +let UnstractPricingMenuLink; try { unstractSubscriptionPlanStore = require("../../../plugins/store/unstract-subscription-plan-store"); UNSTRACT_SUBSCRIPTION_PLANS = require("../../../plugins/unstract-subscription/helper/constants").UNSTRACT_SUBSCRIPTION_PLANS; + UnstractPricingMenuLink = + require("../../../plugins/unstract-subscription/components/UnstractPricingMenuLink.jsx").UnstractPricingMenuLink; } catch (err) { // Plugin unavailable. } @@ -294,6 +297,13 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) { }); } + if (isUnstract && UnstractPricingMenuLink) { + menuItems.push({ + key: "7", + label: , + }); + } + // Logout menuItems.push({ key: "2", diff --git a/frontend/src/routes/useMainAppRoutes.js b/frontend/src/routes/useMainAppRoutes.js index 7309a63b7..4732e49ba 100644 --- a/frontend/src/routes/useMainAppRoutes.js +++ b/frontend/src/routes/useMainAppRoutes.js @@ -109,10 +109,7 @@ function useMainAppRoutes() { } /> )} {UnstractSubscriptionPage && ( - } - /> + } /> )} } /> Date: Fri, 31 Jan 2025 15:12:09 +0530 Subject: [PATCH 10/15] FIX: Modifications to Plugin Integrations Related to the LLM Whisperer Adapter (#1105) * Integration of the transform formdata function for LLMW Paid Adapter * Fixed sonar issue * Code optimization in declaring variable --- .../input-output/add-source/AddSource.jsx | 47 +++++++++++++++---- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/input-output/add-source/AddSource.jsx b/frontend/src/components/input-output/add-source/AddSource.jsx index ddaff0a34..96fb5d60a 100644 --- a/frontend/src/components/input-output/add-source/AddSource.jsx +++ b/frontend/src/components/input-output/add-source/AddSource.jsx @@ -1,6 +1,6 @@ import { Typography } from "antd"; import PropTypes from "prop-types"; -import { useEffect, useState } from "react"; +import { useEffect, useMemo, useState } from "react"; import { sourceTypes } from "../../../helpers/GetStaticData"; import { useAxiosPrivate } from "../../../hooks/useAxiosPrivate"; @@ -14,6 +14,7 @@ let transformLlmWhispererJsonSchema; let LLMW_V2_ID; let PLAN_TYPES; let unstractSubscriptionPlanStore; +let llmWhipererAdapterSchema; try { transformLlmWhispererJsonSchema = require("../../../plugins/unstract-subscription/helper/transformLlmWhispererJsonSchema").transformLlmWhispererJsonSchema; @@ -22,6 +23,7 @@ try { PLAN_TYPES = require("../../../plugins/unstract-subscription/helper/constants").PLAN_TYPES; unstractSubscriptionPlanStore = require("../../../plugins/store/unstract-subscription-plan-store"); + llmWhipererAdapterSchema = require("../../../plugins/unstract-subscription/hooks/useLlmWhispererAdapterSchema.js"); } catch (err) { // Ignore if not available } @@ -48,6 +50,15 @@ function AddSource({ const axiosPrivate = useAxiosPrivate(); const handleException = useExceptionHandler(); + let transformLlmWhispererFormData; + try { + transformLlmWhispererFormData = + llmWhipererAdapterSchema?.useLlmWhipererAdapterSchema() + ?.transformLlmWhispererFormData; + } catch { + // Ignore if not available + } + let planType; if (unstractSubscriptionPlanStore?.useUnstractSubscriptionPlanStore) { planType = unstractSubscriptionPlanStore?.useUnstractSubscriptionPlanStore( @@ -55,6 +66,32 @@ function AddSource({ ); } + const isLLMWPaidSchema = useMemo(() => { + return ( + LLMW_V2_ID && + transformLlmWhispererJsonSchema && + PLAN_TYPES && + selectedSourceId === LLMW_V2_ID && + planType === PLAN_TYPES?.PAID + ); + }, [ + LLMW_V2_ID, + transformLlmWhispererJsonSchema, + PLAN_TYPES, + selectedSourceId, + planType, + ]); + + useEffect(() => { + if (!isLLMWPaidSchema || !transformLlmWhispererFormData) return; + + const modifiedFormData = transformLlmWhispererFormData(formData); + + if (JSON.stringify(modifiedFormData) !== JSON.stringify(formData)) { + setFormData(modifiedFormData); + } + }, [isLLMWPaidSchema, formData]); + useEffect(() => { if (!selectedSourceId) { setSpec({}); @@ -80,13 +117,7 @@ function AddSource({ const data = res?.data; setFormData(metadata || {}); - if ( - LLMW_V2_ID && - transformLlmWhispererJsonSchema && - PLAN_TYPES && - selectedSourceId === LLMW_V2_ID && - planType === PLAN_TYPES?.PAID - ) { + if (isLLMWPaidSchema) { setSpec(transformLlmWhispererJsonSchema(data?.json_schema || {})); } else { setSpec(data?.json_schema || {}); From 9137c32c1c15d960c590ccf3f759647d1a23803b Mon Sep 17 00:00:00 2001 From: Tahier Hussain <89440263+tahierhussain@users.noreply.github.com> Date: Fri, 31 Jan 2025 15:13:10 +0530 Subject: [PATCH 11/15] FIX: Removed the logic that conditionally hides the `mark_horizontal_lines` field (#1075) * Remove the logic to hide 'mark_horizontal_lines' field for LLMW V2 adapter * Styling improvement for error message for RJSF fields --------- Co-authored-by: Athul <89829560+athul-rs@users.noreply.github.com> Co-authored-by: Jaseem Jas <89440144+jaseemjaskp@users.noreply.github.com> --- frontend/src/layouts/rjsf-form-layout/CustomFieldTemplate.jsx | 3 ++- frontend/src/layouts/rjsf-form-layout/RjsfFormLayout.jsx | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/layouts/rjsf-form-layout/CustomFieldTemplate.jsx b/frontend/src/layouts/rjsf-form-layout/CustomFieldTemplate.jsx index 598e5cc44..077aae697 100644 --- a/frontend/src/layouts/rjsf-form-layout/CustomFieldTemplate.jsx +++ b/frontend/src/layouts/rjsf-form-layout/CustomFieldTemplate.jsx @@ -1,3 +1,4 @@ +import { Typography } from "antd"; import PropTypes from "prop-types"; const CustomFieldTemplate = (props) => { @@ -5,7 +6,7 @@ const CustomFieldTemplate = (props) => { return (
{children} - {errors} + {errors} {help}
); diff --git a/frontend/src/layouts/rjsf-form-layout/RjsfFormLayout.jsx b/frontend/src/layouts/rjsf-form-layout/RjsfFormLayout.jsx index 85bf8efb3..e56e9ea07 100644 --- a/frontend/src/layouts/rjsf-form-layout/RjsfFormLayout.jsx +++ b/frontend/src/layouts/rjsf-form-layout/RjsfFormLayout.jsx @@ -78,9 +78,6 @@ function RjsfFormLayout({ const uiSchema = useMemo( () => ({ "ui:classNames": "my-rjsf-form", - mark_horizontal_lines: { - "ui:widget": !formData?.mark_vertical_lines ? "hidden" : undefined, - }, }), [formData] ); From 4f9904b6acee36571f274c90b2d6e3c03f4143fe Mon Sep 17 00:00:00 2001 From: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com> Date: Fri, 31 Jan 2025 18:05:46 +0530 Subject: [PATCH 12/15] [FIX] Fix for usage duplication when line-item type is selected (#1107) * Fix for usage duplication when line-item type is selected * Fix --- prompt-service/src/unstract/prompt_service/main.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/prompt-service/src/unstract/prompt_service/main.py b/prompt-service/src/unstract/prompt_service/main.py index a66d2778f..af34d5f82 100644 --- a/prompt-service/src/unstract/prompt_service/main.py +++ b/prompt-service/src/unstract/prompt_service/main.py @@ -277,13 +277,7 @@ def prompt_processor() -> Any: metadata=metadata, execution_source=execution_source, ) - metadata = query_usage_metadata(token=platform_key, metadata=metadata) # TODO: Handle metrics for line-item extraction - response = { - PSKeys.METADATA: metadata, - PSKeys.OUTPUT: structured_output, - PSKeys.METRICS: metrics, - } continue except APIError as e: app.logger.error( From 019ab7f7ab3e93c589e7f53f17b0530f13ba94e3 Mon Sep 17 00:00:00 2001 From: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com> Date: Mon, 3 Feb 2025 13:16:51 +0530 Subject: [PATCH 13/15] feat: Reload support for backend, changes to entrypoint script (#1100) * Reload support for backend, changes to entrypoint script * Changes to support new migrate option in entrypoint.sh script * Minor doc changes * Added logger to specify startup time * Commit pdm.lock changes * feat: Added compose override support and docs to use it * Commit pdm.lock changes * Update backend/backend/wsgi.py Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com> * Commit pdm.lock changes --------- Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com> Co-authored-by: Hari John Kuriakose --- .gitignore | 1 + backend/README.md | 8 ++ backend/backend/wsgi.py | 8 ++ backend/entrypoint.sh | 57 ++++++++--- backend/pdm.lock | 140 ++++++++++++++++------------ backend/pyproject.toml | 2 + docker/README.md | 30 +++++- docker/docker-compose.yaml | 2 +- docker/sample.compose.override.yaml | 14 +++ 9 files changed, 185 insertions(+), 77 deletions(-) create mode 100644 docker/sample.compose.override.yaml diff --git a/.gitignore b/.gitignore index 0f029490b..a7588844a 100644 --- a/.gitignore +++ b/.gitignore @@ -636,6 +636,7 @@ docker/*.env !docker/sample*.env docker/public_tools.json docker/proxy_overrides.yaml +docker/compose.override.yaml docker/workflow_data/ # Tool development diff --git a/backend/README.md b/backend/README.md index 8f8cbc330..87e970ec5 100644 --- a/backend/README.md +++ b/backend/README.md @@ -39,6 +39,8 @@ pdm install --dev -G lint pdm install --prod --no-editable ``` +#### Running scripts + PDM allows you to run scripts applicable within the service dir. ```bash @@ -46,6 +48,12 @@ PDM allows you to run scripts applicable within the service dir. pdm run -l ``` +For example to run the backend (dev mode is recommended to take advantage of gunicorn's `reload` feature) + +```bash +pdm run backend --dev +``` + #### Running commands - If you plan to run the django server locally, make sure the dependent services are up (either locally or through docker compose) diff --git a/backend/backend/wsgi.py b/backend/backend/wsgi.py index 9a654eb50..ff41a40b0 100644 --- a/backend/backend/wsgi.py +++ b/backend/backend/wsgi.py @@ -6,7 +6,9 @@ https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/ """ +import logging import os +import time from django.conf import settings from django.core.wsgi import get_wsgi_application @@ -15,11 +17,17 @@ load_dotenv() +logger = logging.getLogger(__name__) + os.environ.setdefault( "DJANGO_SETTINGS_MODULE", os.environ.get("DJANGO_SETTINGS_MODULE", "backend.settings.dev"), ) +wsgi_start_time = time.perf_counter() django_app = get_wsgi_application() +wsgi_init_elapsed = time.perf_counter() - wsgi_start_time +logger.info(f"WSGI application initialized in {wsgi_init_elapsed:.3f} seconds") + application = start_server(django_app, f"{settings.PATH_PREFIX}/socket") diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh index 686755124..5d44345fd 100755 --- a/backend/entrypoint.sh +++ b/backend/entrypoint.sh @@ -1,19 +1,50 @@ #!/usr/bin/env bash -cmd=$1 -if [ "$cmd" = "migrate" ]; then +show_help() { + echo "Usage: ./entrypoint.sh [OPTIONS]" + echo "" + echo "Options:" + echo " --migrate Perform database migrations before starting the server." + echo " --dev Run Gunicorn in development mode with --reload and reduced graceful timeout (5s)." + echo " --help, -h Show this help message and exit." +} + +# Parse arguments +migrate=false +dev=false + +while [[ "$#" -gt 0 ]]; do + case $1 in + --migrate) migrate=true ;; + --dev) dev=true ;; + --help|-h) show_help; exit 0 ;; + *) echo "Unknown argument: $1"; exit 1 ;; + esac + shift +done + +# Perform database migration if --migrate is provided +if [ "$migrate" = true ]; then echo "Migration initiated" .venv/bin/python manage.py migrate fi -# NOTE: Leaving below for reference incase required in the future -# python manage.py runserver 0.0.0.0:8000 --insecure -# NOTE updated socket threads -.venv/bin/gunicorn \ - --bind 0.0.0.0:8000 \ - --workers 2 \ - --threads 2 \ - --log-level debug \ - --timeout 600 \ - --access-logfile - \ - backend.wsgi:application +# Configure Gunicorn based on --dev flag +gunicorn_args=( + --bind 0.0.0.0:8000 + --workers 2 + --threads 2 + --log-level debug + --timeout 600 + --access-logfile - +) + +if [ "$dev" = true ]; then + echo "Running in development mode" + gunicorn_args+=(--reload --graceful-timeout 5) +else + echo "Running in production mode" +fi + +# Start Gunicorn +.venv/bin/gunicorn "${gunicorn_args[@]}" backend.wsgi:application diff --git a/backend/pdm.lock b/backend/pdm.lock index c9b2ee969..d8642f357 100644 --- a/backend/pdm.lock +++ b/backend/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "deploy", "dev", "test"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.4.2" -content_hash = "sha256:91a2107cba5ace82af1ff886802662781f7736cb1c414561d6de9b4b4c3f77d4" +content_hash = "sha256:238a337bae984c303a07a897f701bb3f6467d25a419f4979fb867b44ea00d124" [[package]] name = "adlfs" @@ -190,7 +190,7 @@ files = [ [[package]] name = "anthropic" -version = "0.45.0" +version = "0.45.2" requires_python = ">=3.8" summary = "The official Python library for the anthropic API" groups = ["default", "dev"] @@ -204,26 +204,26 @@ dependencies = [ "typing-extensions<5,>=4.10", ] files = [ - {file = "anthropic-0.45.0-py3-none-any.whl", hash = "sha256:f36aff71d2c232945e64d1970be68a91b05a2ef5e3afa6c1ff195c3303a95ad3"}, - {file = "anthropic-0.45.0.tar.gz", hash = "sha256:4e8541dc355332090bfc51b84549c19b649a13a23dbd6bd68e1d012e08551025"}, + {file = "anthropic-0.45.2-py3-none-any.whl", hash = "sha256:ecd746f7274451dfcb7e1180571ead624c7e1195d1d46cb7c70143d2aedb4d35"}, + {file = "anthropic-0.45.2.tar.gz", hash = "sha256:32a18b9ecd12c91b2be4cae6ca2ab46a06937b5aa01b21308d97a6d29794fb5e"}, ] [[package]] name = "anthropic" -version = "0.45.0" +version = "0.45.2" extras = ["bedrock", "vertex"] requires_python = ">=3.8" summary = "The official Python library for the anthropic API" groups = ["default", "dev"] dependencies = [ - "anthropic==0.45.0", + "anthropic==0.45.2", "boto3>=1.28.57", "botocore>=1.31.57", "google-auth<3,>=2", ] files = [ - {file = "anthropic-0.45.0-py3-none-any.whl", hash = "sha256:f36aff71d2c232945e64d1970be68a91b05a2ef5e3afa6c1ff195c3303a95ad3"}, - {file = "anthropic-0.45.0.tar.gz", hash = "sha256:4e8541dc355332090bfc51b84549c19b649a13a23dbd6bd68e1d012e08551025"}, + {file = "anthropic-0.45.2-py3-none-any.whl", hash = "sha256:ecd746f7274451dfcb7e1180571ead624c7e1195d1d46cb7c70143d2aedb4d35"}, + {file = "anthropic-0.45.2.tar.gz", hash = "sha256:32a18b9ecd12c91b2be4cae6ca2ab46a06937b5aa01b21308d97a6d29794fb5e"}, ] [[package]] @@ -1383,7 +1383,7 @@ files = [ [[package]] name = "google-api-core" -version = "2.24.1rc1" +version = "2.24.1" requires_python = ">=3.7" summary = "Google API client core library" groups = ["default", "dev"] @@ -1395,32 +1395,32 @@ dependencies = [ "requests<3.0.0.dev0,>=2.18.0", ] files = [ - {file = "google_api_core-2.24.1rc1-py3-none-any.whl", hash = "sha256:92ee3eed90a397a9f4dd13c034a36cbe7dba2a58e01e5668619847b68a527b73"}, - {file = "google_api_core-2.24.1rc1.tar.gz", hash = "sha256:d1cf8265c8b0b171a87d84adc8709a5e48147ca529d6f96d6a2be613a195eb78"}, + {file = "google_api_core-2.24.1-py3-none-any.whl", hash = "sha256:bc78d608f5a5bf853b80bd70a795f703294de656c096c0968320830a4bc280f1"}, + {file = "google_api_core-2.24.1.tar.gz", hash = "sha256:f8b36f5456ab0dd99a1b693a40a31d1e7757beea380ad1b38faaf8941eae9d8a"}, ] [[package]] name = "google-api-core" -version = "2.24.1rc1" +version = "2.24.1" extras = ["grpc"] requires_python = ">=3.7" summary = "Google API client core library" groups = ["default", "dev"] dependencies = [ - "google-api-core==2.24.1rc1", + "google-api-core==2.24.1", "grpcio-status<2.0.dev0,>=1.33.2", "grpcio-status<2.0.dev0,>=1.49.1; python_version >= \"3.11\"", "grpcio<2.0dev,>=1.33.2", "grpcio<2.0dev,>=1.49.1; python_version >= \"3.11\"", ] files = [ - {file = "google_api_core-2.24.1rc1-py3-none-any.whl", hash = "sha256:92ee3eed90a397a9f4dd13c034a36cbe7dba2a58e01e5668619847b68a527b73"}, - {file = "google_api_core-2.24.1rc1.tar.gz", hash = "sha256:d1cf8265c8b0b171a87d84adc8709a5e48147ca529d6f96d6a2be613a195eb78"}, + {file = "google_api_core-2.24.1-py3-none-any.whl", hash = "sha256:bc78d608f5a5bf853b80bd70a795f703294de656c096c0968320830a4bc280f1"}, + {file = "google_api_core-2.24.1.tar.gz", hash = "sha256:f8b36f5456ab0dd99a1b693a40a31d1e7757beea380ad1b38faaf8941eae9d8a"}, ] [[package]] name = "google-api-python-client" -version = "2.159.0" +version = "2.160.0" requires_python = ">=3.7" summary = "Google API Client Library for Python" groups = ["default", "dev"] @@ -1432,8 +1432,8 @@ dependencies = [ "uritemplate<5,>=3.0.1", ] files = [ - {file = "google_api_python_client-2.159.0-py2.py3-none-any.whl", hash = "sha256:baef0bb631a60a0bd7c0bf12a5499e3a40cd4388484de7ee55c1950bf820a0cf"}, - {file = "google_api_python_client-2.159.0.tar.gz", hash = "sha256:55197f430f25c907394b44fa078545ffef89d33fd4dca501b7db9f0d8e224bd6"}, + {file = "google_api_python_client-2.160.0-py2.py3-none-any.whl", hash = "sha256:63d61fb3e4cf3fb31a70a87f45567c22f6dfe87bbfa27252317e3e2c42900db4"}, + {file = "google_api_python_client-2.160.0.tar.gz", hash = "sha256:a8ccafaecfa42d15d5b5c3134ced8de08380019717fc9fb1ed510ca58eca3b7e"}, ] [[package]] @@ -1485,7 +1485,7 @@ files = [ [[package]] name = "google-cloud-aiplatform" -version = "1.78.0" +version = "1.79.0" requires_python = ">=3.8" summary = "Vertex AI API client library" groups = ["default", "dev"] @@ -1504,8 +1504,8 @@ dependencies = [ "typing-extensions", ] files = [ - {file = "google_cloud_aiplatform-1.78.0-py2.py3-none-any.whl", hash = "sha256:e2663b715bdeb5f4c9bf72defc5bd9abdb182048b012b83231dd0708dbc8b7ba"}, - {file = "google_cloud_aiplatform-1.78.0.tar.gz", hash = "sha256:c42a8e9981afb7964d14c3109e1eae0892785c746235acb1f990cdfd40ce9d13"}, + {file = "google_cloud_aiplatform-1.79.0-py2.py3-none-any.whl", hash = "sha256:e52d518c386ce2b4ce57f1b73b46c57531d9a6ccd70c21a37b349f428bfc1c3f"}, + {file = "google_cloud_aiplatform-1.79.0.tar.gz", hash = "sha256:362bfd16716dcfb6c131736f25246790002b29c99a246fcf4c08a7c71bd2301f"}, ] [[package]] @@ -1975,7 +1975,7 @@ files = [ [[package]] name = "huggingface-hub" -version = "0.27.1" +version = "0.28.1" requires_python = ">=3.8.0" summary = "Client library to download and publish models, datasets and other repos on the huggingface.co hub" groups = ["default", "dev"] @@ -1989,8 +1989,8 @@ dependencies = [ "typing-extensions>=3.7.4.3", ] files = [ - {file = "huggingface_hub-0.27.1-py3-none-any.whl", hash = "sha256:1c5155ca7d60b60c2e2fc38cbb3ffb7f7c3adf48f824015b219af9061771daec"}, - {file = "huggingface_hub-0.27.1.tar.gz", hash = "sha256:c004463ca870283909d715d20f066ebd6968c2207dae9393fdffb3c1d4d8f98b"}, + {file = "huggingface_hub-0.28.1-py3-none-any.whl", hash = "sha256:aa6b9a3ffdae939b72c464dbb0d7f99f56e649b55c3d52406f49e0a5a620c0a7"}, + {file = "huggingface_hub-0.28.1.tar.gz", hash = "sha256:893471090c98e3b6efbdfdacafe4052b20b84d59866fb6f54c33d9af18c303ae"}, ] [[package]] @@ -2048,6 +2048,18 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] +[[package]] +name = "inotify" +version = "0.2.10" +summary = "An adapter to Linux kernel support for inotify directory-watching." +groups = ["dev"] +dependencies = [ + "nose", +] +files = [ + {file = "inotify-0.2.10.tar.gz", hash = "sha256:974a623a338482b62e16d4eb705fb863ed33ec178680fc3e96ccdf0df6c02a07"}, +] + [[package]] name = "isodate" version = "0.7.2" @@ -2187,7 +2199,7 @@ files = [ [[package]] name = "llama-cloud" -version = "0.1.10" +version = "0.1.11" requires_python = "<4,>=3.8" summary = "" groups = ["default", "dev"] @@ -2197,8 +2209,8 @@ dependencies = [ "pydantic>=1.10", ] files = [ - {file = "llama_cloud-0.1.10-py3-none-any.whl", hash = "sha256:d91198ad92ea6c3a25757e5d6cb565b4bd6db385dc4fa596a725c0fb81a68f4e"}, - {file = "llama_cloud-0.1.10.tar.gz", hash = "sha256:56ffe8f2910c2047dd4eb1b13da31ee5f67321a000794eee559e0b56954d2f76"}, + {file = "llama_cloud-0.1.11-py3-none-any.whl", hash = "sha256:b703765d03783a5a0fc57a52adc9892f8b91b0c19bbecb85a54ad4e813342951"}, + {file = "llama_cloud-0.1.11.tar.gz", hash = "sha256:d4be5b48659fd9fe1698727be257269a22d7f2733a2ed11bce7065768eb94cbe"}, ] [[package]] @@ -2228,7 +2240,7 @@ files = [ [[package]] name = "llama-index-agent-openai" -version = "0.4.2" +version = "0.4.3" requires_python = "<4.0,>=3.9" summary = "llama-index agent openai integration" groups = ["default", "dev"] @@ -2238,8 +2250,8 @@ dependencies = [ "openai>=1.14.0", ] files = [ - {file = "llama_index_agent_openai-0.4.2-py3-none-any.whl", hash = "sha256:e100b8a743b11fef373b5be31be590b929950a4d7fd9d158b5f014dd8fd7976e"}, - {file = "llama_index_agent_openai-0.4.2.tar.gz", hash = "sha256:0f8aeb091fc834b2667a46ad2417fc8601bf1c08ccfd1a3d15ede90a30eb1a29"}, + {file = "llama_index_agent_openai-0.4.3-py3-none-any.whl", hash = "sha256:5d1fbb6831113e609296e457b0a4d1c08c9267acca219eb78cb702bd76a0744d"}, + {file = "llama_index_agent_openai-0.4.3.tar.gz", hash = "sha256:ff1f4a13ba417cb4b9cfbc2ffa9f162bdbdda9b87d6645d512cbde2061f55412"}, ] [[package]] @@ -2905,6 +2917,16 @@ files = [ {file = "nltk-3.9.1.tar.gz", hash = "sha256:87d127bd3de4bd89a4f81265e5fa59cb1b199b27440175370f7417d2bc7ae868"}, ] +[[package]] +name = "nose" +version = "1.3.7" +summary = "nose extends unittest to make testing easier" +groups = ["dev"] +files = [ + {file = "nose-1.3.7-py3-none-any.whl", hash = "sha256:9ff7c6cc443f8c51994b34a667bbcf45afd6d945be7477b52e97516fd17c53ac"}, + {file = "nose-1.3.7.tar.gz", hash = "sha256:f1bffef9cbc82628f6e7d7b40d7e255aefaa1adb6a1b1d26c69a8b79e6208a98"}, +] + [[package]] name = "numpy" version = "1.26.4" @@ -2987,7 +3009,7 @@ files = [ [[package]] name = "openai" -version = "1.60.1" +version = "1.60.2" requires_python = ">=3.8" summary = "The official Python library for the openai API" groups = ["default", "dev"] @@ -3002,8 +3024,8 @@ dependencies = [ "typing-extensions<5,>=4.11", ] files = [ - {file = "openai-1.60.1-py3-none-any.whl", hash = "sha256:714181ec1c452353d456f143c22db892de7b373e3165063d02a2b798ed575ba1"}, - {file = "openai-1.60.1.tar.gz", hash = "sha256:beb1541dfc38b002bd629ab68b0d6fe35b870c5f4311d9bc4404d85af3214d5e"}, + {file = "openai-1.60.2-py3-none-any.whl", hash = "sha256:993bd11b96900b9098179c728026f016b4982ded7ee30dfcf4555eab1171fff9"}, + {file = "openai-1.60.2.tar.gz", hash = "sha256:a8f843e10f2855713007f491d96afb2694b11b5e02cb97c7d01a0be60bc5bb51"}, ] [[package]] @@ -3367,7 +3389,7 @@ files = [ [[package]] name = "proto-plus" -version = "1.26.0rc1" +version = "1.26.0" requires_python = ">=3.7" summary = "Beautiful, Pythonic protocol buffers" groups = ["default", "dev"] @@ -3375,8 +3397,8 @@ dependencies = [ "protobuf<6.0.0dev,>=3.19.0", ] files = [ - {file = "proto_plus-1.26.0rc1-py3-none-any.whl", hash = "sha256:a0ad6fbc2e194dbbb813edc22ee2e509a7c38df7ecea2fd2803bce0536eaf0f4"}, - {file = "proto_plus-1.26.0rc1.tar.gz", hash = "sha256:04eeceecd6a038285e2aa8996b53c045d04a568c5c48b7eaa79c097a4984a4c7"}, + {file = "proto_plus-1.26.0-py3-none-any.whl", hash = "sha256:bf2dfaa3da281fc3187d12d224c707cb57214fb2c22ba854eb0c105a3fb2d4d7"}, + {file = "proto_plus-1.26.0.tar.gz", hash = "sha256:6e93d5f5ca267b54300880fff156b6a3386b3fa3f43b1da62e680fc0c586ef22"}, ] [[package]] @@ -3925,12 +3947,12 @@ files = [ [[package]] name = "pytz" -version = "2024.2" +version = "2025.1" summary = "World timezone definitions, modern and historical" groups = ["default", "dev"] files = [ - {file = "pytz-2024.2-py2.py3-none-any.whl", hash = "sha256:31c7c1817eb7fae7ca4b8c7ee50c72f93aa2dd863de768e1ef4245d426aa0725"}, - {file = "pytz-2024.2.tar.gz", hash = "sha256:2aa355083c50a0f93fa581709deac0c9ad65cca8a9e9beac660adcbd493c798a"}, + {file = "pytz-2025.1-py2.py3-none-any.whl", hash = "sha256:89dd22dca55b46eac6eda23b2d72721bf1bdfef212645d81513ef5d03038de57"}, + {file = "pytz-2025.1.tar.gz", hash = "sha256:c2db42be2a2518b28e65f9207c4d05e6ff547d1efa4086469ef855e4ab70178e"}, ] [[package]] @@ -4311,7 +4333,7 @@ files = [ [[package]] name = "shapely" -version = "2.0.6" +version = "2.0.7" requires_python = ">=3.7" summary = "Manipulation and analysis of geometric objects" groups = ["default", "dev"] @@ -4319,25 +4341,25 @@ dependencies = [ "numpy<3,>=1.14", ] files = [ - {file = "shapely-2.0.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:29a34e068da2d321e926b5073539fd2a1d4429a2c656bd63f0bd4c8f5b236d0b"}, - {file = "shapely-2.0.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e1c84c3f53144febf6af909d6b581bc05e8785d57e27f35ebaa5c1ab9baba13b"}, - {file = "shapely-2.0.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2ad2fae12dca8d2b727fa12b007e46fbc522148a584f5d6546c539f3464dccde"}, - {file = "shapely-2.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b3304883bd82d44be1b27a9d17f1167fda8c7f5a02a897958d86c59ec69b705e"}, - {file = "shapely-2.0.6-cp310-cp310-win32.whl", hash = "sha256:3ec3a0eab496b5e04633a39fa3d5eb5454628228201fb24903d38174ee34565e"}, - {file = "shapely-2.0.6-cp310-cp310-win_amd64.whl", hash = "sha256:28f87cdf5308a514763a5c38de295544cb27429cfa655d50ed8431a4796090c4"}, - {file = "shapely-2.0.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5aeb0f51a9db176da9a30cb2f4329b6fbd1e26d359012bb0ac3d3c7781667a9e"}, - {file = "shapely-2.0.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:9a7a78b0d51257a367ee115f4d41ca4d46edbd0dd280f697a8092dd3989867b2"}, - {file = "shapely-2.0.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f32c23d2f43d54029f986479f7c1f6e09c6b3a19353a3833c2ffb226fb63a855"}, - {file = "shapely-2.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b3dc9fb0eb56498912025f5eb352b5126f04801ed0e8bdbd867d21bdbfd7cbd0"}, - {file = "shapely-2.0.6-cp311-cp311-win32.whl", hash = "sha256:d93b7e0e71c9f095e09454bf18dad5ea716fb6ced5df3cb044564a00723f339d"}, - {file = "shapely-2.0.6-cp311-cp311-win_amd64.whl", hash = "sha256:c02eb6bf4cfb9fe6568502e85bb2647921ee49171bcd2d4116c7b3109724ef9b"}, - {file = "shapely-2.0.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:392f66f458a0a2c706254f473290418236e52aa4c9b476a072539d63a2460595"}, - {file = "shapely-2.0.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:eba5bae271d523c938274c61658ebc34de6c4b33fdf43ef7e938b5776388c1be"}, - {file = "shapely-2.0.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7060566bc4888b0c8ed14b5d57df8a0ead5c28f9b69fb6bed4476df31c51b0af"}, - {file = "shapely-2.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b02154b3e9d076a29a8513dffcb80f047a5ea63c897c0cd3d3679f29363cf7e5"}, - {file = "shapely-2.0.6-cp39-cp39-win32.whl", hash = "sha256:44246d30124a4f1a638a7d5419149959532b99dfa25b54393512e6acc9c211ac"}, - {file = "shapely-2.0.6-cp39-cp39-win_amd64.whl", hash = "sha256:2b542d7f1dbb89192d3512c52b679c822ba916f93479fa5d4fc2fe4fa0b3c9e8"}, - {file = "shapely-2.0.6.tar.gz", hash = "sha256:997f6159b1484059ec239cacaa53467fd8b5564dabe186cd84ac2944663b0bf6"}, + {file = "shapely-2.0.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:33fb10e50b16113714ae40adccf7670379e9ccf5b7a41d0002046ba2b8f0f691"}, + {file = "shapely-2.0.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f44eda8bd7a4bccb0f281264b34bf3518d8c4c9a8ffe69a1a05dabf6e8461147"}, + {file = "shapely-2.0.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cf6c50cd879831955ac47af9c907ce0310245f9d162e298703f82e1785e38c98"}, + {file = "shapely-2.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:04a65d882456e13c8b417562c36324c0cd1e5915f3c18ad516bb32ee3f5fc895"}, + {file = "shapely-2.0.7-cp310-cp310-win32.whl", hash = "sha256:7e97104d28e60b69f9b6a957c4d3a2a893b27525bc1fc96b47b3ccef46726bf2"}, + {file = "shapely-2.0.7-cp310-cp310-win_amd64.whl", hash = "sha256:35524cc8d40ee4752520819f9894b9f28ba339a42d4922e92c99b148bed3be39"}, + {file = "shapely-2.0.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5cf23400cb25deccf48c56a7cdda8197ae66c0e9097fcdd122ac2007e320bc34"}, + {file = "shapely-2.0.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d8f1da01c04527f7da59ee3755d8ee112cd8967c15fab9e43bba936b81e2a013"}, + {file = "shapely-2.0.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f623b64bb219d62014781120f47499a7adc30cf7787e24b659e56651ceebcb0"}, + {file = "shapely-2.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e6d95703efaa64aaabf278ced641b888fc23d9c6dd71f8215091afd8a26a66e3"}, + {file = "shapely-2.0.7-cp311-cp311-win32.whl", hash = "sha256:2f6e4759cf680a0f00a54234902415f2fa5fe02f6b05546c662654001f0793a2"}, + {file = "shapely-2.0.7-cp311-cp311-win_amd64.whl", hash = "sha256:b52f3ab845d32dfd20afba86675c91919a622f4627182daec64974db9b0b4608"}, + {file = "shapely-2.0.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4abeb44b3b946236e4e1a1b3d2a0987fb4d8a63bfb3fdefb8a19d142b72001e5"}, + {file = "shapely-2.0.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:cd0e75d9124b73e06a42bf1615ad3d7d805f66871aa94538c3a9b7871d620013"}, + {file = "shapely-2.0.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7977d8a39c4cf0e06247cd2dca695ad4e020b81981d4c82152c996346cf1094b"}, + {file = "shapely-2.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0145387565fcf8f7c028b073c802956431308da933ef41d08b1693de49990d27"}, + {file = "shapely-2.0.7-cp39-cp39-win32.whl", hash = "sha256:98697c842d5c221408ba8aa573d4f49caef4831e9bc6b6e785ce38aca42d1999"}, + {file = "shapely-2.0.7-cp39-cp39-win_amd64.whl", hash = "sha256:a3fb7fbae257e1b042f440289ee7235d03f433ea880e73e687f108d044b24db5"}, + {file = "shapely-2.0.7.tar.gz", hash = "sha256:28fe2997aab9a9dc026dc6a355d04e85841546b2a5d232ed953e3321ab958ee5"}, ] [[package]] diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 4b9b59092..ea4f55888 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -79,6 +79,8 @@ dev = [ "-e unstract-tool-sandbox @ file:///${PROJECT_ROOT}/../unstract/tool-sandbox", "-e unstract-workflow-execution @ file:///${PROJECT_ROOT}/../unstract/workflow-execution", "-e unstract-filesystem @ file:///${PROJECT_ROOT}/../unstract/filesystem", + # For file watching + "inotify>=0.2.10", ] [tool.pytest.ini_options] diff --git a/docker/README.md b/docker/README.md index 8529196db..d895f069c 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,4 +1,6 @@ -# Docker Build +# Docker Commands + +## Docker Build ```bash # Build all services @@ -8,7 +10,7 @@ VERSION=dev docker compose -f docker-compose.build.yaml build VERSION=dev docker compose -f docker-compose.build.yaml build frontend ``` -# Docker Run +## Docker Run **NOTE**: First copy `sample.*.env` files to `*.env` and update as required. @@ -22,7 +24,7 @@ VERSION=dev docker compose -f docker-compose.yaml up -d frontend Now access frontend at http://frontend.unstract.localhost -# Docker Build and Run Optional Services +## Docker Build and Run Optional Services Some services are kept optional and will not be built or started by default. Run them as follows. @@ -33,7 +35,27 @@ VERSION=dev docker compose -f docker-compose.build.yaml --profile optional build VERSION=dev docker compose -f docker-compose.yaml --profile optional up -d ``` -# `src` Folder Layout and `gunicorn` +## Overriding a service's config + +By making use of the [merge compose files](https://docs.docker.com/compose/how-tos/multiple-compose-files/merge/) feature its +possible to override some configuration that's used by the services. + +Copy and rename the `sample.compose.override.yaml` to `compose.override.yaml` and update it as necessary. + +```bash +cp sample.compose.override.yaml compose.override.yaml + +# Configuration in docker-compose.yaml gets overridden +VERSION=dev docker compose -f docker-compose.yaml -f compose.override.yaml up -d +``` + +This can be useful during development to + +- not run some memory intensive services +- use commands with different arguments to save resources +- mount additional volumes or define additional env to configure behaviour + +## `src` Folder Layout and `gunicorn` For the following project structure: diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 13d591cf3..0ed380afe 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -7,7 +7,7 @@ services: image: unstract/backend:${VERSION} container_name: unstract-backend restart: unless-stopped - command: migrate + command: --migrate ports: - "8000:8000" env_file: diff --git a/docker/sample.compose.override.yaml b/docker/sample.compose.override.yaml new file mode 100644 index 000000000..f4ac352b2 --- /dev/null +++ b/docker/sample.compose.override.yaml @@ -0,0 +1,14 @@ +# Refer https://docs.docker.com/compose/how-tos/multiple-compose-files/merge/ +# This is an example configuration which aims to minimize the number of celery workers +# It helps reduce memory usage during development +services: + worker: + command: "-A backend worker --loglevel=info -Q celery,celery_periodic_logs,celery_log_task_queue,celery_api_deployments --autoscale=${WORKER_AUTOSCALE}" + + worker-logging: + profiles: + - high_memory + + worker-api-deployment: + profiles: + - high_memory From cc56b29d4a287b153cc6cc44404aa32219a839e3 Mon Sep 17 00:00:00 2001 From: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:23:22 +0530 Subject: [PATCH 14/15] fix: Defined enable_challenge in prompt-service for error handling (#1111) * fix: Defined enable_challenge in prompt-service correctly to propagate errors * fix: Logged JSON parsing errors to user * minor: Added truncated container name to logs --------- Co-authored-by: Gayathri <142381512+gaya3-zipstack@users.noreply.github.com> --- .../src/unstract/prompt_service/main.py | 25 +++++++++++++------ unstract/core/src/unstract/core/utilities.py | 3 ++- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/prompt-service/src/unstract/prompt_service/main.py b/prompt-service/src/unstract/prompt_service/main.py index af34d5f82..4cbcfa247 100644 --- a/prompt-service/src/unstract/prompt_service/main.py +++ b/prompt-service/src/unstract/prompt_service/main.py @@ -101,6 +101,7 @@ def prompt_processor() -> Any: if not payload: raise NoPayloadError tool_settings = payload.get(PSKeys.TOOL_SETTINGS, {}) + enable_challenge = tool_settings.get(PSKeys.ENABLE_CHALLENGE, False) # TODO: Rename "outputs" to "prompts" in payload prompts = payload.get(PSKeys.OUTPUTS, []) tool_id: str = payload.get(PSKeys.TOOL_ID, "") @@ -277,7 +278,6 @@ def prompt_processor() -> Any: metadata=metadata, execution_source=execution_source, ) - # TODO: Handle metrics for line-item extraction continue except APIError as e: app.logger.error( @@ -494,12 +494,24 @@ def prompt_processor() -> Any: ) structured_output[output[PSKeys.NAME]] = json.loads(answer) except JSONDecodeError as e: - app.logger.info( - f"JSON format error : {answer}", LogLevel.ERROR + err_msg = ( + f"Error parsing response (to json): {e}\n" + f"Candidate JSON: {answer}" ) - app.logger.info( - f"Error parsing response (to json): {e}", - LogLevel.ERROR, + app.logger.info(err_msg, LogLevel.ERROR) + # TODO: Format log message after unifying these types + publish_log( + log_events_id, + { + "tool_id": tool_id, + "prompt_key": prompt_name, + "doc_name": doc_name, + }, + LogLevel.INFO, + RunLevel.RUN, + "Unable to parse JSON response from LLM, try using our" + " cloud / enterprise feature of 'line-item', " + "'record' or 'table' type", ) structured_output[output[PSKeys.NAME]] = {} @@ -512,7 +524,6 @@ def prompt_processor() -> Any: output[PSKeys.NAME] ].rstrip("\n") - enable_challenge = tool_settings.get(PSKeys.ENABLE_CHALLENGE) # Challenge condition if enable_challenge: challenge_plugin: dict[str, Any] = plugins.get(PSKeys.CHALLENGE, {}) diff --git a/unstract/core/src/unstract/core/utilities.py b/unstract/core/src/unstract/core/utilities.py index 34d5c1729..5c1a7c523 100644 --- a/unstract/core/src/unstract/core/utilities.py +++ b/unstract/core/src/unstract/core/utilities.py @@ -41,6 +41,7 @@ def build_tool_container_name( if len(container_name) > 63: logger.warning( f"Container name exceeds 63 char limit for '{container_name}', " - "truncating to 63 chars. There might be collisions in container names" + "truncating to 63 chars. There might be collisions in container names." + f"Truncated container name: {container_name[:63]}" ) return container_name[:63] From bef823f88922b3e67de26024db5286bf41091f21 Mon Sep 17 00:00:00 2001 From: Tahier Hussain <89440263+tahierhussain@users.noreply.github.com> Date: Tue, 4 Feb 2025 15:36:57 +0530 Subject: [PATCH 15/15] FIX: Unstract Subscription Plugin Fixes (#1113) * Fixed issue in disabling the side menu items * Allow access to the '/pricing' page only for admins --- .../navigations/side-nav-bar/SideNavBar.jsx | 31 ++++++++++++++----- .../navigations/top-nav-bar/TopNavBar.jsx | 9 ++++-- frontend/src/helpers/GetStaticData.js | 3 ++ frontend/src/index.css | 8 +++++ frontend/src/routes/useMainAppRoutes.js | 7 +++-- 5 files changed, 47 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx b/frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx index 57d0820bd..e3e10982b 100644 --- a/frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx +++ b/frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx @@ -46,6 +46,14 @@ try { // Plugin unavailable. } +let selectedProductStore; +let selectedProduct; +try { + selectedProductStore = require("../../../plugins/llm-whisperer/store/select-product-store.js"); +} catch { + // Ignore if hook not available +} + const SideNavBar = ({ collapsed }) => { const navigate = useNavigate(); const { sessionDetails } = useSessionStore(); @@ -62,6 +70,12 @@ const SideNavBar = ({ collapsed }) => { // Do nothing } + if (selectedProductStore?.useSelectedProductStore) { + selectedProduct = selectedProductStore.useSelectedProductStore( + (state) => state?.selectedProduct + ); + } + let menu; if (sideMenu) { menu = sideMenu.useSideMenu(); @@ -193,7 +207,12 @@ const SideNavBar = ({ collapsed }) => { } const shouldDisableAll = useMemo(() => { - if (!unstractSubscriptionPlan || !UNSTRACT_SUBSCRIPTION_PLANS) { + const isUnstract = !(selectedProduct && selectedProduct !== "unstract"); + if ( + !unstractSubscriptionPlan || + !UNSTRACT_SUBSCRIPTION_PLANS || + !isUnstract + ) { return false; } @@ -203,13 +222,11 @@ const SideNavBar = ({ collapsed }) => { ); }, [unstractSubscriptionPlan]); - if (shouldDisableAll) { - data.forEach((mainMenuItem) => { - mainMenuItem.subMenu.forEach((subMenuItem) => { - subMenuItem.disable = true; - }); + data.forEach((mainMenuItem) => { + mainMenuItem.subMenu.forEach((subMenuItem) => { + subMenuItem.disable = shouldDisableAll; }); - } + }); return ( , diff --git a/frontend/src/helpers/GetStaticData.js b/frontend/src/helpers/GetStaticData.js index fc597d652..1acf00a24 100644 --- a/frontend/src/helpers/GetStaticData.js +++ b/frontend/src/helpers/GetStaticData.js @@ -586,6 +586,8 @@ const TRIAL_PLAN = "TRIAL"; const homePagePath = cloudHomePagePath || "tools"; +const UNSTRACT_ADMIN = "unstract_admin"; + export { CONNECTOR_TYPE_MAP, O_AUTH_PROVIDERS, @@ -639,4 +641,5 @@ export { generateCoverageKey, TRIAL_PLAN, homePagePath, + UNSTRACT_ADMIN, }; diff --git a/frontend/src/index.css b/frontend/src/index.css index 65d62801d..91eeef047 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -135,6 +135,14 @@ body { padding-left: 6px; } +.pad-top-20 { + padding-top: 20px; +} + +.pad-bottom-20 { + padding-bottom: 20px; +} + .cur-pointer { cursor: pointer; } diff --git a/frontend/src/routes/useMainAppRoutes.js b/frontend/src/routes/useMainAppRoutes.js index 4732e49ba..397486077 100644 --- a/frontend/src/routes/useMainAppRoutes.js +++ b/frontend/src/routes/useMainAppRoutes.js @@ -19,7 +19,8 @@ import { CustomTools } from "../pages/CustomTools.jsx"; import { CustomToolsHelper } from "../components/helpers/custom-tools/CustomToolsHelper.js"; import { ToolIdePage } from "../pages/ToolIdePage.jsx"; import { OutputAnalyzerPage } from "../pages/OutputAnalyzerPage.jsx"; -import { deploymentTypes } from "../helpers/GetStaticData.js"; +import { deploymentTypes, UNSTRACT_ADMIN } from "../helpers/GetStaticData.js"; +import { useSessionStore } from "../store/session-store.js"; let RequirePlatformAdmin; let PlatformAdminPage; @@ -94,6 +95,8 @@ try { } function useMainAppRoutes() { + const { role } = useSessionStore((state) => state?.sessionDetails); + const routes = ( <> }> @@ -108,7 +111,7 @@ function useMainAppRoutes() { {UnstractUsagePage && ( } /> )} - {UnstractSubscriptionPage && ( + {UnstractSubscriptionPage && role === UNSTRACT_ADMIN && ( } /> )} } />