Skip to content

Commit 37d74f7

Browse files
docs: sync code blocks and generate API reference (#147)
Synced from agent-sdk ref: main Co-authored-by: xingyaoww <38853559+xingyaoww@users.noreply.github.com>
1 parent 70337f6 commit 37d74f7

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

docs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,4 +511,4 @@
511511
"destination": "/overview/skills/public"
512512
}
513513
]
514-
}
514+
}

sdk/guides/agent-server/docker-sandbox.mdx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,8 @@ llm = LLM(
272272
api_key=SecretStr(api_key),
273273
)
274274

275-
# Create a Docker-based remote workspace with extra ports for VSCode access
276-
277275

276+
# Create a Docker-based remote workspace with extra ports for VSCode access
278277
def detect_platform():
279278
"""Detects the correct Docker platform string."""
280279
import platform
@@ -347,7 +346,7 @@ with DockerWorkspace(
347346
while y != "y":
348347
y = input(
349348
"\n"
350-
"Because you've enabled extra_ports=True in DockerWorkspace, "
349+
"Because you've enabled extra_ports=True in DockerDevWorkspace, "
351350
"you can open VSCode Web to see the workspace.\n\n"
352351
f"VSCode URL: {vscode_url}\n\n"
353352
"The VSCode should have the OpenHands settings extension installed:\n"
@@ -475,6 +474,12 @@ def detect_platform():
475474
# Create a Docker-based remote workspace with extra ports for browser access.
476475
# Use `DockerWorkspace` with a pre-built image or `DockerDevWorkspace` to
477476
# automatically build the image on-demand.
477+
# with DockerDevWorkspace(
478+
# # dynamically build agent-server image
479+
# base_image="nikolaik/python-nodejs:python3.12-nodejs22",
480+
# host_port=8010,
481+
# platform=detect_platform(),
482+
# ) as workspace:
478483
with DockerWorkspace(
479484
server_image="ghcr.io/openhands/agent-server:latest-python",
480485
host_port=8011,
@@ -528,7 +533,7 @@ with DockerWorkspace(
528533
y = None
529534
while y != "y":
530535
y = input(
531-
"Because you've enabled extra_ports=True in DockerWorkspace, "
536+
"Because you've enabled extra_ports=True in DockerDevWorkspace, "
532537
"you can open a browser tab to see the *actual* browser OpenHands "
533538
"is interacting with via VNC.\n\n"
534539
"Link: http://localhost:8012/vnc.html?autoconnect=1&resize=remote\n\n"

sdk/guides/agent-tom-agent.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ print("=" * 80)
145145
# conversation.send_message("Please index this conversation using sleeptime_compute")
146146
# conversation.run()
147147
# print("\nConversation indexed for user modeling!")
148+
149+
# Report cost
150+
cost = llm.metrics.accumulated_cost
151+
print(f"EXAMPLE_COST: {cost}")
148152
```
149153

150154
```bash Running the Example

0 commit comments

Comments
 (0)