From e37070a98502001c2ac32116f7fd59deef7ec475 Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Thu, 26 Dec 2024 15:14:06 +0800 Subject: [PATCH] fix(requester): unmatched params (#967) --- pkg/provider/modelmgr/requesters/chatcmpl.py | 2 +- pkg/provider/modelmgr/requesters/deepseekchatcmpl.py | 3 +-- pkg/provider/modelmgr/requesters/giteeaichatcmpl.py | 3 ++- pkg/provider/modelmgr/requesters/moonshotchatcmpl.py | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/provider/modelmgr/requesters/chatcmpl.py b/pkg/provider/modelmgr/requesters/chatcmpl.py index 76af459f..a4119b60 100644 --- a/pkg/provider/modelmgr/requesters/chatcmpl.py +++ b/pkg/provider/modelmgr/requesters/chatcmpl.py @@ -124,7 +124,7 @@ class OpenAIChatCompletions(requester.LLMAPIRequester): req_messages.append(msg_dict) try: - return await self._closure(query, req_messages, model, funcs) + return await self._closure(query=query, req_messages=req_messages, use_model=model, use_funcs=funcs) except asyncio.TimeoutError: raise errors.RequesterError('请求超时') except openai.BadRequestError as e: diff --git a/pkg/provider/modelmgr/requesters/deepseekchatcmpl.py b/pkg/provider/modelmgr/requesters/deepseekchatcmpl.py index 6651ca6f..bf414745 100644 --- a/pkg/provider/modelmgr/requesters/deepseekchatcmpl.py +++ b/pkg/provider/modelmgr/requesters/deepseekchatcmpl.py @@ -1,7 +1,5 @@ from __future__ import annotations -from ....core import app - from . import chatcmpl from .. import entities, errors, requester from ....core import entities as core_entities, app @@ -19,6 +17,7 @@ class DeepseekChatCompletions(chatcmpl.OpenAIChatCompletions): async def _closure( self, + query: core_entities.Query, req_messages: list[dict], use_model: entities.LLMModelInfo, use_funcs: list[tools_entities.LLMFunction] = None, diff --git a/pkg/provider/modelmgr/requesters/giteeaichatcmpl.py b/pkg/provider/modelmgr/requesters/giteeaichatcmpl.py index 1104c015..d737f235 100644 --- a/pkg/provider/modelmgr/requesters/giteeaichatcmpl.py +++ b/pkg/provider/modelmgr/requesters/giteeaichatcmpl.py @@ -8,7 +8,7 @@ import typing from . import chatcmpl from .. import entities, errors, requester -from ....core import app +from ....core import app, entities as core_entities from ... import entities as llm_entities from ...tools import entities as tools_entities from .. import entities as modelmgr_entities @@ -24,6 +24,7 @@ class GiteeAIChatCompletions(chatcmpl.OpenAIChatCompletions): async def _closure( self, + query: core_entities.Query, req_messages: list[dict], use_model: entities.LLMModelInfo, use_funcs: list[tools_entities.LLMFunction] = None, diff --git a/pkg/provider/modelmgr/requesters/moonshotchatcmpl.py b/pkg/provider/modelmgr/requesters/moonshotchatcmpl.py index caecfd52..95c4aaf5 100644 --- a/pkg/provider/modelmgr/requesters/moonshotchatcmpl.py +++ b/pkg/provider/modelmgr/requesters/moonshotchatcmpl.py @@ -19,6 +19,7 @@ class MoonshotChatCompletions(chatcmpl.OpenAIChatCompletions): async def _closure( self, + query: core_entities.Query, req_messages: list[dict], use_model: entities.LLMModelInfo, use_funcs: list[tools_entities.LLMFunction] = None,