Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

document yields and msg format

Dillon DuPont1541d522f9ad
diff --git a/docs/content/docs/home/agent-sdk/agent-loops.mdx b/docs/content/docs/home/agent-sdk/agent-loops.mdx
index 9503a3e4bb..9f6846ed0a 100644
--- a/docs/content/docs/home/agent-sdk/agent-loops.mdx
+++ b/docs/content/docs/home/agent-sdk/agent-loops.mdx
@@ -25,7 +25,8 @@ agent = ComputerAgent(
prompt = "open github, navigate to trycua/cua"
async for result in agent.run(prompt):
- print("Agent:", result["output"][-1]["content"][0]["text"])
+ if result["output"][-1]["type"] == "message":
+ print("Agent:", result["output"][-1]["content"][0]["text"])
```
We currently support 4 computer-using agent loops:
diff --git a/docs/content/docs/home/agent-sdk/chat-history.mdx b/docs/content/docs/home/agent-sdk/chat-history.mdx
index 6cf2de4495..b675350be8 100644
--- a/docs/content/docs/home/agent-sdk/chat-history.mdx
+++ b/docs/content/docs/home/agent-sdk/chat-history.mdx
@@ -26,10 +26,12 @@ The messages array contains different types of messages that represent the conve
```python
messages = [
+ # user input
{
"role": "user",
"content": "go to trycua on gh"
},
+ # first agent turn adds the model output to the history
{
"summary": [
{
@@ -48,6 +50,7 @@ messages = [
"status": "completed",
"type": "computer_call"
},
+ # second agent turn adds the computer output to the history
{
"type": "computer_call_output",
"call_id": "call_QI6OsYkXxl6Ww1KvyJc4LKKq",
@@ -55,6 +58,17 @@ messages = [
"type": "input_image",
"image_url": "[omitted]"
}
+ },
+ # final agent turn adds the agent output text to the history
+ {
+ "type": "message",
+ "role": "assistant",
+ "content": [
+ {
+ "text": "Success! The Trycua GitHub page has been opened.",
+ "type": "output_text"
+ }
+ ]
}
]
```