chore: 去掉代码中的警告

This commit is contained in:
CaptainB 2024-11-20 10:27:20 +08:00 committed by 刘瑞斌
parent 7985a3f1e0
commit 12d54aff80
3 changed files with 9 additions and 6 deletions

View File

@ -17,9 +17,10 @@ class OpenAIImage(MaxKBBaseModel, ChatOpenAI):
def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs): def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs):
optional_params = MaxKBBaseModel.filter_optional_params(model_kwargs) optional_params = MaxKBBaseModel.filter_optional_params(model_kwargs)
return OpenAIImage( return OpenAIImage(
model=model_name, model_name=model_name,
openai_api_base=model_credential.get('api_base'), openai_api_base=model_credential.get('api_base'),
openai_api_key=model_credential.get('api_key'), openai_api_key=model_credential.get('api_key'),
stream_options={"include_usage": True}, # stream_options={"include_usage": True},
streaming=True,
**optional_params, **optional_params,
) )

View File

@ -13,10 +13,11 @@ class QwenVLChatModel(MaxKBBaseModel, ChatOpenAI):
def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs): def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs):
optional_params = MaxKBBaseModel.filter_optional_params(model_kwargs) optional_params = MaxKBBaseModel.filter_optional_params(model_kwargs)
chat_tong_yi = QwenVLChatModel( chat_tong_yi = QwenVLChatModel(
model=model_name, model_name=model_name,
openai_api_key=model_credential.get('api_key'), openai_api_key=model_credential.get('api_key'),
openai_api_base='https://dashscope.aliyuncs.com/compatible-mode/v1', openai_api_base='https://dashscope.aliyuncs.com/compatible-mode/v1',
stream_options={"include_usage": True}, # stream_options={"include_usage": True},
streaming=True,
model_kwargs=optional_params, model_kwargs=optional_params,
) )
return chat_tong_yi return chat_tong_yi

View File

@ -17,9 +17,10 @@ class TencentVision(MaxKBBaseModel, ChatOpenAI):
def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs): def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs):
optional_params = MaxKBBaseModel.filter_optional_params(model_kwargs) optional_params = MaxKBBaseModel.filter_optional_params(model_kwargs)
return TencentVision( return TencentVision(
model=model_name, model_name=model_name,
openai_api_base='https://api.hunyuan.cloud.tencent.com/v1', openai_api_base='https://api.hunyuan.cloud.tencent.com/v1',
openai_api_key=model_credential.get('api_key'), openai_api_key=model_credential.get('api_key'),
stream_options={"include_usage": True}, # stream_options={"include_usage": True},
streaming=True,
**optional_params, **optional_params,
) )