docs: more concise readme (#3815)

This commit is contained in:
William FH
2025-03-13 09:03:18 -04:00
committed by GitHub
parent 8aa59d002a
commit 944b93bf61
2 changed files with 4 additions and 8 deletions
+2 -4
View File
@@ -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"}]}
)
+2 -4
View File
@@ -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"}]}
)