Skip to content

Commit d2e68f8

Browse files
authored
Merge pull request #406 from hud-evals/codex/fix-public-doc-imports
Fix public docs SDK imports
2 parents 0401b41 + f2831b8 commit d2e68f8

3 files changed

Lines changed: 23 additions & 25 deletions

File tree

docs/platform/subagent.mdx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,21 @@ The workflow is:
2525
Scenarios define what your agent does. In your environment code:
2626

2727
```python
28-
from hud import Env
28+
from hud import Environment
2929

30-
env = Env("my-assistant")
30+
env = Environment("my-assistant")
3131

3232
@env.scenario()
3333
async def answer_question(query: str):
3434
"""Answer a user question using available tools."""
3535

36-
yield env.setup(f"Answer this question: {query}")
37-
38-
result = yield # Agent runs here
36+
result = yield f"Answer this question: {query}"
3937

40-
# Evaluate the result
38+
# Evaluate the result.
4139
if "helpful" in result.lower():
42-
yield env.reward(1.0)
40+
yield 1.0
4341
else:
44-
yield env.reward(0.0)
42+
yield 0.0
4543
```
4644

4745
Deploy your environment through the platform:
@@ -74,7 +72,7 @@ Once your scenario exists, call it via the REST API:
7472
### cURL
7573

7674
```bash
77-
curl -X POST https://api.hud.so/v1/agent/run \
75+
curl -X POST https://api.hud.ai/agent/run \
7876
-H "Content-Type: application/json" \
7977
-H "Authorization: Bearer $HUD_API_KEY" \
8078
-d '{
@@ -161,7 +159,7 @@ Trigger agent runs from external events:
161159
@app.post("/webhook")
162160
async def handle_webhook(event: dict):
163161
response = requests.post(
164-
"https://api.hud.so/v1/agent/run",
162+
"https://api.hud.ai/agent/run",
165163
headers={"Authorization": f"Bearer {HUD_API_KEY}"},
166164
json={
167165
"env_name": "support-agent",
@@ -179,7 +177,7 @@ Run agents on a schedule with cron or similar:
179177

180178
```bash
181179
# Run daily cleanup agent
182-
0 0 * * * curl -X POST https://api.hud.so/v1/agent/run \
180+
0 0 * * * curl -X POST https://api.hud.ai/agent/run \
183181
-H "Authorization: Bearer $HUD_API_KEY" \
184182
-d '{"env_name": "ops", "scenario_name": "daily_cleanup", "scenario_args": {}, "model": "claude-sonnet-4-5"}'
185183
```
@@ -190,7 +188,7 @@ Power a chat UI with agent capabilities:
190188

191189
```javascript
192190
async function sendMessage(message) {
193-
const response = await fetch("https://api.hud.so/v1/agent/run", {
191+
const response = await fetch("https://api.hud.ai/agent/run", {
194192
method: "POST",
195193
headers: {
196194
"Content-Type": "application/json",

docs/reference/agents.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The HUD SDK provides a base `MCPAgent` class and several pre-built agent impleme
1111
Use the `create()` factory method to instantiate agents with typed parameters:
1212

1313
```python
14-
from hud.agents import ClaudeAgent
14+
from hud.agents.claude import ClaudeAgent
1515

1616
agent = ClaudeAgent.create(
1717
model="claude-sonnet-4-5",
@@ -78,7 +78,7 @@ def get_available_tools() -> list[types.Tool]
7878
### ClaudeAgent
7979

8080
```python
81-
from hud.agents import ClaudeAgent
81+
from hud.agents.claude import ClaudeAgent
8282
```
8383

8484
Claude-specific implementation using Anthropic's API.
@@ -97,7 +97,7 @@ Claude-specific implementation using Anthropic's API.
9797

9898
```python
9999
from hud import Environment
100-
from hud.agents import ClaudeAgent
100+
from hud.agents.claude import ClaudeAgent
101101

102102
env = Environment("browser").connect_hub("hud-evals/browser")
103103

@@ -162,7 +162,7 @@ Inherits all `OpenAIAgent` parameters.
162162
### GeminiAgent
163163

164164
```python
165-
from hud.agents import GeminiAgent
165+
from hud.agents.gemini import GeminiAgent
166166
```
167167

168168
Google Gemini agent for standard tool-calling tasks.
@@ -192,7 +192,7 @@ agent = GeminiAgent.create(
192192
### GeminiCUAAgent
193193

194194
```python
195-
from hud.agents import GeminiCUAAgent
195+
from hud.agents.gemini_cua import GeminiCUAAgent
196196
```
197197

198198
Google Gemini Computer Use Agent with native computer-use capabilities. Extends `GeminiAgent` with support for Gemini's predefined computer actions (click, type, scroll, etc.).
@@ -231,7 +231,7 @@ GeminiCUAAgent supports these native Gemini computer actions:
231231

232232
```python
233233
from hud import Environment
234-
from hud.agents import GeminiCUAAgent
234+
from hud.agents.gemini_cua import GeminiCUAAgent
235235

236236
env = Environment("browser").connect_hub("hud-evals/browser")
237237

@@ -290,7 +290,7 @@ agent = OpenAIChatAgent.create(
290290

291291
```python
292292
from hud import Environment
293-
from hud.agents import ClaudeAgent
293+
from hud.agents.claude import ClaudeAgent
294294

295295
# Define environment with scenario
296296
env = Environment("browser").connect_hub("hud-evals/browser")

docs/reference/mcpserver.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -492,19 +492,19 @@ hud analyze my-env:latest
492492

493493
# Python testing
494494
async def test():
495-
from hud.clients import MCPClient
495+
from hud import Environment
496496

497-
client = MCPClient({
497+
env = Environment("test").connect_mcp_config({
498498
"env": {"command": "docker", "args": ["run", "-i", "my-env"]}
499499
})
500500

501-
async with client:
502-
tools = await client.list_tools()
503-
result = await client.call_tool("setup", {"value": 0})
501+
async with env:
502+
tools = await env.list_tools()
503+
result = await env.call_tool("setup", value=0)
504504
```
505505

506506
## See Also
507507

508508
- [Environments](/reference/environments) - Environment class (client-side)
509509
- [Tools](/reference/tools) - Tool implementation reference
510-
- [Evals](/reference/evals) - Running evaluations
510+
- [Evals](/reference/evals) - Running evaluations

0 commit comments

Comments
 (0)