From 930a9812f7db1da26d0109a652f02e810e6d304b Mon Sep 17 00:00:00 2001 From: xuyuan23 <643854343@qq.com> Date: Mon, 27 Nov 2023 19:56:29 +0800 Subject: [PATCH] fix chat completions api --- pilot/openapi/api_v1/api_v1.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pilot/openapi/api_v1/api_v1.py b/pilot/openapi/api_v1/api_v1.py index fde191953..a3c9b9dcc 100644 --- a/pilot/openapi/api_v1/api_v1.py +++ b/pilot/openapi/api_v1/api_v1.py @@ -438,7 +438,7 @@ async def chat_completions(dialogue: ConversationVo = Body(), user_token: UserRe with root_tracer.start_span( "get_chat_instance", span_type=SpanType.CHAT, metadata=dialogue.dict() ): - chat: BaseChat = await get_chat_instance(dialogue) + chat: BaseChat = await get_chat_instance(dialogue, user_token.user_id) # background_tasks = BackgroundTasks() # background_tasks.add_task(release_model_semaphore) headers = { @@ -462,7 +462,6 @@ async def chat_completions(dialogue: ConversationVo = Body(), user_token: UserRe print( f"chat_completions:{dialogue.chat_mode},{dialogue.select_param},{dialogue.model_name}" ) - chat: BaseChat = get_chat_instance(dialogue, user_token.user_id) # background_tasks = BackgroundTasks() # background_tasks.add_task(release_model_semaphore)