Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(model_providers/ollama): Fix OllamaLargeLanguageModel to correctly set the stop option (#5217)

-LAN-7f44e88eda19
diff --git a/api/core/model_runtime/model_providers/ollama/llm/llm.py b/api/core/model_runtime/model_providers/ollama/llm/llm.py
index dd58a563abc..42a588e3dd5 100644
--- a/api/core/model_runtime/model_providers/ollama/llm/llm.py
+++ b/api/core/model_runtime/model_providers/ollama/llm/llm.py
@@ -195,7 +195,7 @@ class OllamaLargeLanguageModel(LargeLanguageModel):
data["options"] = model_parameters or {}
if stop:
- data["stop"] = "\n".join(stop)
+ data["options"]["stop"] = stop
completion_type = LLMMode.value_of(credentials["mode"])