@@ -78,10 +78,9 @@ executionContext.set("language", "English");
7878const response = await agent .generateText (" Hello!" , {
7979 context: executionContext ,
8080});
81- ```
82-
8381// Now you can access the data from the response
8482console .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({ ... });
106106const context = new Map ();
107107context .set (" user.name" , " John Doe" );
108108context .set (" user.email" , " john@example.com" );
109+ context .set (" user.avatar" , " https://example.com/avatar.jpg" );
109110context .set (" user.metadata" , { plan: " pro" });
110111
111112await 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