From 944b93bf61c834269cd6b2f21f930e08fe4b1c48 Mon Sep 17 00:00:00 2001 From: William FH <13333726+hinthornw@users.noreply.github.com> Date: Thu, 13 Mar 2025 06:03:18 -0700 Subject: [PATCH] docs: more concise readme (#3815) --- README.md | 6 ++---- libs/langgraph/README.md | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a529a1af8..5f5cd6acf 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ pip install -U langgraph To learn more about how to use LangGraph, check out [the docs](https://langchain-ai.github.io/langgraph/). We show a simple example below of how to create a ReAct agent. ```python -from langchain_anthropic import ChatAnthropic +# This code depends on pip install langchain[anthropic] from langgraph.prebuilt import create_react_agent def search(query: str): @@ -34,9 +34,7 @@ def search(query: str): return "It's 60 degrees and foggy." return "It's 90 degrees and sunny." -model = ChatAnthropic(model=“claude-3-7-sonnet-latest”) -tools = [search] -agent = create_react_agent(model, tools) +agent = create_react_agent("anthropic:claude-3-7-sonnet-latest", tools=[search]) agent.invoke( {"messages": [{"role": "user", "content": "what is the weather in sf"}]} ) diff --git a/libs/langgraph/README.md b/libs/langgraph/README.md index a529a1af8..5f5cd6acf 100644 --- a/libs/langgraph/README.md +++ b/libs/langgraph/README.md @@ -25,7 +25,7 @@ pip install -U langgraph To learn more about how to use LangGraph, check out [the docs](https://langchain-ai.github.io/langgraph/). We show a simple example below of how to create a ReAct agent. ```python -from langchain_anthropic import ChatAnthropic +# This code depends on pip install langchain[anthropic] from langgraph.prebuilt import create_react_agent def search(query: str): @@ -34,9 +34,7 @@ def search(query: str): return "It's 60 degrees and foggy." return "It's 90 degrees and sunny." -model = ChatAnthropic(model=“claude-3-7-sonnet-latest”) -tools = [search] -agent = create_react_agent(model, tools) +agent = create_react_agent("anthropic:claude-3-7-sonnet-latest", tools=[search]) agent.invoke( {"messages": [{"role": "user", "content": "what is the weather in sf"}]} )