Explorar el Código

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

tags/0.8.3
takatost hace 1 año
padre
commit
24af4b9313
No account linked to committer's email address
Se han modificado 1 ficheros con 6 adiciones y 4 borrados
  1. 6
    4
      api/core/model_runtime/model_providers/openai/llm/llm.py

+ 6
- 4
api/core/model_runtime/model_providers/openai/llm/llm.py Ver fichero

@@ -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"]

Cargando…
Cancelar
Guardar