From 002902dfdd7df18bd88e288d1b1f372162730a25 Mon Sep 17 00:00:00 2001 From: donbr Date: Fri, 15 Mar 2024 12:11:24 -0700 Subject: [PATCH] Refactor Anthropic import to langchain_anthropic and update model to v3 (#524) - Transition Anthropic API import to the langchain_anthropic package for enhanced compatibility. - Upgrade the AI model to claude-3-sonnet-20240229 for improved performance and features. --------- Co-authored-by: Eugene Yurtsev --- examples/chat_playground/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/chat_playground/server.py b/examples/chat_playground/server.py index 4b80eb38..ddf6aafb 100755 --- a/examples/chat_playground/server.py +++ b/examples/chat_playground/server.py @@ -5,7 +5,7 @@ from typing import List, Union from fastapi import FastAPI -from langchain.chat_models import ChatAnthropic +from langchain_anthropic.chat_models import ChatAnthropic from langchain_core.messages import AIMessage, HumanMessage, SystemMessage from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder @@ -27,7 +27,7 @@ ] ) -chain = prompt | ChatAnthropic(model="claude-2") +chain = prompt | ChatAnthropic(model_name="claude-3-sonnet-20240229") class InputChat(BaseModel):