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

Co-authored-by: Omkar Malpure <omkarmalpure@Omkars-MacBook-Pro.local>
This commit is contained in:
Omkar Malpure 2025-11-28 11:29:24 +05:30 committed by GitHub
parent 8aa4f3d476
commit bbea83fd93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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