mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
Support post-call guards for stream and non-stream responses
This commit is contained in:
parent
44184c4113
commit
b01cf5577c
8 changed files with 297 additions and 33 deletions
|
@ -3947,7 +3947,7 @@ def _count_characters(text: str) -> int:
|
|||
return len(filtered_text)
|
||||
|
||||
|
||||
def get_response_string(response_obj: ModelResponse) -> str:
|
||||
def get_response_string(response_obj: Union[ModelResponse, ModelResponseStream]) -> str:
|
||||
_choices: List[Union[Choices, StreamingChoices]] = response_obj.choices
|
||||
|
||||
response_str = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue