From edf089862e003446687c61f8381ae4db6a2c0d4c Mon Sep 17 00:00:00 2001 From: Gayathri <142381512+gaya3-zipstack@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:37:29 +0530 Subject: [PATCH 1/2] Update pdm.lock for prompt_service (#479) * Update lock files * lock file update --- prompt-service/pdm.lock | 84 ++++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 35 deletions(-) diff --git a/prompt-service/pdm.lock b/prompt-service/pdm.lock index b6369da27..10ca43356 100644 --- a/prompt-service/pdm.lock +++ b/prompt-service/pdm.lock @@ -773,7 +773,7 @@ files = [ [[package]] name = "google-cloud-aiplatform" -version = "1.58.0" +version = "1.59.0" requires_python = ">=3.8" summary = "Vertex AI API client library" groups = ["default"] @@ -785,14 +785,14 @@ dependencies = [ "google-cloud-resource-manager<3.0.0dev,>=1.3.3", "google-cloud-storage<3.0.0dev,>=1.32.0", "packaging>=14.3", - "proto-plus<2.0.0dev,>=1.22.0", + "proto-plus<2.0.0dev,>=1.22.3", "protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5", "pydantic<3", "shapely<3.0.0dev", ] files = [ - {file = "google-cloud-aiplatform-1.58.0.tar.gz", hash = "sha256:7a05aceac4a6c7eaa26e684e9f202b829cc7e57f82bffe7281684275a553fcad"}, - {file = "google_cloud_aiplatform-1.58.0-py2.py3-none-any.whl", hash = "sha256:21f1320860f4916183ec939fdf2ff3fc1d7fdde97fe5795974257ab21f9458ec"}, + {file = "google-cloud-aiplatform-1.59.0.tar.gz", hash = "sha256:2bebb59c0ba3e3b4b568305418ca1b021977988adbee8691a5bed09b037e7e63"}, + {file = "google_cloud_aiplatform-1.59.0-py2.py3-none-any.whl", hash = "sha256:549e6eb1844b0f853043309138ebe2db00de4bbd8197b3bde26804ac163ef52a"}, ] [[package]] @@ -1782,7 +1782,7 @@ files = [ [[package]] name = "llama-index-readers-file" -version = "0.1.29" +version = "0.1.30" requires_python = "<4.0,>=3.8.1" summary = "llama-index readers file integration" groups = ["default"] @@ -1793,8 +1793,8 @@ dependencies = [ "striprtf<0.0.27,>=0.0.26", ] files = [ - {file = "llama_index_readers_file-0.1.29-py3-none-any.whl", hash = "sha256:b25f3dbf7bf3e0635290e499e808db5ba955eab67f205a3ff1cea6a4eb93556a"}, - {file = "llama_index_readers_file-0.1.29.tar.gz", hash = "sha256:f9f696e738383e7d14078e75958fba5a7030f7994a20586e3140e1ca41395a54"}, + {file = "llama_index_readers_file-0.1.30-py3-none-any.whl", hash = "sha256:d5f6cdd4685ee73103c68b9bc0dfb0d05439033133fc6bd45ef31ff41519e723"}, + {file = "llama_index_readers_file-0.1.30.tar.gz", hash = "sha256:32f40465f2a8a65fa5773e03c9f4dd55164be934ae67fad62113680436787d91"}, ] [[package]] @@ -3095,13 +3095,13 @@ files = [ [[package]] name = "setuptools" -version = "70.2.0" +version = "70.3.0" requires_python = ">=3.8" summary = "Easily download, build, install, upgrade, and uninstall Python packages" groups = ["default"] files = [ - {file = "setuptools-70.2.0-py3-none-any.whl", hash = "sha256:b8b8060bb426838fbe942479c90296ce976249451118ef566a5a0b7d8b78fb05"}, - {file = "setuptools-70.2.0.tar.gz", hash = "sha256:bd63e505105011b25c3c11f753f7e3b8465ea739efddaccef8f0efac2137bac1"}, + {file = "setuptools-70.3.0-py3-none-any.whl", hash = "sha256:fe384da74336c398e0d956d1cae0669bc02eed936cdb1d49b57de1990dc11ffc"}, + {file = "setuptools-70.3.0.tar.gz", hash = "sha256:f171bab1dfbc86b132997f26a119f6056a57950d058587841a0082e8830f9dc5"}, ] [[package]] @@ -3521,6 +3521,41 @@ files = [ {file = "ujson-5.10.0.tar.gz", hash = "sha256:b3cd8f3c5d8c7738257f1018880444f7b7d9b66232c64649f562d7ba86ad4bc1"}, ] +[[package]] +name = "unstract-adapters" +version = "0.21.0" +requires_python = "<3.12,>=3.9" +summary = "Unstract interface for LLMs, Embeddings and VectorDBs" +groups = ["default"] +dependencies = [ + "filetype~=1.2.0", + "httpx>=0.25.2", + "llama-index-embeddings-azure-openai==0.1.6", + "llama-index-embeddings-azure-openai==0.1.6", + "llama-index-embeddings-google==0.1.5", + "llama-index-embeddings-ollama==0.1.2", + "llama-index-llms-anthropic==0.1.11", + "llama-index-llms-anyscale==0.1.3", + "llama-index-llms-azure-openai==0.1.5", + "llama-index-llms-mistralai==0.1.10", + "llama-index-llms-ollama==0.1.3", + "llama-index-llms-palm==0.1.5", + "llama-index-llms-replicate==0.1.3", + "llama-index-llms-vertex==0.1.8", + "llama-index-vector-stores-milvus==0.1.18", + "llama-index-vector-stores-pinecone==0.1.4", + "llama-index-vector-stores-postgres==0.1.3", + "llama-index-vector-stores-qdrant==0.2.8", + "llama-index-vector-stores-weaviate==0.1.4", + "llama-index==0.10.38", + "llama-parse==0.4.1", + "singleton-decorator~=1.0.0", +] +files = [ + {file = "unstract_adapters-0.21.0-py3-none-any.whl", hash = "sha256:6c4f597602f55b80ba176a29a930755abd3494ff1c085f406536e7463902d655"}, + {file = "unstract_adapters-0.21.0.tar.gz", hash = "sha256:ebb8f80b7f26f04874bb5466fe0be8c3e1b51d44ed85c4e62289a7751c996af6"}, +] + [[package]] name = "unstract-core" version = "0.0.1" @@ -3557,35 +3592,14 @@ requires_python = "<3.11.1,>=3.9" summary = "A framework for writing Unstract Tools/Apps" groups = ["default"] dependencies = [ - "filetype~=1.2.0", - "httpx>=0.25.2", "jsonschema~=4.18.2", - "llama-index-embeddings-azure-openai==0.1.6", - "llama-index-embeddings-azure-openai==0.1.6", - "llama-index-embeddings-google==0.1.5", - "llama-index-embeddings-ollama==0.1.2", - "llama-index-llms-anthropic==0.1.11", - "llama-index-llms-anyscale==0.1.3", - "llama-index-llms-azure-openai==0.1.5", - "llama-index-llms-mistralai==0.1.10", - "llama-index-llms-ollama==0.1.3", - "llama-index-llms-palm==0.1.5", - "llama-index-llms-replicate==0.1.3", - "llama-index-llms-vertex==0.1.8", - "llama-index-vector-stores-milvus==0.1.18", - "llama-index-vector-stores-pinecone==0.1.4", - "llama-index-vector-stores-postgres==0.1.3", - "llama-index-vector-stores-qdrant==0.2.8", - "llama-index-vector-stores-weaviate==0.1.4", "llama-index==0.10.38", - "llama-index==0.10.38", - "llama-parse==0.4.1", "openai~=1.21.2", "python-dotenv==1.0.0", "python-magic~=0.4.27", - "singleton-decorator~=1.0.0", "tiktoken~=0.4.0", "transformers==4.37.0", + "unstract-adapters~=0.21.0", ] files = [ {file = "unstract_sdk-0.37.0-py3-none-any.whl", hash = "sha256:3bd83dfb7a760e73f35cc9ed4bdadf645bd77f03f77d25578e842156645e6f1d"}, @@ -3605,13 +3619,13 @@ files = [ [[package]] name = "validators" -version = "0.31.0" +version = "0.32.0" requires_python = ">=3.8" summary = "Python Data Validation for Humans™" groups = ["default"] files = [ - {file = "validators-0.31.0-py3-none-any.whl", hash = "sha256:e15a600d81555a4cd409b17bf55946c5edec7748e776afc85ed0a19bdee54e56"}, - {file = "validators-0.31.0.tar.gz", hash = "sha256:de7574fc56a231c788162f3e7da15bc2053c5ff9e0281d9ff1afb3a7b69498df"}, + {file = "validators-0.32.0-py3-none-any.whl", hash = "sha256:e9ce1703afb0adf7724b0f98e4081d9d10e88fa5d37254d21e41f27774c020cd"}, + {file = "validators-0.32.0.tar.gz", hash = "sha256:9ee6e6d7ac9292b9b755a3155d7c361d76bb2dce23def4f0627662da1e300676"}, ] [[package]] From e88815380e1516b3188a6c7b6f56d5070ad32086 Mon Sep 17 00:00:00 2001 From: jagadeeswaran-zipstack Date: Thu, 11 Jul 2024 18:05:24 +0530 Subject: [PATCH 2/2] Fix combined output and single pass (#480) * single pass metadata fix * combined output fix --------- Co-authored-by: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com> --- .../prompt_studio_helper.py | 3 +- .../combined-output/CombinedOutput.jsx | 1 + .../custom-tools/tool-ide/ToolIde.css | 85 ++++++++++--------- 3 files changed, 46 insertions(+), 43 deletions(-) diff --git a/backend/prompt_studio/prompt_studio_core/prompt_studio_helper.py b/backend/prompt_studio/prompt_studio_core/prompt_studio_helper.py index e1e8e76b5..8f07ac336 100644 --- a/backend/prompt_studio/prompt_studio_core/prompt_studio_helper.py +++ b/backend/prompt_studio/prompt_studio_core/prompt_studio_helper.py @@ -959,8 +959,9 @@ def _fetch_single_pass_response( prompt_host=settings.PROMPT_HOST, prompt_port=settings.PROMPT_PORT, ) + include_metadata = {TSPKeys.INCLUDE_METADATA: True} - answer = responder.single_pass_extraction(payload) + answer = responder.single_pass_extraction(payload, include_metadata) # TODO: Make use of dataclasses if answer["status"] == "ERROR": error_message = answer.get("error", None) diff --git a/frontend/src/components/custom-tools/combined-output/CombinedOutput.jsx b/frontend/src/components/custom-tools/combined-output/CombinedOutput.jsx index 980a80916..2c1f88d01 100644 --- a/frontend/src/components/custom-tools/combined-output/CombinedOutput.jsx +++ b/frontend/src/components/custom-tools/combined-output/CombinedOutput.jsx @@ -178,6 +178,7 @@ function CombinedOutput({ docId, setFilledFields }) { selectedProfile={selectedProfile} llmProfiles={llmProfiles} activeKey={activeKey} + adapterData={adapterData} /> ); } diff --git a/frontend/src/components/custom-tools/tool-ide/ToolIde.css b/frontend/src/components/custom-tools/tool-ide/ToolIde.css index 41cb40103..bf0b907b1 100644 --- a/frontend/src/components/custom-tools/tool-ide/ToolIde.css +++ b/frontend/src/components/custom-tools/tool-ide/ToolIde.css @@ -1,103 +1,104 @@ /* Styles for ToolIde */ .tool-ide-layout { - background-color: var(--page-bg-2); - height: 100%; - display: flex; - flex-direction: column; + background-color: var(--page-bg-2); + height: 100%; + display: flex; + flex-direction: column; } .tool-ide-body { - flex: 1; - overflow-y: hidden; + flex: 1; + overflow-y: hidden; } .tool-ide-body-2 { - display: flex; - flex-direction: column; - height: 100%; + display: flex; + flex-direction: column; + height: 100%; } .tool-ide-main { - flex-grow: 1; - overflow-y: hidden; + flex-grow: 1; + overflow-y: hidden; } .tool-ide-col { - height: 100%; + height: 100%; } .tool-ide-main-row { - height: 100%; + height: 100%; } .tool-ide-footer { - padding: 0px 12px 12px 12px; + padding: 0px 12px 12px 12px; } .tool-ide-prompts { - padding: 12px 6px 1px 12px; - height: 100%; + padding: 12px 6px 1px 12px; + height: 100% !important; } .tool-ide-pdf { - padding: 12px 12px 1px 6px; - height: 100%; + padding: 12px 12px 1px 6px; + height: 100%; } -.tool-ide-prompts > div, .tool-ide-pdf > div { - background-color: var(--white); - height: 100%; +.tool-ide-prompts > div, +.tool-ide-pdf > div { + background-color: var(--white); + height: 100%; } .tool-ide-actions { - padding: 0px 12px; + padding: 0px 12px; } .tool-ide-logs { - height: 10vh; + height: 10vh; } .tool-ide-sider { - background-color: transparent !important; - height: 100%; + background-color: transparent !important; + height: 100%; } .tool-ide-sider-layout { - height: 100%; - background-color: transparent !important; + height: 100%; + background-color: transparent !important; } .tool-ide-sider-btn { - position: fixed; - transform: translate(-50%, 100%); - z-index: 1; - transition: "left 0.1s linear"; + position: fixed; + transform: translate(-50%, 100%); + z-index: 1; + transition: "left 0.1s linear"; } .tool-ide-collapse-panel { - background-color: var(--white); - border: none; - border-radius: 0px; + background-color: var(--white); + border: none; + border-radius: 0px; } /* Remove padding from modal content */ .custom-modal-wrapper .ant-modal-content { - padding: 0; - height: 90vh; - overflow-y: auto; + padding: 0; + height: 90vh; + overflow-y: auto; } .custom-modal-wrapper .tools-prompts-header-layout { - border-radius: 5px 5px 0px 0px; + border-radius: 5px 5px 0px 0px; } .custom-modal-gen-index .ant-modal { - top: 20px; - right: 20px; - position: absolute !important; + top: 20px; + right: 20px; + position: absolute !important; } .tool-ide-main-card .card-text { - font-size: 12px; + font-size: 12px; }