Skip to content

Commit

Permalink
Updated indexer,structure,text-extractor to use 0.13.0 SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
chandrasekharan-zipstack committed Mar 1, 2024
1 parent 62bf9dd commit aeee5a7
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion tools/indexer/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Add your dependencies here

# Required for all unstract tools
unstract-sdk~=0.11.1
unstract-sdk~=0.13.0
2 changes: 1 addition & 1 deletion tools/indexer/src/config/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schemaVersion": "0.0.1",
"displayName": "Document Indexer",
"functionName": "document_indexer",
"toolVersion": "0.0.1",
"toolVersion": "0.0.2",
"description": "Used to index documents in the specified vector DB / embedding.",
"input": {
"description": "Document that needs to be indexed"
Expand Down
11 changes: 1 addition & 10 deletions tools/indexer/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def run(
tool_index = ToolIndex(tool=self)
self.stream_log("Indexing document...")
try:
tool_index.index_file(
index_key = tool_index.index_file(
tool_id=self.workflow_id,
embedding_type=settings[ToolSettingsKey.EMBEDDING_ADAPTER_ID],
vector_db=settings[ToolSettingsKey.VECTOR_DB_ADAPTER_ID],
Expand All @@ -47,15 +47,6 @@ def run(
)
except Exception as e:
self.stream_error_and_exit(f"Error fetching data and indexing: {e}")
index_key = ToolIndex.generate_file_id(
tool_id=self.workflow_id,
file_hash=file_hash,
vector_db=settings[ToolSettingsKey.VECTOR_DB_ADAPTER_ID],
embedding=settings[ToolSettingsKey.EMBEDDING_ADAPTER_ID],
x2text=settings[ToolSettingsKey.X2TEXT_ADAPTER_ID],
chunk_size=settings[SettingsKeys.CHUNK_SIZE],
chunk_overlap=settings[SettingsKeys.CHUNK_OVERLAP],
)
# Update GUI
input_log = (
"### Indexing file\n"
Expand Down
2 changes: 1 addition & 1 deletion tools/structure/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Add your dependencies here

# Required for all unstract tools
unstract-sdk~=0.11.1
unstract-sdk~=0.13.0
2 changes: 1 addition & 1 deletion tools/structure/src/config/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schemaVersion": "0.0.1",
"displayName": "Structure Tool",
"functionName": "structure_tool",
"toolVersion": "0.0.1",
"toolVersion": "0.0.2",
"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"
Expand Down
2 changes: 1 addition & 1 deletion tools/text_extractor/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Add your dependencies here

# Required for all unstract tools
unstract-sdk~=0.11.1
unstract-sdk~=0.13.0
2 changes: 1 addition & 1 deletion tools/text_extractor/src/config/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schemaVersion": "0.0.1",
"displayName": "Text Extractor",
"functionName": "text_extractor",
"toolVersion": "0.0.2-v2",
"toolVersion": "0.0.2",
"description": "The Text Extractor is a powerful tool designed to convert documents to its text form or Extract texts from documents",
"input": {
"description": "Document"
Expand Down

0 comments on commit aeee5a7

Please sign in to comment.