Skip to content

Commit

Permalink
Merge pull request #2750 from danswer-ai/hotfix/v0.7-bedrock
Browse files Browse the repository at this point in the history
backport Update litellm to fix bedrock models (#2649)
  • Loading branch information
rkuo-danswer authored Oct 9, 2024
2 parents 0ae9f6e + fd8644d commit 7f9fdbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions backend/danswer/llm/chat_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,12 @@ def _completion(
return litellm.completion(
# model choice
model=f"{self.config.model_provider}/{self.config.model_name}",
api_key=self._api_key,
base_url=self._api_base,
api_version=self._api_version,
custom_llm_provider=self._custom_llm_provider,
# NOTE: have to pass in None instead of empty string for these
# otherwise litellm can have some issues with bedrock
api_key=self._api_key or None,
base_url=self._api_base or None,
api_version=self._api_version or None,
custom_llm_provider=self._custom_llm_provider or None,
# actual input
messages=prompt,
tools=tools,
Expand Down
2 changes: 1 addition & 1 deletion backend/requirements/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jsonref==1.1.0
langchain==0.1.17
langchain-core==0.1.50
langchain-text-splitters==0.0.1
litellm==1.47.1
litellm==1.48.7
llama-index==0.9.45
Mako==1.2.4
msal==1.28.0
Expand Down

0 comments on commit 7f9fdbd

Please sign in to comment.