mirror of
https://github.com/langchain-ai/docs.git
synced 2026-08-27 21:00:00 -04:00
212 lines
6.3 KiB
Plaintext
212 lines
6.3 KiB
Plaintext
<CodeGroup>
|
|
```python Google
|
|
from deepagents import create_deep_agent
|
|
from deepagents.backends import LangSmithSandbox
|
|
from langchain_anthropic import ChatAnthropic
|
|
from langsmith.sandbox import SandboxClient
|
|
|
|
client = SandboxClient()
|
|
ls_sandbox = client.create_sandbox()
|
|
backend = LangSmithSandbox(sandbox=ls_sandbox)
|
|
|
|
agent = create_deep_agent(
|
|
model=ChatAnthropic(model="google_genai:gemini-3.6-flash"),
|
|
system_prompt="You are a Python coding assistant with sandbox access.",
|
|
backend=backend,
|
|
)
|
|
try:
|
|
result = agent.invoke(
|
|
{
|
|
"messages": [
|
|
{
|
|
"role": "user",
|
|
"content": "Create a small Python package and run pytest",
|
|
}
|
|
]
|
|
}
|
|
)
|
|
finally:
|
|
client.delete_sandbox(ls_sandbox.name)
|
|
```
|
|
|
|
```python OpenAI
|
|
from deepagents import create_deep_agent
|
|
from deepagents.backends import LangSmithSandbox
|
|
from langchain_anthropic import ChatAnthropic
|
|
from langsmith.sandbox import SandboxClient
|
|
|
|
client = SandboxClient()
|
|
ls_sandbox = client.create_sandbox()
|
|
backend = LangSmithSandbox(sandbox=ls_sandbox)
|
|
|
|
agent = create_deep_agent(
|
|
model=ChatAnthropic(model="openai:gpt-5.5"),
|
|
system_prompt="You are a Python coding assistant with sandbox access.",
|
|
backend=backend,
|
|
)
|
|
try:
|
|
result = agent.invoke(
|
|
{
|
|
"messages": [
|
|
{
|
|
"role": "user",
|
|
"content": "Create a small Python package and run pytest",
|
|
}
|
|
]
|
|
}
|
|
)
|
|
finally:
|
|
client.delete_sandbox(ls_sandbox.name)
|
|
```
|
|
|
|
```python Anthropic
|
|
from deepagents import create_deep_agent
|
|
from deepagents.backends import LangSmithSandbox
|
|
from langchain_anthropic import ChatAnthropic
|
|
from langsmith.sandbox import SandboxClient
|
|
|
|
client = SandboxClient()
|
|
ls_sandbox = client.create_sandbox()
|
|
backend = LangSmithSandbox(sandbox=ls_sandbox)
|
|
|
|
agent = create_deep_agent(
|
|
model=ChatAnthropic(model="anthropic:claude-sonnet-4-6"),
|
|
system_prompt="You are a Python coding assistant with sandbox access.",
|
|
backend=backend,
|
|
)
|
|
try:
|
|
result = agent.invoke(
|
|
{
|
|
"messages": [
|
|
{
|
|
"role": "user",
|
|
"content": "Create a small Python package and run pytest",
|
|
}
|
|
]
|
|
}
|
|
)
|
|
finally:
|
|
client.delete_sandbox(ls_sandbox.name)
|
|
```
|
|
|
|
```python OpenRouter
|
|
from deepagents import create_deep_agent
|
|
from deepagents.backends import LangSmithSandbox
|
|
from langchain_anthropic import ChatAnthropic
|
|
from langsmith.sandbox import SandboxClient
|
|
|
|
client = SandboxClient()
|
|
ls_sandbox = client.create_sandbox()
|
|
backend = LangSmithSandbox(sandbox=ls_sandbox)
|
|
|
|
agent = create_deep_agent(
|
|
model=ChatAnthropic(model="openrouter:z-ai/glm-5.2"),
|
|
system_prompt="You are a Python coding assistant with sandbox access.",
|
|
backend=backend,
|
|
)
|
|
try:
|
|
result = agent.invoke(
|
|
{
|
|
"messages": [
|
|
{
|
|
"role": "user",
|
|
"content": "Create a small Python package and run pytest",
|
|
}
|
|
]
|
|
}
|
|
)
|
|
finally:
|
|
client.delete_sandbox(ls_sandbox.name)
|
|
```
|
|
|
|
```python Fireworks
|
|
from deepagents import create_deep_agent
|
|
from deepagents.backends import LangSmithSandbox
|
|
from langchain_anthropic import ChatAnthropic
|
|
from langsmith.sandbox import SandboxClient
|
|
|
|
client = SandboxClient()
|
|
ls_sandbox = client.create_sandbox()
|
|
backend = LangSmithSandbox(sandbox=ls_sandbox)
|
|
|
|
agent = create_deep_agent(
|
|
model=ChatAnthropic(model="fireworks:accounts/fireworks/models/glm-5p2"),
|
|
system_prompt="You are a Python coding assistant with sandbox access.",
|
|
backend=backend,
|
|
)
|
|
try:
|
|
result = agent.invoke(
|
|
{
|
|
"messages": [
|
|
{
|
|
"role": "user",
|
|
"content": "Create a small Python package and run pytest",
|
|
}
|
|
]
|
|
}
|
|
)
|
|
finally:
|
|
client.delete_sandbox(ls_sandbox.name)
|
|
```
|
|
|
|
```python Baseten
|
|
from deepagents import create_deep_agent
|
|
from deepagents.backends import LangSmithSandbox
|
|
from langchain_anthropic import ChatAnthropic
|
|
from langsmith.sandbox import SandboxClient
|
|
|
|
client = SandboxClient()
|
|
ls_sandbox = client.create_sandbox()
|
|
backend = LangSmithSandbox(sandbox=ls_sandbox)
|
|
|
|
agent = create_deep_agent(
|
|
model=ChatAnthropic(model="baseten:zai-org/GLM-5.2"),
|
|
system_prompt="You are a Python coding assistant with sandbox access.",
|
|
backend=backend,
|
|
)
|
|
try:
|
|
result = agent.invoke(
|
|
{
|
|
"messages": [
|
|
{
|
|
"role": "user",
|
|
"content": "Create a small Python package and run pytest",
|
|
}
|
|
]
|
|
}
|
|
)
|
|
finally:
|
|
client.delete_sandbox(ls_sandbox.name)
|
|
```
|
|
|
|
```python Ollama
|
|
from deepagents import create_deep_agent
|
|
from deepagents.backends import LangSmithSandbox
|
|
from langchain_anthropic import ChatAnthropic
|
|
from langsmith.sandbox import SandboxClient
|
|
|
|
client = SandboxClient()
|
|
ls_sandbox = client.create_sandbox()
|
|
backend = LangSmithSandbox(sandbox=ls_sandbox)
|
|
|
|
agent = create_deep_agent(
|
|
model=ChatAnthropic(model="ollama:north-mini-code-1.0"),
|
|
system_prompt="You are a Python coding assistant with sandbox access.",
|
|
backend=backend,
|
|
)
|
|
try:
|
|
result = agent.invoke(
|
|
{
|
|
"messages": [
|
|
{
|
|
"role": "user",
|
|
"content": "Create a small Python package and run pytest",
|
|
}
|
|
]
|
|
}
|
|
)
|
|
finally:
|
|
client.delete_sandbox(ls_sandbox.name)
|
|
```
|
|
</CodeGroup>
|