Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

UN-3008 [FIX] Pass word-level confidence setting to Structure Tool (#1714)

Deepak K79ea7a348c33
diff --git a/backend/sample.env b/backend/sample.env
index 08658931e..1ecff5111 100644
--- a/backend/sample.env
+++ b/backend/sample.env
@@ -89,9 +89,9 @@ PROMPT_STUDIO_FILE_PATH=/app/prompt-studio-data
# 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.94"
+STRUCTURE_TOOL_IMAGE_URL="docker:unstract/tool-structure:0.0.95"
STRUCTURE_TOOL_IMAGE_NAME="unstract/tool-structure"
-STRUCTURE_TOOL_IMAGE_TAG="0.0.94"
+STRUCTURE_TOOL_IMAGE_TAG="0.0.95"
# Feature Flags
EVALUATION_SERVER_IP=unstract-flipt
diff --git a/tools/structure/src/config/properties.json b/tools/structure/src/config/properties.json
index 6726c9dc3..146691eb0 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.94",
+ "toolVersion": "0.0.95",
"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/structure/src/constants.py b/tools/structure/src/constants.py
index 2175a0a95..b4944e3f8 100644
--- a/tools/structure/src/constants.py
+++ b/tools/structure/src/constants.py
@@ -63,6 +63,7 @@ class SettingsKeys:
FILE_NAME = "file_name"
FILE_HASH = "file_hash"
ENABLE_HIGHLIGHT = "enable_highlight"
+ ENABLE_WORD_CONFIDENCE = "enable_word_confidence"
NAME = "name"
INCLUDE_METADATA = "include_metadata"
TABLE_SETTINGS = "table_settings"
diff --git a/tools/structure/src/main.py b/tools/structure/src/main.py
index 3900533cf..a097886c7 100644
--- a/tools/structure/src/main.py
+++ b/tools/structure/src/main.py
@@ -160,6 +160,9 @@ class StructureTool(BaseTool):
)
challenge_llm: str = settings.get(SettingsKeys.CHALLENGE_LLM_ADAPTER_ID, "")
is_highlight_enabled: bool = settings.get(SettingsKeys.ENABLE_HIGHLIGHT, False)
+ is_word_confidence_enabled: bool = settings.get(
+ SettingsKeys.ENABLE_WORD_CONFIDENCE, False
+ )
responder: PromptTool = PromptTool(
tool=self,
prompt_port=self.get_env_or_die(SettingsKeys.PROMPT_PORT),
@@ -231,6 +234,7 @@ class StructureTool(BaseTool):
tool_settings[SettingsKeys.ENABLE_SINGLE_PASS_EXTRACTION] = is_single_pass_enabled
tool_settings[SettingsKeys.SUMMARIZE_AS_SOURCE] = is_summarization_enabled
tool_settings[SettingsKeys.ENABLE_HIGHLIGHT] = is_highlight_enabled
+ tool_settings[SettingsKeys.ENABLE_WORD_CONFIDENCE] = is_word_confidence_enabled
_, file_name = os.path.split(input_file)
if is_summarization_enabled:
file_name = SettingsKeys.SUMMARIZE