Skip to content

Commit

Permalink
Bumped SDK for backend and structure tool to fix chunking issue on in…
Browse files Browse the repository at this point in the history
…dexing
  • Loading branch information
chandrasekharan-zipstack committed Aug 30, 2024
1 parent 5d120b1 commit 84e7340
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
"python-socketio==5.9.0", # For log_events
"social-auth-app-django==5.3.0", # For OAuth
"social-auth-core==4.4.2", # For OAuth
"unstract-sdk~=0.46.0",
"unstract-sdk~=0.48.0",
# ! IMPORTANT!
# Indirect local dependencies usually need to be added in their own projects
# as: https://pdm-project.org/latest/usage/dependency/#local-dependencies.
Expand Down
5 changes: 2 additions & 3 deletions prompt-service/src/unstract/prompt_service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def prompt_processor() -> Any:
doc_name = str(payload.get(PSKeys.FILE_NAME, ""))
log_events_id: str = payload.get(PSKeys.LOG_EVENTS_ID, "")
structured_output: dict[str, Any] = {}
metadata: Optional[dict[str, Any]] = {
metadata: dict[str, Any] = {
PSKeys.RUN_ID: run_id,
PSKeys.CONTEXT: {},
}
Expand Down Expand Up @@ -276,8 +276,6 @@ def prompt_processor() -> Any:
)

try:
vector_index = vector_db.get_vector_store_index()

context = ""
if output[PSKeys.CHUNK_SIZE] == 0:
# We can do this only for chunkless indexes
Expand Down Expand Up @@ -374,6 +372,7 @@ def prompt_processor() -> Any:
retrieval_strategy = output.get(PSKeys.RETRIEVAL_STRATEGY)

if retrieval_strategy in {PSKeys.SIMPLE, PSKeys.SUBQUESTION}:
vector_index = vector_db.get_vector_store_index()
answer, context = run_retrieval(
tool_settings=tool_settings,
output=output,
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.46.0
unstract-sdk~=0.48.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.40",
"toolVersion": "0.0.41",
"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

0 comments on commit 84e7340

Please sign in to comment.