forked from phoenix/litellm-mirror
fix: fix value error if model returns empty completion
This commit is contained in:
parent
6d81bcc248
commit
af2fd0e0de
21 changed files with 84 additions and 50 deletions
|
@ -111,12 +111,10 @@ def _generate_id(): # private helper function
|
|||
|
||||
def map_finish_reason(finish_reason: str): # openai supports 5 stop sequences - 'stop', 'length', 'function_call', 'content_filter', 'null'
|
||||
# anthropic mapping
|
||||
print(f"receives finish reason: {finish_reason}")
|
||||
if finish_reason == "stop_sequence":
|
||||
return "stop"
|
||||
return finish_reason
|
||||
|
||||
|
||||
class Message(OpenAIObject):
|
||||
def __init__(self, content="default", role="assistant", logprobs=None, **params):
|
||||
super(Message, self).__init__(**params)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue