fix: openai error
Some checks failed
sync2gitee / repo-sync (push) Has been cancelled

This commit is contained in:
wxg0103 2025-04-10 14:41:05 +08:00
parent 5243e42100
commit a4f27249ed

View File

@ -30,12 +30,15 @@ class OpenAIChatModel(MaxKBBaseModel, BaseChatOpenAI):
@staticmethod
def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs):
optional_params = MaxKBBaseModel.filter_optional_params(model_kwargs)
streaming = model_kwargs.get('streaming', True)
if 'o1' in model_name:
streaming = False
azure_chat_open_ai = OpenAIChatModel(
model=model_name,
openai_api_base=model_credential.get('api_base'),
openai_api_key=model_credential.get('api_key'),
**optional_params,
streaming=True,
streaming=streaming,
custom_get_token_ids=custom_get_token_ids
)
return azure_chat_open_ai