chore: 去掉代码中的警告
This commit is contained in:
parent
7985a3f1e0
commit
12d54aff80
@ -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,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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,
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user