Skip to content

Commit

Permalink
fix: Fixed parse_llm_err by passing the LLM adapter class correctly (#…
Browse files Browse the repository at this point in the history
…135)

Fixed parse_llm_err by passing the LLM adapter class correctly
  • Loading branch information
chandrasekharan-zipstack authored Dec 18, 2024
1 parent c1a6ed0 commit 8a22759
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.54.0rc6"
__version__ = "0.54.0rc7"


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 @@ -109,7 +109,7 @@ def complete(
process_text_output = {}
return {LLM.RESPONSE: response, **process_text_output}
except Exception as e:
raise parse_llm_err(e, self._llm_instance) from e
raise parse_llm_err(e, self._llm_adapter_class) from e

def stream_complete(
self,
Expand All @@ -122,7 +122,7 @@ def stream_complete(
)
return response
except Exception as e:
raise parse_llm_err(e, self._llm_instance) from e
raise parse_llm_err(e, self._llm_adapter_class) from e

def _get_llm(self, adapter_instance_id: str) -> LlamaIndexLLM:
"""Returns the LLM object for the tool.
Expand All @@ -147,9 +147,9 @@ def _get_llm(self, adapter_instance_id: str) -> LlamaIndexLLM:
Common.ADAPTER
]
llm_metadata = llm_config_data.get(Common.ADAPTER_METADATA)
llm_adapter_class: LLMAdapter = llm_adapter(llm_metadata)
self._usage_kwargs["provider"] = llm_adapter_class.get_provider()
llm_instance: LLM = llm_adapter_class.get_llm_instance()
self._llm_adapter_class: LLMAdapter = llm_adapter(llm_metadata)
self._usage_kwargs["provider"] = self._llm_adapter_class.get_provider()
llm_instance: LLM = self._llm_adapter_class.get_llm_instance()
return llm_instance
except Exception as e:
self._tool.stream_log(
Expand Down

0 comments on commit 8a22759

Please sign in to comment.