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
parent 6613b8f2e0
commit 24af4b9313
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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