Skip to content

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

reverse-merge: Pass ENV from backend to tool (#1236) (#1250)

Chandrasekharan Mf00f7b16fac3
diff --git a/unstract/workflow-execution/src/unstract/workflow_execution/constants.py b/unstract/workflow-execution/src/unstract/workflow_execution/constants.py
index 04dd880fc..04c0d1fcf 100644
--- a/unstract/workflow-execution/src/unstract/workflow_execution/constants.py
+++ b/unstract/workflow-execution/src/unstract/workflow_execution/constants.py
@@ -20,6 +20,7 @@ class ToolRuntimeVariable:
X2TEXT_PORT = "X2TEXT_PORT"
ADAPTER_LLMW_POLL_INTERVAL = "ADAPTER_LLMW_POLL_INTERVAL"
ADAPTER_LLMW_MAX_POLLS = "ADAPTER_LLMW_MAX_POLLS"
+ ADAPTER_LLMW_WAIT_TIMEOUT = "ADAPTER_LLMW_WAIT_TIMEOUT"
EXECUTION_BY_TOOL = "EXECUTION_BY_TOOL"
WORKFLOW_EXECUTION_DIR_PREFIX = "WORKFLOW_EXECUTION_DIR_PREFIX"
API_EXECUTION_DIR_PREFIX = "API_EXECUTION_DIR_PREFIX"
diff --git a/unstract/workflow-execution/src/unstract/workflow_execution/tools_utils.py b/unstract/workflow-execution/src/unstract/workflow_execution/tools_utils.py
index c1d789c9b..e3f5ee7fc 100644
--- a/unstract/workflow-execution/src/unstract/workflow_execution/tools_utils.py
+++ b/unstract/workflow-execution/src/unstract/workflow_execution/tools_utils.py
@@ -52,6 +52,9 @@ class ToolsUtils:
self.llmw_max_polls = ToolsUtils.get_env(
ToolRV.ADAPTER_LLMW_MAX_POLLS, raise_exception=False
)
+ self.llmw_wait_timeout = ToolsUtils.get_env(
+ ToolRV.ADAPTER_LLMW_WAIT_TIMEOUT, raise_exception=False
+ )
self.redis_host = ToolsUtils.get_env(ToolRV.REDIS_HOST, raise_exception=True)
self.redis_port = ToolsUtils.get_env(ToolRV.REDIS_PORT, raise_exception=True)
self.redis_user = ToolsUtils.get_env(ToolRV.REDIS_USER, raise_exception=True)
@@ -235,6 +238,8 @@ class ToolsUtils:
platform_vars[ToolRV.ADAPTER_LLMW_POLL_INTERVAL] = self.llmw_poll_interval
if self.llmw_max_polls:
platform_vars[ToolRV.ADAPTER_LLMW_MAX_POLLS] = self.llmw_max_polls
+ if self.llmw_wait_timeout:
+ platform_vars[ToolRV.ADAPTER_LLMW_WAIT_TIMEOUT] = self.llmw_wait_timeout
return platform_vars
@staticmethod