소스 검색

fix: add completion mode object check (#3515)

tags/0.6.3
Yeuoly 1 년 전
부모
커밋
fbd3ef8752
No account linked to committer's email address
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3
    0
      api/core/model_runtime/model_providers/openai_api_compatible/llm/llm.py

+ 3
- 0
api/core/model_runtime/model_providers/openai_api_compatible/llm/llm.py 파일 보기

@@ -152,6 +152,9 @@ class OAIAPICompatLargeLanguageModel(_CommonOAI_API_Compat, LargeLanguageModel):

if (completion_type is LLMMode.CHAT and json_result['object'] == ''):
json_result['object'] = 'chat.completion'
elif (completion_type is LLMMode.COMPLETION and json_result['object'] == ''):
json_result['object'] = 'text_completion'
if (completion_type is LLMMode.CHAT
and ('object' not in json_result or json_result['object'] != 'chat.completion')):
raise CredentialsValidateFailedError(

Loading…
취소
저장