diff --git a/lagent/llms/openai.py b/lagent/llms/openai.py index dede5285..2615ed8b 100644 --- a/lagent/llms/openai.py +++ b/lagent/llms/openai.py @@ -286,11 +286,12 @@ def streaming(raw_response): choice = response['choices'][0] if choice['finish_reason'] == 'stop': return - yield choice['delta']['content'] + yield choice['delta'].get('content', '') except Exception as exc: print( f'response {decoded} lead to exception of {str(exc)}' ) + raise assert isinstance(messages, list)