Skip to content

Commit 487b1cf

Browse files
ianhodgewarp-agent
andcommitted
docs: add environment and config usage documentation
Add documentation for the config parameter including: - environment_id for cloud environments - model_id, name, and base_prompt options - MCP server configuration examples Link to Warp docs for environment setup instructions. Co-Authored-By: Warp <agent@warp.dev>
1 parent cd75ea1 commit 487b1cf

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,64 @@ response = client.agent.run(
3838
print(response.task_id)
3939
```
4040

41+
### Using environments and configuration
42+
43+
You can configure the agent with a custom environment and other settings using the `config` parameter:
44+
45+
```python
46+
from warp_sdk import WarpAPI
47+
48+
client = WarpAPI()
49+
50+
response = client.agent.run(
51+
prompt="Fix the bug in auth.go",
52+
config={
53+
"environment_id": "your-environment-id", # UID of a cloud environment
54+
"model_id": "claude-sonnet-4", # Optional: specify the LLM model
55+
"name": "bug-fix-config", # Optional: config name for traceability
56+
"base_prompt": "You are a helpful coding assistant.", # Optional: custom base prompt
57+
},
58+
)
59+
print(response.task_id)
60+
```
61+
62+
#### Configuration options
63+
64+
The `config` parameter accepts the following fields:
65+
66+
- `environment_id`: UID of a cloud environment to run the agent in. Environments define the Docker image, GitHub repositories, and setup commands for agent execution. See [Creating an Environment](https://docs.warp.dev/integrations/integrations-overview/integrations-and-environments#creating-an-environment) for setup instructions.
67+
- `model_id`: LLM model to use (uses workspace default if not specified)
68+
- `name`: Config name for searchability and traceability
69+
- `base_prompt`: Custom base prompt for the agent
70+
- `mcp_servers`: Map of MCP server configurations by name
71+
72+
#### MCP server configuration
73+
74+
You can configure MCP servers to extend the agent's capabilities:
75+
76+
```python
77+
response = client.agent.run(
78+
prompt="Check my GitHub issues",
79+
config={
80+
"environment_id": "your-environment-id",
81+
"mcp_servers": {
82+
"github": {
83+
"warp_id": "your-shared-mcp-server-id", # Reference a Warp shared MCP server
84+
},
85+
"custom-server": {
86+
"command": "npx",
87+
"args": ["-y", "@modelcontextprotocol/server-filesystem"],
88+
"env": {"PATH": "/usr/local/bin"},
89+
},
90+
"remote-server": {
91+
"url": "https://mcp.example.com/sse",
92+
"headers": {"Authorization": "Bearer token"},
93+
},
94+
},
95+
},
96+
)
97+
```
98+
4199
While you can provide an `api_key` keyword argument,
42100
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
43101
to add `WARP_API_KEY="My API Key"` to your `.env` file

0 commit comments

Comments
 (0)