fix: o1-series model encounters an error when the generate mode is blocking (#8363)

This commit is contained in:
takatost 2024-09-13 15:37:54 +08:00 • committed by GitHub
commit 24af4b9313
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -615,8 +615,10 @@ class OpenAILargeLanguageModel(_CommonOpenAI, LargeLanguageModel):
block_as_stream = False block_as_stream = False
if model.startswith("o1"): if model.startswith("o1"):
if stream:
block_as_stream = True block_as_stream = True
stream = False stream = False
if "stream_options" in extra_model_kwargs: if "stream_options" in extra_model_kwargs:
del extra_model_kwargs["stream_options"] del extra_model_kwargs["stream_options"]