Skip to content

Commit 74ce83c

Browse files
UN-2805 [FEAT] Add user_data parameter for API deployment variable replacement overrides (#201)
UN-2805 Add user_data parameter for API deployment variable replacement overrides - Added USER_DATA constant to MetadataKey class for user data handling - Updated BaseTool to extract and store user_data from execution metadata - Version bump to v0.77.2 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <[email protected]>
1 parent 4afc1f2 commit 74ce83c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/unstract/sdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "v0.77.1"
1+
__version__ = "v0.77.2"
22

33

44
def get_sdk_version() -> str:

src/unstract/sdk/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ class MetadataKey:
135135
OUTPUT = "output"
136136
OUTPUT_TYPE = "output_type"
137137
LLM_PROFILE_ID = "llm_profile_id"
138+
USER_DATA = "user_data"
138139

139140

140141
class ToolSettingsKey:

src/unstract/sdk/tool/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def from_tool_args(cls, args: list[str]) -> "BaseTool":
9494
tool.source_file_name = tool._exec_metadata.get(MetadataKey.SOURCE_NAME, "")
9595
tool.org_id = tool._exec_metadata.get(MetadataKey.ORG_ID)
9696
tool.llm_profile_id = tool._exec_metadata.get(MetadataKey.LLM_PROFILE_ID)
97+
tool.user_data = tool._exec_metadata.get(MetadataKey.USER_DATA, {})
9798
return tool
9899

99100
def elapsed_time(self) -> float:
@@ -132,7 +133,9 @@ def _get_file_from_data_dir(self, file_to_get: str, raise_err: bool = False) ->
132133
base_path = self.execution_dir
133134
file_path = base_path / file_to_get
134135
if raise_err and not self.workflow_filestorage.exists(path=file_path):
135-
self.stream_error_and_exit(f"{file_to_get} is missing in EXECUTION_DATA_DIR")
136+
self.stream_error_and_exit(
137+
f"{file_to_get} is missing in EXECUTION_DATA_DIR"
138+
)
136139

137140
return str(file_path)
138141

0 commit comments

Comments
 (0)