Skip to content

Commit

Permalink
fix: o1-series model encounters an error when the generate mode is bl…
Browse files Browse the repository at this point in the history
…ocking (langgenius#8363)
  • Loading branch information
takatost authored and lau-td committed Oct 23, 2024
1 parent 81796a2 commit 59ad54c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions api/core/model_runtime/model_providers/openai/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,12 @@ def _chat_generate(

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"]
Expand Down

0 comments on commit 59ad54c

Please sign in to comment.