Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/langsmith/define-target-function.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const target = async(inputs) => {
```python Python (LangChain)
from langchain.chat_models import init_chat_model

model = init_chat_model("openai:gpt-4o-mini")
model = init_chat_model("gpt-4o-mini")

def target(inputs: dict) -> dict:
# This assumes your dataset has inputs with a `messages` key
Expand Down
4 changes: 2 additions & 2 deletions src/langsmith/evaluate-complex-agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def lookup_album( ...
def lookup_artist( ...

# Agent model
qa_llm = init_chat_model("claude-3-5-sonnet-latest")
qa_llm = init_chat_model("claude-sonnet-4-5-20250929")
# The prebuilt ReACT agent only expects State to have a 'messages' key, so the
# state we defined for the refund agent can also be passed to our lookup agent.
qa_graph = create_agent(qa_llm, tools=[lookup_track, lookup_artist, lookup_album])
Expand Down Expand Up @@ -1260,7 +1260,7 @@ def lookup_artist(


# Agent model
qa_llm = init_chat_model("claude-3-5-sonnet-latest")
qa_llm = init_chat_model("claude-sonnet-4-5-20250929")
# The prebuilt ReACT agent only expects State to have a 'messages' key, so the
# state we defined for the refund agent can also be passed to our lookup agent.
qa_graph = create_agent(qa_llm, [lookup_track, lookup_artist, lookup_album])
Expand Down
4 changes: 2 additions & 2 deletions src/langsmith/evaluate-graph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def search(query: str) -> str:

tools = [search]
tool_node = ToolNode(tools)
model = init_chat_model("claude-3-5-sonnet-latest").bind_tools(tools)
model = init_chat_model("claude-sonnet-4-5-20250929").bind_tools(tools)

# Define the function that determines whether to continue or not
def should_continue(state: State) -> Literal["tools", END]:
Expand Down Expand Up @@ -282,7 +282,7 @@ def search(query: str) -> str:

tools = [search]
tool_node = ToolNode(tools)
model = init_chat_model("claude-3-5-sonnet-latest").bind_tools(tools)
model = init_chat_model("claude-sonnet-4-5-20250929").bind_tools(tools)

# Define the function that determines whether to continue or not
def should_continue(state: State) -> Literal["tools", END]:
Expand Down
4 changes: 2 additions & 2 deletions src/langsmith/generative-ui-react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ Then you can push updates to the UI component by calling `ui.push()` / `push_ui_


async def writer_node(state: AgentState):
model = ChatAnthropic(model="claude-3-5-sonnet-latest")
model = ChatAnthropic(model="claude-sonnet-4-5-20250929")
message: AIMessage = await model.bind_tools(
tools=[CreateTextDocument],
tool_choice={"type": "tool", "name": "CreateTextDocument"},
Expand Down Expand Up @@ -432,7 +432,7 @@ Then you can push updates to the UI component by calling `ui.push()` / `push_ui_
): Promise<typeof AgentState.Update> {
const ui = typedUi<typeof ComponentMap>(config);

const model = new ChatAnthropic({ model: "claude-3-5-sonnet-latest" });
const model = new ChatAnthropic({ model: "claude-sonnet-4-5-20250929" });
const message = await model
.bindTools(
[
Expand Down
2 changes: 1 addition & 1 deletion src/langsmith/human-in-the-loop-time-travel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To time travel using the LangGraph Server API (via the LangGraph SDK):
joke: NotRequired[str]

model = init_chat_model(
"anthropic:claude-sonnet-4-5",
"claude-sonnet-4-5-20250929",
temperature=0,
)

Expand Down
2 changes: 1 addition & 1 deletion src/langsmith/log-llm-trace.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def chat_model(inputs: dict) -> dict:
When using a custom model, it is recommended to also provide the following `metadata` fields to identify the model when viewing traces and when filtering.

* `ls_provider`: The provider of the model, eg "openai", "anthropic", etc.
* `ls_model_name`: The name of the model, eg "gpt-4o-mini", "claude-3-opus-20240307", etc.
* `ls_model_name`: The name of the model, eg "gpt-4o-mini", "claude-3-opus-20240229", etc.

<CodeGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/langsmith/manage-prompts-programmatically.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ const { messages, system } = convertPromptToAnthropic(formattedPrompt);

const anthropicClient = new Anthropic();
const anthropicResponse = await anthropicClient.messages.create({
model: "claude-3-haiku-20240307",
model: "claude-haiku-4-5-20251001",
system,
messages,
max_tokens: 1024,
Expand Down
4 changes: 2 additions & 2 deletions src/langsmith/observability-studio.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class Configuration(BaseModel):

model: Annotated[
Literal[
"anthropic/claude-sonnet-4-5",
"anthropic/claude-3-5-haiku-latest",
"anthropic/claude-sonnet-4-5-20250929",
"anthropic/claude-haiku-4-5-20251001",
"openai/o1",
"openai/gpt-4o-mini",
"openai/o1-mini",
Expand Down
2 changes: 1 addition & 1 deletion src/langsmith/server-mcp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Use an MCP-compliant client to connect to the LangGraph server. The following ex
tools = await load_mcp_tools(session)

# Create and run a react agent with the tools
agent = create_agent("openai:gpt-4.1", tools)
agent = create_agent("gpt-4.1", tools)

# Invoke the agent with a message
agent_response = await agent.ainvoke({"messages": "What can the finance agent do for me?"})
Expand Down
2 changes: 1 addition & 1 deletion src/langsmith/streaming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ The streamed output from [`messages-tuple` mode](#supported-stream-modes) is a t
topic: str
joke: str = ""

model = init_chat_model(model="openai:gpt-4o-mini")
model = init_chat_model(model="gpt-4o-mini")

def call_model(state: MyState):
"""Call the LLM to generate a joke about a topic"""
Expand Down
4 changes: 2 additions & 2 deletions src/langsmith/test-react-agent-pytest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class AgentOutputFormat(TypedDict):
reasoning: Annotated[str, ..., "The reasoning behind the answer"]

agent = create_agent(
model="openai:gpt-4o-mini",
model="gpt-4o-mini",
tools=[code_tool, search_tool, polygon_aggregates],
response_format=AgentOutputFormat,
system_prompt="You are a financial expert. Respond to the users query accurately",
Expand Down Expand Up @@ -766,7 +766,7 @@ Remember to also add the config files for [Vitest](#config-files-for-vitestjest)
reasoning: Annotated[str, ..., "The reasoning behind the answer"]

agent = create_agent(
model="openai:gpt-4o-mini",
model="gpt-4o-mini",
tools=[code_tool, search_tool, polygon_aggregates],
response_format=AgentOutputFormat,
system_prompt="You are a financial expert. Respond to the users query accurately",
Expand Down
2 changes: 1 addition & 1 deletion src/langsmith/trace-claude-agent-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def main():
)

options = ClaudeAgentOptions(
model="claude-sonnet-4-5",
model="claude-sonnet-4-5-20250929",
system_prompt="You are a friendly travel assistant who helps with weather information.",
mcp_servers={"weather": weather_server},
allowed_tools=["mcp__weather__get_weather"],
Expand Down
16 changes: 8 additions & 8 deletions src/langsmith/trajectory-evals.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def get_weather(city: str):
"""Get weather information for a city."""
return f"It's 75 degrees and sunny in {city}."

agent = create_agent("openai:gpt-4o", tools=[get_weather])
agent = create_agent("gpt-4o", tools=[get_weather])

evaluator = create_trajectory_match_evaluator( # [!code highlight]
trajectory_match_mode="strict", # [!code highlight]
Expand Down Expand Up @@ -121,7 +121,7 @@ const getWeather = tool(
);

const agent = createAgent({
model: "openai:gpt-4o",
model: "gpt-4o",
tools: [getWeather]
});

Expand Down Expand Up @@ -187,7 +187,7 @@ def get_events(city: str):
"""Get events happening in a city."""
return f"Concert at the park in {city} tonight."

agent = create_agent("openai:gpt-4o", tools=[get_weather, get_events])
agent = create_agent("gpt-4o", tools=[get_weather, get_events])

evaluator = create_trajectory_match_evaluator( # [!code highlight]
trajectory_match_mode="unordered", # [!code highlight]
Expand Down Expand Up @@ -249,7 +249,7 @@ const getEvents = tool(
);

const agent = createAgent({
model: "openai:gpt-4o",
model: "gpt-4o",
tools: [getWeather, getEvents]
});

Expand Down Expand Up @@ -325,7 +325,7 @@ def get_detailed_forecast(city: str):
"""Get detailed weather forecast for a city."""
return f"Detailed forecast for {city}: sunny all week."

agent = create_agent("openai:gpt-4o", tools=[get_weather, get_detailed_forecast])
agent = create_agent("gpt-4o", tools=[get_weather, get_detailed_forecast])

evaluator = create_trajectory_match_evaluator( # [!code highlight]
trajectory_match_mode="superset", # [!code highlight]
Expand Down Expand Up @@ -388,7 +388,7 @@ const getDetailedForecast = tool(
);

const agent = createAgent({
model: "openai:gpt-4o",
model: "gpt-4o",
tools: [getWeather, getDetailedForecast]
});

Expand Down Expand Up @@ -460,7 +460,7 @@ def get_weather(city: str):
"""Get weather information for a city."""
return f"It's 75 degrees and sunny in {city}."

agent = create_agent("openai:gpt-4o", tools=[get_weather])
agent = create_agent("gpt-4o", tools=[get_weather])

evaluator = create_trajectory_llm_as_judge( # [!code highlight]
model="openai:o3-mini", # [!code highlight]
Expand Down Expand Up @@ -502,7 +502,7 @@ const getWeather = tool(
);

const agent = createAgent({
model: "openai:gpt-4o",
model: "gpt-4o",
tools: [getWeather]
});

Expand Down
8 changes: 5 additions & 3 deletions src/oss/concepts/context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ graph.invoke(
return f"You are a helpful assistant. Address the user as {user_name}."

agent = create_agent(
model="anthropic:claude-sonnet-4-5",
model="claude-sonnet-4-5-20250929",
tools=[get_weather],
middleware=[personalized_prompt],
context_schema=ContextSchema
Expand Down Expand Up @@ -145,6 +145,7 @@ await graph.invoke(
State can also be accessed by the agent's **tools**, which can read or update the state as needed. See [tool calling guide](/oss/langchain/tools#short-term-memory) for details.

:::python

```python
from langchain.agents import create_agent
from langchain.agents.middleware import dynamic_prompt, ModelRequest
Expand All @@ -160,7 +161,7 @@ await graph.invoke(
return f"You are a helpful assistant. User's name is {user_name}"

agent = create_agent(
model="anthropic:claude-sonnet-4-5",
model="claude-sonnet-4-5-20250929",
tools=[...],
state_schema=CustomState, # [!code highlight]
middleware=[personalized_prompt], # [!code highlight]
Expand All @@ -174,6 +175,7 @@ await graph.invoke(
:::

:::js

```typescript
import { createAgent, createMiddleware } from "langchain";
import type { AgentState } from "langchain";
Expand All @@ -194,7 +196,7 @@ await graph.invoke(
});

const agent = createAgent({ // [!code highlight]
model: "anthropic:claude-sonnet-4-5",
model: "claude-sonnet-4-5-20250929",
tools: [/* your tools here */],
middleware: [personalizedPrompt] as const, // [!code highlight]
});
Expand Down
2 changes: 1 addition & 1 deletion src/oss/deepagents/customization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from langchain.chat_models import init_chat_model
from deepagents import create_deep_agent

model = init_chat_model(
model="openai:gpt-5",
model="gpt-5",
)
agent = create_deep_agent(
model=model,
Expand Down
2 changes: 1 addition & 1 deletion src/oss/deepagents/human-in-the-loop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def send_email(to: str, subject: str, body: str) -> str:
checkpointer = MemorySaver()

agent = create_deep_agent(
model="anthropic:claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
tools=[delete_file, read_file, send_email],
interrupt_on={
"delete_file": True, # Default: approve, edit, reject
Expand Down
14 changes: 7 additions & 7 deletions src/oss/deepagents/middleware.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ from langchain.agents.middleware import TodoListMiddleware
# TodoListMiddleware is included by default in create_deep_agent
# You can customize it if building a custom agent
agent = create_agent(
model="anthropic:claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
# Custom planning instructions can be added via middleware
middleware=[
TodoListMiddleware(
Expand Down Expand Up @@ -65,7 +65,7 @@ from deepagents.middleware.filesystem import FilesystemMiddleware
# FilesystemMiddleware is included by default in create_deep_agent
# You can customize it if building a custom agent
agent = create_agent(
model="anthropic:claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
middleware=[
FilesystemMiddleware(
long_term_memory=False, # Enables access to long-term memory, defaults to False. You must attach a store to use long-term memory.
Expand All @@ -92,7 +92,7 @@ from langgraph.store.memory import InMemoryStore
store = InMemoryStore()

agent = create_agent(
model="anthropic:claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
store=store,
middleware=[
FilesystemMiddleware(
Expand Down Expand Up @@ -133,10 +133,10 @@ def get_weather(city: str) -> str:
return f"The weather in {city} is sunny."

agent = create_agent(
model="claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
middleware=[
SubAgentMiddleware(
default_model="claude-sonnet-4-20250514",
default_model="claude-sonnet-4-5-20250929",
default_tools=[],
subagents=[
{
Expand Down Expand Up @@ -180,10 +180,10 @@ weather_subagent = CompiledSubAgent(
)

agent = create_agent(
model="anthropic:claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
middleware=[
SubAgentMiddleware(
default_model="claude-sonnet-4-20250514",
default_model="claude-sonnet-4-5-20250929",
default_tools=[],
subagents=[weather_subagent],
)
Expand Down
8 changes: 4 additions & 4 deletions src/oss/deepagents/subagents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ research_subagent = {
subagents = [research_subagent]

agent = create_deep_agent(
model="anthropic:claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
subagents=subagents
)
```
Expand Down Expand Up @@ -113,7 +113,7 @@ custom_subagent = CompiledSubAgent(
subagents = [custom_subagent]

agent = create_deep_agent(
model="anthropic:claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
tools=[internet_search],
system_prompt=research_instructions,
subagents=subagents
Expand Down Expand Up @@ -223,7 +223,7 @@ subagents = [
"description": "Reviews legal documents and contracts",
"system_prompt": "You are an expert legal reviewer...",
"tools": [read_document, analyze_contract],
"model": "anthropic:claude-sonnet-4-20250514", # Large context for long documents
"model": "claude-sonnet-4-5-20250929", # Large context for long documents
},
{
"name": "financial-analyst",
Expand Down Expand Up @@ -302,7 +302,7 @@ subagents = [
]

agent = create_deep_agent(
model="anthropic:claude-sonnet-4-20250514",
model="claude-sonnet-4-5-20250929",
system_prompt="You coordinate data analysis and reporting. Use subagents for specialized tasks.",
subagents=subagents
)
Expand Down
Loading