Skip to content

Commit 4952c41

Browse files
FIX : Fixed output path for tools (#11)
* Fixed issue in output file path for tools * Bump patch version
1 parent ab10d29 commit 4952c41

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
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__ = "0.12.0"
1+
__version__ = "0.12.1"
22

33

44
def get_sdk_version():

src/unstract/sdk/index.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def index_file(
105105
chunk_overlap: int,
106106
reindex: bool = False,
107107
file_hash: Optional[str] = None,
108-
is_summary: bool = False,
108+
output_file_path: Optional[str] = None,
109109
):
110110
# Make file content hash if not available
111111
if not file_hash:
@@ -117,13 +117,7 @@ def index_file(
117117
x2text_adapter_inst: X2TextAdapter = x2text.get_x2text(
118118
adapter_instance_id=x2text_adapter
119119
)
120-
extract_file_path = None
121-
if not is_summary:
122-
directory, filename = os.path.split(file_path)
123-
extract_file_path: str = os.path.join(
124-
directory, "extract", os.path.splitext(filename)[0] + ".txt"
125-
)
126-
extracted_text = x2text_adapter_inst.process(input_file_path=file_path, output_file_path=extract_file_path)
120+
extracted_text = x2text_adapter_inst.process(input_file_path=file_path, output_file_path=output_file_path)
127121
full_text.append(
128122
{
129123
"section": "full",

0 commit comments

Comments
 (0)