@@ -20,7 +20,7 @@ specific category of applications.
2020
2121``` typescript
2222import { GleanCore } from " @gleanwork/api-client/core.js" ;
23- import { clientActivityReport } from " @gleanwork/api-client/funcs/clientActivityReport .js" ;
23+ import { clientChatStart } from " @gleanwork/api-client/funcs/clientChatStart .js" ;
2424import { SDKValidationError } from " @gleanwork/api-client/models/errors/sdkvalidationerror.js" ;
2525
2626// Use `GleanCore` for best tree-shaking performance.
@@ -30,29 +30,14 @@ const glean = new GleanCore({
3030});
3131
3232async function run() {
33- const res = await clientActivityReport (glean , {
34- events : [
33+ const res = await clientChatStart (glean , {
34+ messages : [
3535 {
36- action: " HISTORICAL_VIEW" ,
37- timestamp: new Date (" 2000-01-23T04:56:07.000Z" ),
38- url: " https://example.com/" ,
39- },
40- {
41- action: " SEARCH" ,
42- params: {
43- query: " query" ,
44- },
45- timestamp: new Date (" 2000-01-23T04:56:07.000Z" ),
46- url: " https://example.com/search?q=query" ,
47- },
48- {
49- action: " VIEW" ,
50- params: {
51- duration: 20 ,
52- referrer: " https://example.com/document" ,
53- },
54- timestamp: new Date (" 2000-01-23T04:56:07.000Z" ),
55- url: " https://example.com/" ,
36+ fragments: [
37+ {
38+ text: " What are the company holidays this year?" ,
39+ },
40+ ],
5641 },
5742 ],
5843 });
@@ -76,7 +61,8 @@ async function run() {
7661
7762 const { value : result } = res ;
7863
79-
64+ // Handle the result
65+ console .log (result );
8066}
8167
8268run ();
0 commit comments