@gleanwork/api-client 0.1.0-beta.2 → 0.1.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +34 -28
  2. package/dist/commonjs/__tests__/chat.test.js +233 -414
  3. package/dist/commonjs/__tests__/chat.test.js.map +1 -1
  4. package/dist/commonjs/funcs/chatChatStream.d.ts +16 -0
  5. package/dist/commonjs/funcs/chatChatStream.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/chatChatStream.js +121 -0
  7. package/dist/commonjs/funcs/chatChatStream.js.map +1 -0
  8. package/dist/commonjs/funcs/clientChatStart.d.ts +1 -1
  9. package/dist/commonjs/funcs/clientChatStart.d.ts.map +1 -1
  10. package/dist/commonjs/funcs/clientChatStart.js +3 -3
  11. package/dist/commonjs/funcs/clientChatStart.js.map +1 -1
  12. package/dist/commonjs/lib/config.d.ts +3 -3
  13. package/dist/commonjs/lib/config.js +3 -3
  14. package/dist/commonjs/models/operations/chatstream.d.ts +38 -0
  15. package/dist/commonjs/models/operations/chatstream.d.ts.map +1 -0
  16. package/dist/commonjs/models/operations/chatstream.js +81 -0
  17. package/dist/commonjs/models/operations/chatstream.js.map +1 -0
  18. package/dist/commonjs/models/operations/index.d.ts +1 -0
  19. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  20. package/dist/commonjs/models/operations/index.js +1 -0
  21. package/dist/commonjs/models/operations/index.js.map +1 -1
  22. package/dist/commonjs/react-query/chatChatStream.d.ts +24 -0
  23. package/dist/commonjs/react-query/chatChatStream.d.ts.map +1 -0
  24. package/dist/commonjs/react-query/chatChatStream.js +47 -0
  25. package/dist/commonjs/react-query/chatChatStream.js.map +1 -0
  26. package/dist/commonjs/react-query/clientChatStart.d.ts +1 -1
  27. package/dist/commonjs/react-query/clientChatStart.d.ts.map +1 -1
  28. package/dist/commonjs/react-query/index.d.ts +1 -0
  29. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  30. package/dist/commonjs/react-query/index.js +1 -0
  31. package/dist/commonjs/react-query/index.js.map +1 -1
  32. package/dist/commonjs/sdk/chat.d.ts +1 -57
  33. package/dist/commonjs/sdk/chat.d.ts.map +1 -1
  34. package/dist/commonjs/sdk/chat.js +3 -83
  35. package/dist/commonjs/sdk/chat.js.map +1 -1
  36. package/dist/commonjs/sdk/client.d.ts +2 -2
  37. package/dist/commonjs/sdk/client.d.ts.map +1 -1
  38. package/dist/commonjs/sdk/client.js +2 -2
  39. package/dist/commonjs/sdk/client.js.map +1 -1
  40. package/dist/commonjs/sdk/clientchat.d.ts +68 -0
  41. package/dist/commonjs/sdk/clientchat.d.ts.map +1 -0
  42. package/dist/commonjs/sdk/clientchat.js +102 -0
  43. package/dist/commonjs/sdk/clientchat.js.map +1 -0
  44. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  45. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  46. package/dist/commonjs/sdk/sdk.js +4 -0
  47. package/dist/commonjs/sdk/sdk.js.map +1 -1
  48. package/dist/esm/__tests__/chat.test.js +234 -415
  49. package/dist/esm/__tests__/chat.test.js.map +1 -1
  50. package/dist/esm/funcs/chatChatStream.d.ts +16 -0
  51. package/dist/esm/funcs/chatChatStream.d.ts.map +1 -0
  52. package/dist/esm/funcs/chatChatStream.js +85 -0
  53. package/dist/esm/funcs/chatChatStream.js.map +1 -0
  54. package/dist/esm/funcs/clientChatStart.d.ts +1 -1
  55. package/dist/esm/funcs/clientChatStart.d.ts.map +1 -1
  56. package/dist/esm/funcs/clientChatStart.js +3 -3
  57. package/dist/esm/funcs/clientChatStart.js.map +1 -1
  58. package/dist/esm/lib/config.d.ts +3 -3
  59. package/dist/esm/lib/config.js +3 -3
  60. package/dist/esm/models/operations/chatstream.d.ts +38 -0
  61. package/dist/esm/models/operations/chatstream.d.ts.map +1 -0
  62. package/dist/esm/models/operations/chatstream.js +43 -0
  63. package/dist/esm/models/operations/chatstream.js.map +1 -0
  64. package/dist/esm/models/operations/index.d.ts +1 -0
  65. package/dist/esm/models/operations/index.d.ts.map +1 -1
  66. package/dist/esm/models/operations/index.js +1 -0
  67. package/dist/esm/models/operations/index.js.map +1 -1
  68. package/dist/esm/react-query/chatChatStream.d.ts +24 -0
  69. package/dist/esm/react-query/chatChatStream.d.ts.map +1 -0
  70. package/dist/esm/react-query/chatChatStream.js +42 -0
  71. package/dist/esm/react-query/chatChatStream.js.map +1 -0
  72. package/dist/esm/react-query/clientChatStart.d.ts +1 -1
  73. package/dist/esm/react-query/clientChatStart.d.ts.map +1 -1
  74. package/dist/esm/react-query/index.d.ts +1 -0
  75. package/dist/esm/react-query/index.d.ts.map +1 -1
  76. package/dist/esm/react-query/index.js +1 -0
  77. package/dist/esm/react-query/index.js.map +1 -1
  78. package/dist/esm/sdk/chat.d.ts +1 -57
  79. package/dist/esm/sdk/chat.d.ts.map +1 -1
  80. package/dist/esm/sdk/chat.js +3 -83
  81. package/dist/esm/sdk/chat.js.map +1 -1
  82. package/dist/esm/sdk/client.d.ts +2 -2
  83. package/dist/esm/sdk/client.d.ts.map +1 -1
  84. package/dist/esm/sdk/client.js +2 -2
  85. package/dist/esm/sdk/client.js.map +1 -1
  86. package/dist/esm/sdk/clientchat.d.ts +68 -0
  87. package/dist/esm/sdk/clientchat.d.ts.map +1 -0
  88. package/dist/esm/sdk/clientchat.js +98 -0
  89. package/dist/esm/sdk/clientchat.js.map +1 -0
  90. package/dist/esm/sdk/sdk.d.ts +3 -0
  91. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  92. package/dist/esm/sdk/sdk.js +4 -0
  93. package/dist/esm/sdk/sdk.js.map +1 -1
  94. package/docs/sdks/chat/README.md +8 -768
  95. package/docs/sdks/clientchat/README.md +878 -0
  96. package/jsr.json +1 -1
  97. package/package.json +1 -1
  98. package/src/__tests__/chat.test.ts +292 -457
  99. package/src/funcs/chatChatStream.ts +169 -0
  100. package/src/funcs/clientChatStart.ts +5 -6
  101. package/src/lib/config.ts +3 -3
  102. package/src/models/operations/chatstream.ts +86 -0
  103. package/src/models/operations/index.ts +1 -0
  104. package/src/react-query/chatChatStream.ts +91 -0
  105. package/src/react-query/clientChatStart.ts +1 -1
  106. package/src/react-query/index.ts +1 -0
  107. package/src/sdk/chat.ts +3 -159
  108. package/src/sdk/client.ts +4 -4
  109. package/src/sdk/clientchat.ts +185 -0
  110. package/src/sdk/sdk.ts +6 -0
@@ -1,17 +1,129 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
- import { expect, test } from "vitest";
4
+ import { assert, expect, it, test } from "vitest";
5
5
  import { Glean } from "../index.js";
6
6
  import { createTestHTTPClient } from "./testclient.js";
7
- test("Chat Chat Default Example", async () => {
8
- const testHttpClient = createTestHTTPClient("chat-defaultExample");
7
+ it.skip("Chat Chat Default Example", async () => {
8
+ assert.fail("incomplete test found please make sure to address the following errors: [`workflow step chat-defaultExample.test referencing operation chat does not contain response body with content type text/plain`]");
9
+ });
10
+ it.skip("Chat Chat Gpt Agent Example", async () => {
11
+ assert.fail("incomplete test found please make sure to address the following errors: [`workflow step chat-gptAgentExample.test referencing operation chat does not contain response body with content type text/plain`]");
12
+ });
13
+ it.skip("Chat Chat Streaming Example", async () => {
14
+ assert.fail("incomplete test found please make sure to address the following errors: [`workflow step chat-streamingExample.test referencing operation chat does not contain response body with content type text/plain`]");
15
+ });
16
+ it.skip("Chat Chat Update Response", async () => {
17
+ assert.fail("incomplete test found please make sure to address the following errors: [`workflow step chat-updateResponse.test referencing operation chat does not contain response body with content type text/plain`]");
18
+ });
19
+ it.skip("Chat Chat Citation Response", async () => {
20
+ assert.fail("incomplete test found please make sure to address the following errors: [`workflow step chat-citationResponse.test referencing operation chat does not contain response body with content type text/plain`]");
21
+ });
22
+ test("Chat Deleteallchats", async () => {
23
+ const testHttpClient = createTestHTTPClient("deleteallchats");
24
+ const glean = new Glean({
25
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
26
+ httpClient: testHttpClient,
27
+ bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
28
+ });
29
+ await glean.client.chat.deleteAll();
30
+ });
31
+ test("Chat Deletechats", async () => {
32
+ const testHttpClient = createTestHTTPClient("deletechats");
33
+ const glean = new Glean({
34
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
35
+ httpClient: testHttpClient,
36
+ bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
37
+ });
38
+ await glean.client.chat.delete({
39
+ ids: [
40
+ "<value>",
41
+ "<value>",
42
+ ],
43
+ });
44
+ });
45
+ test("Chat Getchat", async () => {
46
+ const testHttpClient = createTestHTTPClient("getchat");
47
+ const glean = new Glean({
48
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
49
+ httpClient: testHttpClient,
50
+ bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
51
+ });
52
+ const result = await glean.client.chat.get({
53
+ id: "<id>",
54
+ });
55
+ expect(result).toBeDefined();
56
+ });
57
+ test("Chat Listchats", async () => {
58
+ const testHttpClient = createTestHTTPClient("listchats");
59
+ const glean = new Glean({
60
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
61
+ httpClient: testHttpClient,
62
+ bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
63
+ });
64
+ const result = await glean.client.chat.list();
65
+ expect(result).toBeDefined();
66
+ });
67
+ test("Chat Getchatapplication", async () => {
68
+ const testHttpClient = createTestHTTPClient("getchatapplication");
69
+ const glean = new Glean({
70
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
71
+ httpClient: testHttpClient,
72
+ bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
73
+ });
74
+ const result = await glean.client.chat.getApplication({
75
+ id: "<id>",
76
+ });
77
+ expect(result).toBeDefined();
78
+ });
79
+ test("Chat Uploadchatfiles", async () => {
80
+ const testHttpClient = createTestHTTPClient("uploadchatfiles");
9
81
  const glean = new Glean({
10
82
  serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
11
83
  httpClient: testHttpClient,
12
84
  bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
13
85
  });
14
- const result = await glean.client.chat.start({
86
+ const result = await glean.client.chat.uploadFiles({
87
+ files: [],
88
+ });
89
+ expect(result).toBeDefined();
90
+ });
91
+ test("Chat Getchatfiles", async () => {
92
+ const testHttpClient = createTestHTTPClient("getchatfiles");
93
+ const glean = new Glean({
94
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
95
+ httpClient: testHttpClient,
96
+ bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
97
+ });
98
+ const result = await glean.client.chat.getFiles({
99
+ fileIds: [
100
+ "<value>",
101
+ "<value>",
102
+ ],
103
+ });
104
+ expect(result).toBeDefined();
105
+ });
106
+ test("Chat Deletechatfiles", async () => {
107
+ const testHttpClient = createTestHTTPClient("deletechatfiles");
108
+ const glean = new Glean({
109
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
110
+ httpClient: testHttpClient,
111
+ bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
112
+ });
113
+ await glean.client.chat.deleteFiles({
114
+ fileIds: [
115
+ "<value>",
116
+ ],
117
+ });
118
+ });
119
+ test("Chat Chat Stream Default Example", async () => {
120
+ const testHttpClient = createTestHTTPClient("chatStream-defaultExample");
121
+ const glean = new Glean({
122
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
123
+ httpClient: testHttpClient,
124
+ bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
125
+ });
126
+ const result = await glean.chat.chatStream({
15
127
  messages: [
16
128
  {
17
129
  fragments: [
@@ -24,14 +136,14 @@ test("Chat Chat Default Example", async () => {
24
136
  });
25
137
  expect(result).toBeDefined();
26
138
  });
27
- test("Chat Chat Gpt Agent Example", async () => {
28
- const testHttpClient = createTestHTTPClient("chat-gptAgentExample");
139
+ test("Chat Chat Stream Gpt Agent Example", async () => {
140
+ const testHttpClient = createTestHTTPClient("chatStream-gptAgentExample");
29
141
  const glean = new Glean({
30
142
  serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
31
143
  httpClient: testHttpClient,
32
144
  bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
33
145
  });
34
- const result = await glean.client.chat.start({
146
+ const result = await glean.chat.chatStream({
35
147
  messages: [
36
148
  {
37
149
  fragments: [
@@ -47,27 +159,14 @@ test("Chat Chat Gpt Agent Example", async () => {
47
159
  });
48
160
  expect(result).toBeDefined();
49
161
  });
50
- test("Chat Chat Streaming Example", async () => {
51
- const testHttpClient = createTestHTTPClient("chat-streamingExample");
52
- const glean = new Glean({
53
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
54
- httpClient: testHttpClient,
55
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
56
- });
57
- const result = await glean.client.chat.start({
58
- messages: [],
59
- timeoutMillis: 30000,
60
- });
61
- expect(result).toBeDefined();
62
- });
63
- test("Chat Chat Update Response", async () => {
64
- const testHttpClient = createTestHTTPClient("chat-updateResponse");
162
+ test("Chat Chat Stream Streaming Example", async () => {
163
+ const testHttpClient = createTestHTTPClient("chatStream-streamingExample");
65
164
  const glean = new Glean({
66
165
  serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
67
166
  httpClient: testHttpClient,
68
167
  bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
69
168
  });
70
- const result = await glean.client.chat.start({
169
+ const result = await glean.chat.chatStream({
71
170
  messages: [
72
171
  {
73
172
  citations: [
@@ -108,7 +207,7 @@ test("Chat Chat Update Response", async () => {
108
207
  referenceRanges: [
109
208
  {
110
209
  textRange: {
111
- startIndex: 956313,
210
+ startIndex: 862990,
112
211
  document: {},
113
212
  },
114
213
  snippets: [
@@ -118,6 +217,14 @@ test("Chat Chat Update Response", async () => {
118
217
  },
119
218
  ],
120
219
  },
220
+ {
221
+ snippets: [
222
+ {
223
+ snippet: "snippet",
224
+ mimeType: "mimeType",
225
+ },
226
+ ],
227
+ },
121
228
  ],
122
229
  },
123
230
  {
@@ -168,14 +275,6 @@ test("Chat Chat Update Response", async () => {
168
275
  },
169
276
  ],
170
277
  },
171
- {
172
- snippets: [
173
- {
174
- snippet: "snippet",
175
- mimeType: "mimeType",
176
- },
177
- ],
178
- },
179
278
  ],
180
279
  },
181
280
  ],
@@ -202,19 +301,12 @@ test("Chat Chat Update Response", async () => {
202
301
  id: "<id>",
203
302
  name: "<value>",
204
303
  members: [],
304
+ customFields: [],
205
305
  datasourceProfiles: [
206
306
  {
207
307
  datasource: "github",
208
308
  handle: "<value>",
209
309
  },
210
- {
211
- datasource: "github",
212
- handle: "<value>",
213
- },
214
- {
215
- datasource: "github",
216
- handle: "<value>",
217
- },
218
310
  ],
219
311
  },
220
312
  customEntity: {
@@ -249,7 +341,7 @@ test("Chat Chat Update Response", async () => {
249
341
  likes: {
250
342
  likedBy: [],
251
343
  likedByUser: false,
252
- numLikes: 798102,
344
+ numLikes: 705667,
253
345
  },
254
346
  updatedBy: {
255
347
  name: "George Clooney",
@@ -272,14 +364,14 @@ test("Chat Chat Update Response", async () => {
272
364
  name: "George Clooney",
273
365
  obfuscatedId: "abc123",
274
366
  },
275
- remindAt: 961967,
367
+ remindAt: 56070,
276
368
  },
277
369
  candidateVerifiers: [],
278
370
  },
279
371
  },
280
372
  board: {
281
373
  name: "<value>",
282
- description: "not meh surprisingly too like embed dreamily verbally casement with",
374
+ description: "till woefully fun",
283
375
  audienceFilters: [
284
376
  {
285
377
  fieldName: "type",
@@ -295,7 +387,7 @@ test("Chat Chat Update Response", async () => {
295
387
  ],
296
388
  },
297
389
  ],
298
- id: 756840,
390
+ id: 805126,
299
391
  creator: {
300
392
  name: "George Clooney",
301
393
  obfuscatedId: "abc123",
@@ -317,7 +409,7 @@ test("Chat Chat Update Response", async () => {
317
409
  },
318
410
  collection: {
319
411
  name: "<value>",
320
- description: "daily forecast rapidly urgently slipper meh",
412
+ description: "gadzooks worth epic angrily softly inventory multicolored",
321
413
  audienceFilters: [
322
414
  {
323
415
  fieldName: "type",
@@ -333,12 +425,11 @@ test("Chat Chat Update Response", async () => {
333
425
  ],
334
426
  },
335
427
  ],
336
- id: 308354,
337
- children: [],
428
+ id: 719865,
338
429
  },
339
430
  answerBoard: {
340
431
  name: "<value>",
341
- description: "frantically highlight thunderbolt defrag aside stitcher furthermore zealous",
432
+ description: "gleaming ashamed joshingly tabulate sermon follower inferior circumference meh a",
342
433
  audienceFilters: [
343
434
  {
344
435
  fieldName: "type",
@@ -354,7 +445,7 @@ test("Chat Chat Update Response", async () => {
354
445
  ],
355
446
  },
356
447
  ],
357
- id: 87875,
448
+ id: 55438,
358
449
  },
359
450
  code: {
360
451
  repoName: "scio",
@@ -384,16 +475,73 @@ test("Chat Chat Update Response", async () => {
384
475
  metadata: {
385
476
  type: "RETRIEVAL",
386
477
  name: "<value>",
387
- displayName: "Jarrell_Hudson65",
478
+ displayName: "Joannie36",
388
479
  displayDescription: "<value>",
389
480
  objectName: "[\"HR ticket\",\"Email\",\"Chat message\"]",
390
481
  },
391
482
  },
392
483
  },
484
+ ],
485
+ },
486
+ {
487
+ citations: [
488
+ {
489
+ sourceFile: {
490
+ id: "FILE_1234",
491
+ url: "www.google.com",
492
+ name: "sample.pdf",
493
+ },
494
+ referenceRanges: [
495
+ {
496
+ snippets: [
497
+ {
498
+ snippet: "snippet",
499
+ mimeType: "mimeType",
500
+ },
501
+ ],
502
+ },
503
+ {
504
+ snippets: [
505
+ {
506
+ snippet: "snippet",
507
+ mimeType: "mimeType",
508
+ },
509
+ ],
510
+ },
511
+ {
512
+ snippets: [
513
+ {
514
+ snippet: "snippet",
515
+ mimeType: "mimeType",
516
+ },
517
+ ],
518
+ },
519
+ ],
520
+ },
521
+ ],
522
+ fragments: [
393
523
  {
394
524
  structuredResults: [
395
525
  {},
396
526
  {},
527
+ ],
528
+ file: {
529
+ id: "FILE_1234",
530
+ url: "www.google.com",
531
+ name: "sample.pdf",
532
+ },
533
+ action: {
534
+ metadata: {
535
+ type: "ACTION",
536
+ name: "<value>",
537
+ displayName: "Floyd_Hammes29",
538
+ displayDescription: "<value>",
539
+ objectName: "[\"HR ticket\",\"Email\",\"Chat message\"]",
540
+ },
541
+ },
542
+ },
543
+ {
544
+ structuredResults: [
397
545
  {},
398
546
  ],
399
547
  file: {
@@ -405,7 +553,7 @@ test("Chat Chat Update Response", async () => {
405
553
  metadata: {
406
554
  type: "RETRIEVAL",
407
555
  name: "<value>",
408
- displayName: "Bertha.Koepp",
556
+ displayName: "Jackson_Rogahn",
409
557
  displayDescription: "<value>",
410
558
  objectName: "[\"HR ticket\",\"Email\",\"Chat message\"]",
411
559
  },
@@ -424,9 +572,9 @@ test("Chat Chat Update Response", async () => {
424
572
  },
425
573
  action: {
426
574
  metadata: {
427
- type: "ACTION",
575
+ type: "RETRIEVAL",
428
576
  name: "<value>",
429
- displayName: "Sheridan.Koss71",
577
+ displayName: "Cecile69",
430
578
  displayDescription: "<value>",
431
579
  objectName: "[\"HR ticket\",\"Email\",\"Chat message\"]",
432
580
  },
@@ -451,55 +599,6 @@ test("Chat Chat Update Response", async () => {
451
599
  },
452
600
  ],
453
601
  },
454
- {
455
- snippets: [
456
- {
457
- snippet: "snippet",
458
- mimeType: "mimeType",
459
- },
460
- ],
461
- },
462
- {
463
- snippets: [
464
- {
465
- snippet: "snippet",
466
- mimeType: "mimeType",
467
- },
468
- ],
469
- },
470
- ],
471
- },
472
- {
473
- sourceFile: {
474
- id: "FILE_1234",
475
- url: "www.google.com",
476
- name: "sample.pdf",
477
- },
478
- referenceRanges: [
479
- {
480
- snippets: [
481
- {
482
- snippet: "snippet",
483
- mimeType: "mimeType",
484
- },
485
- ],
486
- },
487
- {
488
- snippets: [
489
- {
490
- snippet: "snippet",
491
- mimeType: "mimeType",
492
- },
493
- ],
494
- },
495
- {
496
- snippets: [
497
- {
498
- snippet: "snippet",
499
- mimeType: "mimeType",
500
- },
501
- ],
502
- },
503
602
  ],
504
603
  },
505
604
  ],
@@ -517,9 +616,9 @@ test("Chat Chat Update Response", async () => {
517
616
  },
518
617
  action: {
519
618
  metadata: {
520
- type: "RETRIEVAL",
619
+ type: "ACTION",
521
620
  name: "<value>",
522
- displayName: "Zoe8",
621
+ displayName: "Perry37",
523
622
  displayDescription: "<value>",
524
623
  objectName: "[\"HR ticket\",\"Email\",\"Chat message\"]",
525
624
  },
@@ -538,9 +637,9 @@ test("Chat Chat Update Response", async () => {
538
637
  },
539
638
  action: {
540
639
  metadata: {
541
- type: "ACTION",
640
+ type: "RETRIEVAL",
542
641
  name: "<value>",
543
- displayName: "Caterina70",
642
+ displayName: "Billy.Bosco",
544
643
  displayDescription: "<value>",
545
644
  objectName: "[\"HR ticket\",\"Email\",\"Chat message\"]",
546
645
  },
@@ -553,14 +652,14 @@ test("Chat Chat Update Response", async () => {
553
652
  });
554
653
  expect(result).toBeDefined();
555
654
  });
556
- test("Chat Chat Citation Response", async () => {
557
- const testHttpClient = createTestHTTPClient("chat-citationResponse");
655
+ test("Chat Chat Stream Update Response", async () => {
656
+ const testHttpClient = createTestHTTPClient("chatStream-updateResponse");
558
657
  const glean = new Glean({
559
658
  serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
560
659
  httpClient: testHttpClient,
561
660
  bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
562
661
  });
563
- const result = await glean.client.chat.start({
662
+ const result = await glean.chat.chatStream({
564
663
  messages: [
565
664
  {
566
665
  citations: [
@@ -601,7 +700,7 @@ test("Chat Chat Citation Response", async () => {
601
700
  referenceRanges: [
602
701
  {
603
702
  textRange: {
604
- startIndex: 585176,
703
+ startIndex: 347627,
605
704
  document: {},
606
705
  },
607
706
  snippets: [
@@ -621,52 +720,10 @@ test("Chat Chat Citation Response", async () => {
621
720
  },
622
721
  ],
623
722
  },
723
+ ],
724
+ fragments: [
624
725
  {
625
- sourceFile: {
626
- id: "FILE_1234",
627
- url: "www.google.com",
628
- name: "sample.pdf",
629
- },
630
- referenceRanges: [
631
- {
632
- snippets: [
633
- {
634
- snippet: "snippet",
635
- mimeType: "mimeType",
636
- },
637
- ],
638
- },
639
- ],
640
- },
641
- {
642
- sourceFile: {
643
- id: "FILE_1234",
644
- url: "www.google.com",
645
- name: "sample.pdf",
646
- },
647
- referenceRanges: [
648
- {
649
- snippets: [
650
- {
651
- snippet: "snippet",
652
- mimeType: "mimeType",
653
- },
654
- ],
655
- },
656
- {
657
- snippets: [
658
- {
659
- snippet: "snippet",
660
- mimeType: "mimeType",
661
- },
662
- ],
663
- },
664
- ],
665
- },
666
- ],
667
- fragments: [
668
- {
669
- structuredResults: [
726
+ structuredResults: [
670
727
  {
671
728
  person: {
672
729
  name: "George Clooney",
@@ -687,6 +744,7 @@ test("Chat Chat Citation Response", async () => {
687
744
  id: "<id>",
688
745
  name: "<value>",
689
746
  members: [],
747
+ customFields: [],
690
748
  datasourceProfiles: [
691
749
  {
692
750
  datasource: "github",
@@ -696,6 +754,10 @@ test("Chat Chat Citation Response", async () => {
696
754
  datasource: "github",
697
755
  handle: "<value>",
698
756
  },
757
+ {
758
+ datasource: "github",
759
+ handle: "<value>",
760
+ },
699
761
  ],
700
762
  },
701
763
  customEntity: {
@@ -729,15 +791,15 @@ test("Chat Chat Citation Response", async () => {
729
791
  },
730
792
  likes: {
731
793
  likedBy: [],
732
- likedByUser: true,
733
- numLikes: 294779,
794
+ likedByUser: false,
795
+ numLikes: 303935,
734
796
  },
735
797
  updatedBy: {
736
798
  name: "George Clooney",
737
799
  obfuscatedId: "abc123",
738
800
  },
739
801
  verification: {
740
- state: "DEPRECATED",
802
+ state: "UNVERIFIED",
741
803
  metadata: {
742
804
  lastVerifier: {
743
805
  name: "George Clooney",
@@ -753,14 +815,14 @@ test("Chat Chat Citation Response", async () => {
753
815
  name: "George Clooney",
754
816
  obfuscatedId: "abc123",
755
817
  },
756
- remindAt: 881610,
818
+ remindAt: 795702,
757
819
  },
758
820
  candidateVerifiers: [],
759
821
  },
760
822
  },
761
823
  board: {
762
824
  name: "<value>",
763
- description: "slip receptor fork",
825
+ description: "orange gracefully or",
764
826
  audienceFilters: [
765
827
  {
766
828
  fieldName: "type",
@@ -776,7 +838,7 @@ test("Chat Chat Citation Response", async () => {
776
838
  ],
777
839
  },
778
840
  ],
779
- id: 71022,
841
+ id: 527117,
780
842
  creator: {
781
843
  name: "George Clooney",
782
844
  obfuscatedId: "abc123",
@@ -798,7 +860,7 @@ test("Chat Chat Citation Response", async () => {
798
860
  },
799
861
  collection: {
800
862
  name: "<value>",
801
- description: "notarize equally hospitable",
863
+ description: "stock peaceful jovially qua potentially furiously",
802
864
  audienceFilters: [
803
865
  {
804
866
  fieldName: "type",
@@ -814,12 +876,11 @@ test("Chat Chat Citation Response", async () => {
814
876
  ],
815
877
  },
816
878
  ],
817
- id: 889117,
818
- children: [],
879
+ id: 867042,
819
880
  },
820
881
  answerBoard: {
821
882
  name: "<value>",
822
- description: "e-mail outstanding among voluntarily fooey badly beautifully",
883
+ description: "lest greatly behest molasses alienated severe consistency at",
823
884
  audienceFilters: [
824
885
  {
825
886
  fieldName: "type",
@@ -835,7 +896,7 @@ test("Chat Chat Citation Response", async () => {
835
896
  ],
836
897
  },
837
898
  ],
838
- id: 900364,
899
+ id: 913408,
839
900
  },
840
901
  code: {
841
902
  repoName: "scio",
@@ -860,31 +921,11 @@ test("Chat Chat Citation Response", async () => {
860
921
  url: "www.google.com",
861
922
  name: "sample.pdf",
862
923
  },
863
- action: {
864
- metadata: {
865
- type: "ACTION",
866
- name: "<value>",
867
- displayName: "Jamil_Koss",
868
- displayDescription: "<value>",
869
- objectName: "[\"HR ticket\",\"Email\",\"Chat message\"]",
870
- },
871
- },
872
- },
873
- {
874
- structuredResults: [
875
- {},
876
- {},
877
- ],
878
- file: {
879
- id: "FILE_1234",
880
- url: "www.google.com",
881
- name: "sample.pdf",
882
- },
883
924
  action: {
884
925
  metadata: {
885
926
  type: "RETRIEVAL",
886
927
  name: "<value>",
887
- displayName: "Julien_Okuneva",
928
+ displayName: "Yasmin_King",
888
929
  displayDescription: "<value>",
889
930
  objectName: "[\"HR ticket\",\"Email\",\"Chat message\"]",
890
931
  },
@@ -894,125 +935,6 @@ test("Chat Chat Citation Response", async () => {
894
935
  structuredResults: [
895
936
  {},
896
937
  {},
897
- ],
898
- file: {
899
- id: "FILE_1234",
900
- url: "www.google.com",
901
- name: "sample.pdf",
902
- },
903
- action: {
904
- metadata: {
905
- type: "RETRIEVAL",
906
- name: "<value>",
907
- displayName: "Eulalia31",
908
- displayDescription: "<value>",
909
- objectName: "[\"HR ticket\",\"Email\",\"Chat message\"]",
910
- },
911
- },
912
- },
913
- ],
914
- },
915
- {
916
- citations: [
917
- {
918
- sourceFile: {
919
- id: "FILE_1234",
920
- url: "www.google.com",
921
- name: "sample.pdf",
922
- },
923
- referenceRanges: [
924
- {
925
- snippets: [
926
- {
927
- snippet: "snippet",
928
- mimeType: "mimeType",
929
- },
930
- ],
931
- },
932
- {
933
- snippets: [
934
- {
935
- snippet: "snippet",
936
- mimeType: "mimeType",
937
- },
938
- ],
939
- },
940
- ],
941
- },
942
- {
943
- sourceFile: {
944
- id: "FILE_1234",
945
- url: "www.google.com",
946
- name: "sample.pdf",
947
- },
948
- referenceRanges: [
949
- {
950
- snippets: [
951
- {
952
- snippet: "snippet",
953
- mimeType: "mimeType",
954
- },
955
- ],
956
- },
957
- ],
958
- },
959
- {
960
- sourceFile: {
961
- id: "FILE_1234",
962
- url: "www.google.com",
963
- name: "sample.pdf",
964
- },
965
- referenceRanges: [
966
- {
967
- snippets: [
968
- {
969
- snippet: "snippet",
970
- mimeType: "mimeType",
971
- },
972
- ],
973
- },
974
- {
975
- snippets: [
976
- {
977
- snippet: "snippet",
978
- mimeType: "mimeType",
979
- },
980
- ],
981
- },
982
- {
983
- snippets: [
984
- {
985
- snippet: "snippet",
986
- mimeType: "mimeType",
987
- },
988
- ],
989
- },
990
- ],
991
- },
992
- ],
993
- fragments: [
994
- {
995
- structuredResults: [
996
- {},
997
- {},
998
- ],
999
- file: {
1000
- id: "FILE_1234",
1001
- url: "www.google.com",
1002
- name: "sample.pdf",
1003
- },
1004
- action: {
1005
- metadata: {
1006
- type: "RETRIEVAL",
1007
- name: "<value>",
1008
- displayName: "Eladio82",
1009
- displayDescription: "<value>",
1010
- objectName: "[\"HR ticket\",\"Email\",\"Chat message\"]",
1011
- },
1012
- },
1013
- },
1014
- {
1015
- structuredResults: [
1016
938
  {},
1017
939
  ],
1018
940
  file: {
@@ -1024,26 +946,7 @@ test("Chat Chat Citation Response", async () => {
1024
946
  metadata: {
1025
947
  type: "ACTION",
1026
948
  name: "<value>",
1027
- displayName: "Jeanne52",
1028
- displayDescription: "<value>",
1029
- objectName: "[\"HR ticket\",\"Email\",\"Chat message\"]",
1030
- },
1031
- },
1032
- },
1033
- {
1034
- structuredResults: [
1035
- {},
1036
- ],
1037
- file: {
1038
- id: "FILE_1234",
1039
- url: "www.google.com",
1040
- name: "sample.pdf",
1041
- },
1042
- action: {
1043
- metadata: {
1044
- type: "RETRIEVAL",
1045
- name: "<value>",
1046
- displayName: "Naomie.Corkery",
949
+ displayName: "Jeffrey97",
1047
950
  displayDescription: "<value>",
1048
951
  objectName: "[\"HR ticket\",\"Email\",\"Chat message\"]",
1049
952
  },
@@ -1056,101 +959,17 @@ test("Chat Chat Citation Response", async () => {
1056
959
  });
1057
960
  expect(result).toBeDefined();
1058
961
  });
1059
- test("Chat Deleteallchats", async () => {
1060
- const testHttpClient = createTestHTTPClient("deleteallchats");
1061
- const glean = new Glean({
1062
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1063
- httpClient: testHttpClient,
1064
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
1065
- });
1066
- await glean.client.chat.deleteAll();
1067
- });
1068
- test("Chat Deletechats", async () => {
1069
- const testHttpClient = createTestHTTPClient("deletechats");
1070
- const glean = new Glean({
1071
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1072
- httpClient: testHttpClient,
1073
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
1074
- });
1075
- await glean.client.chat.delete({
1076
- ids: [
1077
- "<value>",
1078
- "<value>",
1079
- ],
1080
- });
1081
- });
1082
- test("Chat Getchat", async () => {
1083
- const testHttpClient = createTestHTTPClient("getchat");
1084
- const glean = new Glean({
1085
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1086
- httpClient: testHttpClient,
1087
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
1088
- });
1089
- const result = await glean.client.chat.get({
1090
- id: "<id>",
1091
- });
1092
- expect(result).toBeDefined();
1093
- });
1094
- test("Chat Listchats", async () => {
1095
- const testHttpClient = createTestHTTPClient("listchats");
1096
- const glean = new Glean({
1097
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1098
- httpClient: testHttpClient,
1099
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
1100
- });
1101
- const result = await glean.client.chat.list();
1102
- expect(result).toBeDefined();
1103
- });
1104
- test("Chat Getchatapplication", async () => {
1105
- const testHttpClient = createTestHTTPClient("getchatapplication");
1106
- const glean = new Glean({
1107
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1108
- httpClient: testHttpClient,
1109
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
1110
- });
1111
- const result = await glean.client.chat.getApplication({
1112
- id: "<id>",
1113
- });
1114
- expect(result).toBeDefined();
1115
- });
1116
- test("Chat Uploadchatfiles", async () => {
1117
- const testHttpClient = createTestHTTPClient("uploadchatfiles");
1118
- const glean = new Glean({
1119
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1120
- httpClient: testHttpClient,
1121
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
1122
- });
1123
- const result = await glean.client.chat.uploadFiles({
1124
- files: [],
1125
- });
1126
- expect(result).toBeDefined();
1127
- });
1128
- test("Chat Getchatfiles", async () => {
1129
- const testHttpClient = createTestHTTPClient("getchatfiles");
962
+ test("Chat Chat Stream Citation Response", async () => {
963
+ const testHttpClient = createTestHTTPClient("chatStream-citationResponse");
1130
964
  const glean = new Glean({
1131
965
  serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1132
966
  httpClient: testHttpClient,
1133
967
  bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
1134
968
  });
1135
- const result = await glean.client.chat.getFiles({
1136
- fileIds: [
1137
- "<value>",
1138
- "<value>",
1139
- ],
969
+ const result = await glean.chat.chatStream({
970
+ messages: [],
971
+ timeoutMillis: 30000,
1140
972
  });
1141
973
  expect(result).toBeDefined();
1142
974
  });
1143
- test("Chat Deletechatfiles", async () => {
1144
- const testHttpClient = createTestHTTPClient("deletechatfiles");
1145
- const glean = new Glean({
1146
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
1147
- httpClient: testHttpClient,
1148
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "value",
1149
- });
1150
- await glean.client.chat.deleteFiles({
1151
- fileIds: [
1152
- "<value>",
1153
- ],
1154
- });
1155
- });
1156
975
  //# sourceMappingURL=chat.test.js.map