Skip to content

Commit a5c168f

Browse files
committed
chore: update context doc
1 parent 6cf6f34 commit a5c168f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

website/docs/agents/context.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,9 @@ executionContext.set("language", "English");
7878
const response = await agent.generateText("Hello!", {
7979
context: executionContext,
8080
});
81-
```
82-
8381
// Now you can access the data from the response
8482
console.log("Language:", response.context?.get("language"));
83+
```
8584

8685
## Sending User Information
8786

@@ -91,6 +90,7 @@ Supported fields:
9190

9291
- `user.name`: User's full name
9392
- `user.email`: User's email address
93+
- `user.avatar`: User's avatar URL
9494
- `user.metadata`: Additional metadata object
9595

9696
<Tabs>
@@ -106,6 +106,7 @@ const agent = new Agent({ ... });
106106
const context = new Map();
107107
context.set("user.name", "John Doe");
108108
context.set("user.email", "john@example.com");
109+
context.set("user.avatar", "https://example.com/avatar.jpg");
109110
context.set("user.metadata", { plan: "pro" });
110111

111112
await agent.generateText("Hello", { userId: "user_123", context });
@@ -126,6 +127,7 @@ When using the REST API, you can pass user information in the `context` object.
126127
"user": {
127128
"name": "John Doe",
128129
"email": "john@example.com",
130+
"avatar": "https://example.com/avatar.jpg",
129131
"metadata": { "plan": "pro" }
130132
}
131133
}
@@ -141,6 +143,7 @@ When using the REST API, you can pass user information in the `context` object.
141143
"context": {
142144
"user.name": "John Doe",
143145
"user.email": "john@example.com",
146+
"user.avatar": "https://example.com/avatar.jpg",
144147
"user.metadata": { "plan": "pro" }
145148
}
146149
}

0 commit comments

Comments
 (0)