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.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: anthropic system prompt not working (#2885)
Su Yang2dee8a25d549
diff --git a/api/core/model_runtime/model_providers/anthropic/llm/llm.py b/api/core/model_runtime/model_providers/anthropic/llm/llm.pyindex ad74179353d..724a0401b70 100644--- a/api/core/model_runtime/model_providers/anthropic/llm/llm.py+++ b/api/core/model_runtime/model_providers/anthropic/llm/llm.py@@ -342,12 +342,20 @@ class AnthropicLargeLanguageModel(LargeLanguageModel):Convert prompt messages to dict list and system"""system = ""- prompt_message_dicts = []-+ first_loop = Truefor message in prompt_messages:if isinstance(message, SystemPromptMessage):- system += message.content + ("\n" if not system else "")- else:+ message.content=message.content.strip()+ if first_loop:+ system=message.content+ first_loop=False+ else:+ system+="\n"+ system+=message.content++ prompt_message_dicts = []+ for message in prompt_messages:+ if not isinstance(message, SystemPromptMessage):prompt_message_dicts.append(self._convert_prompt_message_to_dict(message))return system, prompt_message_dicts