提示最佳实践
与 OpenAI 模型相比,Anthropic 模型有几条提示最佳实践。 系统消息必须位于首位 Anthropic 模型要求任何系统消息都必须是你提示中的第一条消息。ChatAnthropic
ChatAnthropic 是 LangChain 的 ChatModel 的子类,这意味着它最适合与 ChatPromptTemplate 搭配使用。
你可以通过以下代码导入此封装器:
npm
ChatPromptTemplate。
以下是一个示例:
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

