Skip to content

Commit

Permalink
fix: cohere (#976)
Browse files Browse the repository at this point in the history
* fix: cohere streaming

* bump litellm version to 1.35.33
  • Loading branch information
elisalimli authored May 1, 2024
1 parent 8d03c62 commit 0be4b5f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion libs/superagent/app/agents/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def __init__(
NOT_TOOLS_STREAMING_SUPPORTED_PROVIDERS = [
LLMProvider.GROQ,
LLMProvider.BEDROCK,
LLMProvider.COHERE_CHAT,
]

async def _execute_tool_calls(self, tool_calls: list[dict], **kwargs):
Expand Down Expand Up @@ -235,7 +236,10 @@ async def _completion(self, **kwargs) -> Any:
await self.streaming_callback.on_llm_start()

# TODO: Remove this when Groq and Bedrock supports streaming with tools
if self.llm_data.llm.provider in self.NOT_TOOLS_STREAMING_SUPPORTED_PROVIDERS:
if (
self.llm_data.llm.provider in self.NOT_TOOLS_STREAMING_SUPPORTED_PROVIDERS
and len(self.tools) > 0
):
logger.info(
f"Disabling streaming for {self.llm_data.llm.provider}, as tools are used"
)
Expand Down
8 changes: 4 additions & 4 deletions libs/superagent/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion libs/superagent/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ openai = "^1.1.1"
langchain-experimental = "^0.0.37"
pydub = "^0.25.1"
algoliasearch = "^3.0.0"
litellm = "1.35.21"
litellm = "1.35.33"
weaviate-client = "^3.25.3"
qdrant-client = "^1.6.9"
vecs = "^0.4.2"
Expand Down

0 comments on commit 0be4b5f

Please sign in to comment.