Skip to content

Commit

Permalink
FIX: Changes for new highlight (#124)
Browse files Browse the repository at this point in the history
* Changes for new highlight

* SDK version bump
  • Loading branch information
Deepak-Kesavan authored Nov 19, 2024
1 parent 20b23cc commit 8a4951c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/unstract/sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.53.1"
__version__ = "0.53.2"


def get_sdk_version():
Expand Down
10 changes: 5 additions & 5 deletions src/unstract/sdk/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,18 @@ def complete(
try:
response: CompletionResponse = self._llm_instance.complete(prompt, **kwargs)
process_text_output = {}
if extract_json:
match = LLM.json_regex.search(response.text)
if match:
response.text = match.group(0)
if process_text:
try:
process_text_output = process_text(response, LLM.json_regex)
process_text_output = process_text(response, extract_json)
if not isinstance(process_text_output, dict):
process_text_output = {}
except Exception as e:
logger.error(f"Error occured inside function 'process_text': {e}")
process_text_output = {}
if extract_json:
match = LLM.json_regex.search(response.text)
if match:
response.text = match.group(0)
return {LLM.RESPONSE: response, **process_text_output}
except Exception as e:
raise parse_llm_err(e) from e
Expand Down

0 comments on commit 8a4951c

Please sign in to comment.