Skip to content

Commit 91c1be1

Browse files
Added support for calling summarize (#56)
1 parent 0e76774 commit 91c1be1

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
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.28.0"
1+
__version__ = "0.29.0"
22

33

44
def get_sdk_version():

src/unstract/sdk/embedding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(
2222
self,
2323
tool: BaseTool,
2424
adapter_instance_id: str,
25-
usage_kwargs: dict[Any, Any] = None,
25+
usage_kwargs: dict[Any, Any] = {},
2626
):
2727
self._tool = tool
2828
self._adapter_instance_id = adapter_instance_id

src/unstract/sdk/index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def get_text_from_index(
3232
embedding_instance_id: str,
3333
vector_db_instance_id: str,
3434
doc_id: str,
35-
usage_kwargs: dict[Any, Any] = None,
35+
usage_kwargs: dict[Any, Any] = {},
3636
):
3737
try:
3838
embedding = Embedding(
@@ -126,7 +126,7 @@ def index_file(
126126
reindex: bool = False,
127127
file_hash: Optional[str] = None,
128128
output_file_path: Optional[str] = None,
129-
usage_kwargs: dict[Any, Any] = None,
129+
usage_kwargs: dict[Any, Any] = {},
130130
) -> str:
131131
"""Indexes an individual file using the passed arguments.
132132

src/unstract/sdk/llm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(
3131
self,
3232
tool: BaseTool,
3333
adapter_instance_id: str,
34-
usage_kwargs: dict[Any, Any] = None,
34+
usage_kwargs: dict[Any, Any] = {},
3535
):
3636
"""
3737

src/unstract/sdk/prompt.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ def answer_prompt(self, payload: dict[str, Any]) -> dict[str, Any]:
3737
def single_pass_extraction(self, payload: dict[str, Any]) -> dict[str, Any]:
3838
return self._post_call("single-pass-extraction", payload)
3939

40+
def summarize(self, payload: dict[str, Any]) -> dict[str, Any]:
41+
return self._post_call("summarize", payload)
42+
4043
def _post_call(self, url_path: str, payload: dict[str, Any]) -> dict[str, Any]:
4144
"""Invokes and communicates to prompt service to fetch response for the
4245
prompt.

0 commit comments

Comments
 (0)