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(types/utils.py): map finish reason to openai compatible

Krrish Dholakia1a97362b6e1b
diff --git a/litellm/types/utils.py b/litellm/types/utils.py
index 3e5465bdc24..81dc268aff5 100644
--- a/litellm/types/utils.py
+++ b/litellm/types/utils.py
@@ -501,7 +501,7 @@ class StreamingChoices(OpenAIObject):
):
super(StreamingChoices, self).__init__(**params)
if finish_reason:
- self.finish_reason = finish_reason
+ self.finish_reason = map_finish_reason(finish_reason)
else:
self.finish_reason = None
self.index = index