Skip to content

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

prompt-studio helper changes for v2 porting (#675)

Rahul Johny98b881eaba11
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 82ba23fe7..d0d7890cd 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
@@ -785,9 +785,8 @@ class PromptStudioHelper:
vector_db = str(profile_manager.vector_store.id)
x2text_adapter = str(profile_manager.x2text.id)
extract_file_path: Optional[str] = None
-
+ directory, filename = os.path.split(file_path)
if not is_summary:
- directory, filename = os.path.split(file_path)
extract_file_path = os.path.join(
directory, "extract", os.path.splitext(filename)[0] + ".txt"
)
@@ -797,6 +796,7 @@ class PromptStudioHelper:
try:
usage_kwargs = {"run_id": run_id}
+ usage_kwargs["file_name"] = filename
util = PromptIdeBaseTool(log_level=LogLevel.INFO, org_id=org_id)
tool_index = Index(tool=util)
doc_id_key = tool_index.generate_index_key(