mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
(Bug Fix - Langfuse) - fix for when model response has choices=[]
(#8339)
* refactor _get_langfuse_input_output_content * test_langfuse_logging_completion_with_malformed_llm_response * fix _get_langfuse_input_output_content * fixes for langfuse linting * unit testing for get chat/text content for langfuse * fix _should_raise_content_policy_error
This commit is contained in:
parent
92ba180adc
commit
39d616f22d
7 changed files with 352 additions and 119 deletions
|
@ -3699,8 +3699,9 @@ class Router:
|
|||
|
||||
Else, original response is returned.
|
||||
"""
|
||||
if response.choices[0].finish_reason != "content_filter":
|
||||
return False
|
||||
if response.choices and len(response.choices) > 0:
|
||||
if response.choices[0].finish_reason != "content_filter":
|
||||
return False
|
||||
|
||||
content_policy_fallbacks = kwargs.get(
|
||||
"content_policy_fallbacks", self.content_policy_fallbacks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue