Skip to content

Commit a4f2724

Browse files
committed
fix: openai error
1 parent 5243e42 commit a4f2724

File tree

1 file changed

+4
-1
lines changed
  • apps/setting/models_provider/impl/openai_model_provider/model

1 file changed

+4
-1
lines changed

Diff for: apps/setting/models_provider/impl/openai_model_provider/model/llm.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@ def is_cache_model():
3030
@staticmethod
3131
def new_instance(model_type, model_name, model_credential: Dict[str, object], **model_kwargs):
3232
optional_params = MaxKBBaseModel.filter_optional_params(model_kwargs)
33+
streaming = model_kwargs.get('streaming', True)
34+
if 'o1' in model_name:
35+
streaming = False
3336
azure_chat_open_ai = OpenAIChatModel(
3437
model=model_name,
3538
openai_api_base=model_credential.get('api_base'),
3639
openai_api_key=model_credential.get('api_key'),
3740
**optional_params,
38-
streaming=True,
41+
streaming=streaming,
3942
custom_get_token_ids=custom_get_token_ids
4043
)
4144
return azure_chat_open_ai

0 commit comments

Comments
 (0)