fix: 修复【API 接口】应用对话接口 stream false ,提问报错
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
shaohuzhang1 2024-09-25 17:21:23 +08:00 committed by shaohuzhang1
parent 583a9c62d3
commit 8c32125c56
2 changed files with 3 additions and 2 deletions

View File

@ -208,7 +208,7 @@ class OpenAIChatSerializer(serializers.Serializer):
'stream': stream,
'application_id': application_id,
'client_id': client_id,
'client_type': client_type}).chat(
'client_type': client_type, 'form_data': instance.get('form_data', {})}).chat(
base_to_response=OpenaiToResponse())

View File

@ -126,7 +126,8 @@ class ChatView(APIView):
'application_id': (request.auth.keywords.get(
'application_id') if request.auth.client_type == AuthenticationType.APPLICATION_ACCESS_TOKEN.value else None),
'client_id': request.auth.client_id,
'form_data': (request.data.get('form_data') if 'form_data' in request.data else []),
'form_data': (request.data.get(
'form_data') if 'form_data' in request.data else {}),
'client_type': request.auth.client_type}).chat()
@action(methods=['GET'], detail=False)