소스 검색

Merge pull request #9010 from Shadowfita/patch-1

fix: Include empty delta object on openai_chat_chunk_message_template per OpenAI API documentation
Timothy Jaeryang Baek 3 달 전
부모
커밋
8c7e52e5a1
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      backend/open_webui/utils/misc.py

+ 1 - 0
backend/open_webui/utils/misc.py

@@ -149,6 +149,7 @@ def openai_chat_chunk_message_template(
         template["choices"][0]["delta"] = {"content": message}
     else:
         template["choices"][0]["finish_reason"] = "stop"
+        template["choices"][0]["delta"] = {}
 
     if usage:
         template["usage"] = usage