Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Fix : acompletion throws error with SambaNova models (#17217)

Omkar Malpurebbea83fd9366
diff --git a/litellm/llms/sambanova/chat.py b/litellm/llms/sambanova/chat.py
index b0534347c9a..2218c808721 100644
--- a/litellm/llms/sambanova/chat.py
+++ b/litellm/llms/sambanova/chat.py
@@ -121,5 +121,10 @@ class SambanovaConfig(OpenAIGPTConfig):
SambaNova API doesn't support content as a list - only string content.
This converts content lists like [{"type": "text", "text": "..."}] to strings.
"""
+ async def _async_transform():
+ return handle_messages_with_content_list_to_str_conversion(messages)
+
+ if is_async:
+ return _async_transform()
messages = handle_messages_with_content_list_to_str_conversion(messages)
return messages