@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.
- package/README.md +34 -28
- package/dist/commonjs/__tests__/chat.test.js +233 -414
- package/dist/commonjs/__tests__/chat.test.js.map +1 -1
- package/dist/commonjs/funcs/chatChatStream.d.ts +16 -0
- package/dist/commonjs/funcs/chatChatStream.d.ts.map +1 -0
- package/dist/commonjs/funcs/chatChatStream.js +121 -0
- package/dist/commonjs/funcs/chatChatStream.js.map +1 -0
- package/dist/commonjs/funcs/clientChatStart.d.ts +1 -1
- package/dist/commonjs/funcs/clientChatStart.d.ts.map +1 -1
- package/dist/commonjs/funcs/clientChatStart.js +3 -3
- package/dist/commonjs/funcs/clientChatStart.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/operations/chatstream.d.ts +38 -0
- package/dist/commonjs/models/operations/chatstream.d.ts.map +1 -0
- package/dist/commonjs/models/operations/chatstream.js +81 -0
- package/dist/commonjs/models/operations/chatstream.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/react-query/chatChatStream.d.ts +24 -0
- package/dist/commonjs/react-query/chatChatStream.d.ts.map +1 -0
- package/dist/commonjs/react-query/chatChatStream.js +47 -0
- package/dist/commonjs/react-query/chatChatStream.js.map +1 -0
- package/dist/commonjs/react-query/clientChatStart.d.ts +1 -1
- package/dist/commonjs/react-query/clientChatStart.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/sdk/chat.d.ts +1 -57
- package/dist/commonjs/sdk/chat.d.ts.map +1 -1
- package/dist/commonjs/sdk/chat.js +3 -83
- package/dist/commonjs/sdk/chat.js.map +1 -1
- package/dist/commonjs/sdk/client.d.ts +2 -2
- package/dist/commonjs/sdk/client.d.ts.map +1 -1
- package/dist/commonjs/sdk/client.js +2 -2
- package/dist/commonjs/sdk/client.js.map +1 -1
- package/dist/commonjs/sdk/clientchat.d.ts +68 -0
- package/dist/commonjs/sdk/clientchat.d.ts.map +1 -0
- package/dist/commonjs/sdk/clientchat.js +102 -0
- package/dist/commonjs/sdk/clientchat.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/__tests__/chat.test.js +234 -415
- package/dist/esm/__tests__/chat.test.js.map +1 -1
- package/dist/esm/funcs/chatChatStream.d.ts +16 -0
- package/dist/esm/funcs/chatChatStream.d.ts.map +1 -0
- package/dist/esm/funcs/chatChatStream.js +85 -0
- package/dist/esm/funcs/chatChatStream.js.map +1 -0
- package/dist/esm/funcs/clientChatStart.d.ts +1 -1
- package/dist/esm/funcs/clientChatStart.d.ts.map +1 -1
- package/dist/esm/funcs/clientChatStart.js +3 -3
- package/dist/esm/funcs/clientChatStart.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/operations/chatstream.d.ts +38 -0
- package/dist/esm/models/operations/chatstream.d.ts.map +1 -0
- package/dist/esm/models/operations/chatstream.js +43 -0
- package/dist/esm/models/operations/chatstream.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/react-query/chatChatStream.d.ts +24 -0
- package/dist/esm/react-query/chatChatStream.d.ts.map +1 -0
- package/dist/esm/react-query/chatChatStream.js +42 -0
- package/dist/esm/react-query/chatChatStream.js.map +1 -0
- package/dist/esm/react-query/clientChatStart.d.ts +1 -1
- package/dist/esm/react-query/clientChatStart.d.ts.map +1 -1
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/sdk/chat.d.ts +1 -57
- package/dist/esm/sdk/chat.d.ts.map +1 -1
- package/dist/esm/sdk/chat.js +3 -83
- package/dist/esm/sdk/chat.js.map +1 -1
- package/dist/esm/sdk/client.d.ts +2 -2
- package/dist/esm/sdk/client.d.ts.map +1 -1
- package/dist/esm/sdk/client.js +2 -2
- package/dist/esm/sdk/client.js.map +1 -1
- package/dist/esm/sdk/clientchat.d.ts +68 -0
- package/dist/esm/sdk/clientchat.d.ts.map +1 -0
- package/dist/esm/sdk/clientchat.js +98 -0
- package/dist/esm/sdk/clientchat.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/docs/sdks/chat/README.md +8 -768
- package/docs/sdks/clientchat/README.md +878 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/chat.test.ts +292 -457
- package/src/funcs/chatChatStream.ts +169 -0
- package/src/funcs/clientChatStart.ts +5 -6
- package/src/lib/config.ts +3 -3
- package/src/models/operations/chatstream.ts +86 -0
- package/src/models/operations/index.ts +1 -0
- package/src/react-query/chatChatStream.ts +91 -0
- package/src/react-query/clientChatStart.ts +1 -1
- package/src/react-query/index.ts +1 -0
- package/src/sdk/chat.ts +3 -159
- package/src/sdk/client.ts +4 -4
- package/src/sdk/clientchat.ts +185 -0
- package/src/sdk/sdk.ts +6 -0
package/docs/sdks/chat/README.md
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
# Chat
|
|
2
|
-
(*
|
|
2
|
+
(*chat*)
|
|
3
3
|
|
|
4
4
|
## Overview
|
|
5
5
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
|
-
* [
|
|
9
|
-
* [deleteAll](#deleteall) - Deletes all saved Chats owned by a user
|
|
10
|
-
* [delete](#delete) - Deletes saved Chats
|
|
11
|
-
* [get](#get) - Retrieves a Chat
|
|
12
|
-
* [list](#list) - Retrieves all saved Chats
|
|
13
|
-
* [getApplication](#getapplication) - Gets the metadata for a custom Chat application
|
|
14
|
-
* [uploadFiles](#uploadfiles) - Upload files for Chat.
|
|
15
|
-
* [getFiles](#getfiles) - Get files uploaded by a user for Chat.
|
|
16
|
-
* [deleteFiles](#deletefiles) - Delete files uploaded by a user for chat.
|
|
8
|
+
* [chatStream](#chatstream) - Chat
|
|
17
9
|
|
|
18
|
-
##
|
|
10
|
+
## chatStream
|
|
19
11
|
|
|
20
12
|
Have a conversation with Glean AI.
|
|
21
13
|
|
|
@@ -29,7 +21,7 @@ const glean = new Glean({
|
|
|
29
21
|
});
|
|
30
22
|
|
|
31
23
|
async function run() {
|
|
32
|
-
const result = await glean.
|
|
24
|
+
const result = await glean.chat.chatStream({
|
|
33
25
|
messages: [
|
|
34
26
|
{
|
|
35
27
|
fragments: [
|
|
@@ -54,7 +46,7 @@ The standalone function version of this method:
|
|
|
54
46
|
|
|
55
47
|
```typescript
|
|
56
48
|
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
57
|
-
import {
|
|
49
|
+
import { chatChatStream } from "@gleanwork/api-client/funcs/chatChatStream.js";
|
|
58
50
|
|
|
59
51
|
// Use `GleanCore` for best tree-shaking performance.
|
|
60
52
|
// You can create one instance of it to use across an application.
|
|
@@ -63,7 +55,7 @@ const glean = new GleanCore({
|
|
|
63
55
|
});
|
|
64
56
|
|
|
65
57
|
async function run() {
|
|
66
|
-
const res = await
|
|
58
|
+
const res = await chatChatStream(glean, {
|
|
67
59
|
messages: [
|
|
68
60
|
{
|
|
69
61
|
fragments: [
|
|
@@ -101,8 +93,8 @@ associated utilities.
|
|
|
101
93
|
```tsx
|
|
102
94
|
import {
|
|
103
95
|
// Mutation hook for triggering the API call.
|
|
104
|
-
|
|
105
|
-
} from "@gleanwork/api-client/react-query/
|
|
96
|
+
useChatChatStreamMutation
|
|
97
|
+
} from "@gleanwork/api-client/react-query/chatChatStream.js";
|
|
106
98
|
```
|
|
107
99
|
|
|
108
100
|
### Parameters
|
|
@@ -121,758 +113,6 @@ import {
|
|
|
121
113
|
|
|
122
114
|
### Errors
|
|
123
115
|
|
|
124
|
-
| Error Type | Status Code | Content Type |
|
|
125
|
-
| ----------------- | ----------------- | ----------------- |
|
|
126
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
127
|
-
|
|
128
|
-
## deleteAll
|
|
129
|
-
|
|
130
|
-
Deletes all saved Chats a user has had and all their contained conversational content.
|
|
131
|
-
|
|
132
|
-
### Example Usage
|
|
133
|
-
|
|
134
|
-
```typescript
|
|
135
|
-
import { Glean } from "@gleanwork/api-client";
|
|
136
|
-
|
|
137
|
-
const glean = new Glean({
|
|
138
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
async function run() {
|
|
142
|
-
await glean.client.chat.deleteAll();
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
run();
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
### Standalone function
|
|
151
|
-
|
|
152
|
-
The standalone function version of this method:
|
|
153
|
-
|
|
154
|
-
```typescript
|
|
155
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
156
|
-
import { clientChatDeleteAll } from "@gleanwork/api-client/funcs/clientChatDeleteAll.js";
|
|
157
|
-
|
|
158
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
159
|
-
// You can create one instance of it to use across an application.
|
|
160
|
-
const glean = new GleanCore({
|
|
161
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
async function run() {
|
|
165
|
-
const res = await clientChatDeleteAll(glean);
|
|
166
|
-
|
|
167
|
-
if (!res.ok) {
|
|
168
|
-
throw res.error;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const { value: result } = res;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
run();
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
### React hooks and utilities
|
|
180
|
-
|
|
181
|
-
This method can be used in React components through the following hooks and
|
|
182
|
-
associated utilities.
|
|
183
|
-
|
|
184
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
185
|
-
> below and how to get started using React hooks.
|
|
186
|
-
|
|
187
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
188
|
-
|
|
189
|
-
```tsx
|
|
190
|
-
import {
|
|
191
|
-
// Mutation hook for triggering the API call.
|
|
192
|
-
useClientChatDeleteAllMutation
|
|
193
|
-
} from "@gleanwork/api-client/react-query/clientChatDeleteAll.js";
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### Parameters
|
|
197
|
-
|
|
198
|
-
| Parameter | Type | Required | Description |
|
|
199
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
200
|
-
| `timezoneOffset` | *number* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. |
|
|
201
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
202
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
203
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
204
|
-
|
|
205
|
-
### Response
|
|
206
|
-
|
|
207
|
-
**Promise\<void\>**
|
|
208
|
-
|
|
209
|
-
### Errors
|
|
210
|
-
|
|
211
|
-
| Error Type | Status Code | Content Type |
|
|
212
|
-
| ----------------- | ----------------- | ----------------- |
|
|
213
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
214
|
-
|
|
215
|
-
## delete
|
|
216
|
-
|
|
217
|
-
Deletes saved Chats and all their contained conversational content.
|
|
218
|
-
|
|
219
|
-
### Example Usage
|
|
220
|
-
|
|
221
|
-
```typescript
|
|
222
|
-
import { Glean } from "@gleanwork/api-client";
|
|
223
|
-
|
|
224
|
-
const glean = new Glean({
|
|
225
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
async function run() {
|
|
229
|
-
await glean.client.chat.delete({
|
|
230
|
-
ids: [
|
|
231
|
-
"<value>",
|
|
232
|
-
"<value>",
|
|
233
|
-
],
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
run();
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
### Standalone function
|
|
243
|
-
|
|
244
|
-
The standalone function version of this method:
|
|
245
|
-
|
|
246
|
-
```typescript
|
|
247
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
248
|
-
import { clientChatDelete } from "@gleanwork/api-client/funcs/clientChatDelete.js";
|
|
249
|
-
|
|
250
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
251
|
-
// You can create one instance of it to use across an application.
|
|
252
|
-
const glean = new GleanCore({
|
|
253
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
async function run() {
|
|
257
|
-
const res = await clientChatDelete(glean, {
|
|
258
|
-
ids: [
|
|
259
|
-
"<value>",
|
|
260
|
-
"<value>",
|
|
261
|
-
],
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
if (!res.ok) {
|
|
265
|
-
throw res.error;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
const { value: result } = res;
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
run();
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
### React hooks and utilities
|
|
277
|
-
|
|
278
|
-
This method can be used in React components through the following hooks and
|
|
279
|
-
associated utilities.
|
|
280
|
-
|
|
281
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
282
|
-
> below and how to get started using React hooks.
|
|
283
|
-
|
|
284
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
285
|
-
|
|
286
|
-
```tsx
|
|
287
|
-
import {
|
|
288
|
-
// Mutation hook for triggering the API call.
|
|
289
|
-
useClientChatDeleteMutation
|
|
290
|
-
} from "@gleanwork/api-client/react-query/clientChatDelete.js";
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### Parameters
|
|
294
|
-
|
|
295
|
-
| Parameter | Type | Required | Description |
|
|
296
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
297
|
-
| `deleteChatsRequest` | [components.DeleteChatsRequest](../../models/components/deletechatsrequest.md) | :heavy_check_mark: | N/A |
|
|
298
|
-
| `timezoneOffset` | *number* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. |
|
|
299
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
300
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
301
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
302
|
-
|
|
303
|
-
### Response
|
|
304
|
-
|
|
305
|
-
**Promise\<void\>**
|
|
306
|
-
|
|
307
|
-
### Errors
|
|
308
|
-
|
|
309
|
-
| Error Type | Status Code | Content Type |
|
|
310
|
-
| ----------------- | ----------------- | ----------------- |
|
|
311
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
312
|
-
|
|
313
|
-
## get
|
|
314
|
-
|
|
315
|
-
Retrieves the chat history between Glean Assistant and the user for a given Chat.
|
|
316
|
-
|
|
317
|
-
### Example Usage
|
|
318
|
-
|
|
319
|
-
```typescript
|
|
320
|
-
import { Glean } from "@gleanwork/api-client";
|
|
321
|
-
|
|
322
|
-
const glean = new Glean({
|
|
323
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
async function run() {
|
|
327
|
-
const result = await glean.client.chat.get({
|
|
328
|
-
id: "<id>",
|
|
329
|
-
});
|
|
330
|
-
|
|
331
|
-
// Handle the result
|
|
332
|
-
console.log(result);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
run();
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
### Standalone function
|
|
339
|
-
|
|
340
|
-
The standalone function version of this method:
|
|
341
|
-
|
|
342
|
-
```typescript
|
|
343
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
344
|
-
import { clientChatGet } from "@gleanwork/api-client/funcs/clientChatGet.js";
|
|
345
|
-
|
|
346
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
347
|
-
// You can create one instance of it to use across an application.
|
|
348
|
-
const glean = new GleanCore({
|
|
349
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
async function run() {
|
|
353
|
-
const res = await clientChatGet(glean, {
|
|
354
|
-
id: "<id>",
|
|
355
|
-
});
|
|
356
|
-
|
|
357
|
-
if (!res.ok) {
|
|
358
|
-
throw res.error;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
const { value: result } = res;
|
|
362
|
-
|
|
363
|
-
// Handle the result
|
|
364
|
-
console.log(result);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
run();
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
### React hooks and utilities
|
|
371
|
-
|
|
372
|
-
This method can be used in React components through the following hooks and
|
|
373
|
-
associated utilities.
|
|
374
|
-
|
|
375
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
376
|
-
> below and how to get started using React hooks.
|
|
377
|
-
|
|
378
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
379
|
-
|
|
380
|
-
```tsx
|
|
381
|
-
import {
|
|
382
|
-
// Mutation hook for triggering the API call.
|
|
383
|
-
useClientChatGetMutation
|
|
384
|
-
} from "@gleanwork/api-client/react-query/clientChatGet.js";
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
### Parameters
|
|
388
|
-
|
|
389
|
-
| Parameter | Type | Required | Description |
|
|
390
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
391
|
-
| `getChatRequest` | [components.GetChatRequest](../../models/components/getchatrequest.md) | :heavy_check_mark: | N/A |
|
|
392
|
-
| `timezoneOffset` | *number* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. |
|
|
393
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
394
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
395
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
396
|
-
|
|
397
|
-
### Response
|
|
398
|
-
|
|
399
|
-
**Promise\<[components.GetChatResponse](../../models/components/getchatresponse.md)\>**
|
|
400
|
-
|
|
401
|
-
### Errors
|
|
402
|
-
|
|
403
|
-
| Error Type | Status Code | Content Type |
|
|
404
|
-
| ----------------- | ----------------- | ----------------- |
|
|
405
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
406
|
-
|
|
407
|
-
## list
|
|
408
|
-
|
|
409
|
-
Retrieves all the saved Chats between Glean Assistant and the user. The returned Chats contain only metadata and no conversational content.
|
|
410
|
-
|
|
411
|
-
### Example Usage
|
|
412
|
-
|
|
413
|
-
```typescript
|
|
414
|
-
import { Glean } from "@gleanwork/api-client";
|
|
415
|
-
|
|
416
|
-
const glean = new Glean({
|
|
417
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
418
|
-
});
|
|
419
|
-
|
|
420
|
-
async function run() {
|
|
421
|
-
const result = await glean.client.chat.list();
|
|
422
|
-
|
|
423
|
-
// Handle the result
|
|
424
|
-
console.log(result);
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
run();
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
### Standalone function
|
|
431
|
-
|
|
432
|
-
The standalone function version of this method:
|
|
433
|
-
|
|
434
|
-
```typescript
|
|
435
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
436
|
-
import { clientChatList } from "@gleanwork/api-client/funcs/clientChatList.js";
|
|
437
|
-
|
|
438
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
439
|
-
// You can create one instance of it to use across an application.
|
|
440
|
-
const glean = new GleanCore({
|
|
441
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
async function run() {
|
|
445
|
-
const res = await clientChatList(glean);
|
|
446
|
-
|
|
447
|
-
if (!res.ok) {
|
|
448
|
-
throw res.error;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
const { value: result } = res;
|
|
452
|
-
|
|
453
|
-
// Handle the result
|
|
454
|
-
console.log(result);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
run();
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
### React hooks and utilities
|
|
461
|
-
|
|
462
|
-
This method can be used in React components through the following hooks and
|
|
463
|
-
associated utilities.
|
|
464
|
-
|
|
465
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
466
|
-
> below and how to get started using React hooks.
|
|
467
|
-
|
|
468
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
469
|
-
|
|
470
|
-
```tsx
|
|
471
|
-
import {
|
|
472
|
-
// Mutation hook for triggering the API call.
|
|
473
|
-
useClientChatListMutation
|
|
474
|
-
} from "@gleanwork/api-client/react-query/clientChatList.js";
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
### Parameters
|
|
478
|
-
|
|
479
|
-
| Parameter | Type | Required | Description |
|
|
480
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
481
|
-
| `timezoneOffset` | *number* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. |
|
|
482
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
483
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
484
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
485
|
-
|
|
486
|
-
### Response
|
|
487
|
-
|
|
488
|
-
**Promise\<[components.ListChatsResponse](../../models/components/listchatsresponse.md)\>**
|
|
489
|
-
|
|
490
|
-
### Errors
|
|
491
|
-
|
|
492
|
-
| Error Type | Status Code | Content Type |
|
|
493
|
-
| ----------------- | ----------------- | ----------------- |
|
|
494
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
495
|
-
|
|
496
|
-
## getApplication
|
|
497
|
-
|
|
498
|
-
Gets the Chat application details for the specified application ID.
|
|
499
|
-
|
|
500
|
-
### Example Usage
|
|
501
|
-
|
|
502
|
-
```typescript
|
|
503
|
-
import { Glean } from "@gleanwork/api-client";
|
|
504
|
-
|
|
505
|
-
const glean = new Glean({
|
|
506
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
507
|
-
});
|
|
508
|
-
|
|
509
|
-
async function run() {
|
|
510
|
-
const result = await glean.client.chat.getApplication({
|
|
511
|
-
id: "<id>",
|
|
512
|
-
});
|
|
513
|
-
|
|
514
|
-
// Handle the result
|
|
515
|
-
console.log(result);
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
run();
|
|
519
|
-
```
|
|
520
|
-
|
|
521
|
-
### Standalone function
|
|
522
|
-
|
|
523
|
-
The standalone function version of this method:
|
|
524
|
-
|
|
525
|
-
```typescript
|
|
526
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
527
|
-
import { clientChatGetApplication } from "@gleanwork/api-client/funcs/clientChatGetApplication.js";
|
|
528
|
-
|
|
529
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
530
|
-
// You can create one instance of it to use across an application.
|
|
531
|
-
const glean = new GleanCore({
|
|
532
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
533
|
-
});
|
|
534
|
-
|
|
535
|
-
async function run() {
|
|
536
|
-
const res = await clientChatGetApplication(glean, {
|
|
537
|
-
id: "<id>",
|
|
538
|
-
});
|
|
539
|
-
|
|
540
|
-
if (!res.ok) {
|
|
541
|
-
throw res.error;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
const { value: result } = res;
|
|
545
|
-
|
|
546
|
-
// Handle the result
|
|
547
|
-
console.log(result);
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
run();
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
### React hooks and utilities
|
|
554
|
-
|
|
555
|
-
This method can be used in React components through the following hooks and
|
|
556
|
-
associated utilities.
|
|
557
|
-
|
|
558
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
559
|
-
> below and how to get started using React hooks.
|
|
560
|
-
|
|
561
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
562
|
-
|
|
563
|
-
```tsx
|
|
564
|
-
import {
|
|
565
|
-
// Mutation hook for triggering the API call.
|
|
566
|
-
useClientChatGetApplicationMutation
|
|
567
|
-
} from "@gleanwork/api-client/react-query/clientChatGetApplication.js";
|
|
568
|
-
```
|
|
569
|
-
|
|
570
|
-
### Parameters
|
|
571
|
-
|
|
572
|
-
| Parameter | Type | Required | Description |
|
|
573
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
574
|
-
| `getChatApplicationRequest` | [components.GetChatApplicationRequest](../../models/components/getchatapplicationrequest.md) | :heavy_check_mark: | N/A |
|
|
575
|
-
| `timezoneOffset` | *number* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. |
|
|
576
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
577
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
578
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
579
|
-
|
|
580
|
-
### Response
|
|
581
|
-
|
|
582
|
-
**Promise\<[components.GetChatApplicationResponse](../../models/components/getchatapplicationresponse.md)\>**
|
|
583
|
-
|
|
584
|
-
### Errors
|
|
585
|
-
|
|
586
|
-
| Error Type | Status Code | Content Type |
|
|
587
|
-
| ----------------- | ----------------- | ----------------- |
|
|
588
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
589
|
-
|
|
590
|
-
## uploadFiles
|
|
591
|
-
|
|
592
|
-
Upload files for Chat.
|
|
593
|
-
|
|
594
|
-
### Example Usage
|
|
595
|
-
|
|
596
|
-
```typescript
|
|
597
|
-
import { Glean } from "@gleanwork/api-client";
|
|
598
|
-
|
|
599
|
-
const glean = new Glean({
|
|
600
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
601
|
-
});
|
|
602
|
-
|
|
603
|
-
async function run() {
|
|
604
|
-
const result = await glean.client.chat.uploadFiles({
|
|
605
|
-
files: [],
|
|
606
|
-
});
|
|
607
|
-
|
|
608
|
-
// Handle the result
|
|
609
|
-
console.log(result);
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
run();
|
|
613
|
-
```
|
|
614
|
-
|
|
615
|
-
### Standalone function
|
|
616
|
-
|
|
617
|
-
The standalone function version of this method:
|
|
618
|
-
|
|
619
|
-
```typescript
|
|
620
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
621
|
-
import { clientChatUploadFiles } from "@gleanwork/api-client/funcs/clientChatUploadFiles.js";
|
|
622
|
-
|
|
623
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
624
|
-
// You can create one instance of it to use across an application.
|
|
625
|
-
const glean = new GleanCore({
|
|
626
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
627
|
-
});
|
|
628
|
-
|
|
629
|
-
async function run() {
|
|
630
|
-
const res = await clientChatUploadFiles(glean, {
|
|
631
|
-
files: [],
|
|
632
|
-
});
|
|
633
|
-
|
|
634
|
-
if (!res.ok) {
|
|
635
|
-
throw res.error;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
const { value: result } = res;
|
|
639
|
-
|
|
640
|
-
// Handle the result
|
|
641
|
-
console.log(result);
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
run();
|
|
645
|
-
```
|
|
646
|
-
|
|
647
|
-
### React hooks and utilities
|
|
648
|
-
|
|
649
|
-
This method can be used in React components through the following hooks and
|
|
650
|
-
associated utilities.
|
|
651
|
-
|
|
652
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
653
|
-
> below and how to get started using React hooks.
|
|
654
|
-
|
|
655
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
656
|
-
|
|
657
|
-
```tsx
|
|
658
|
-
import {
|
|
659
|
-
// Mutation hook for triggering the API call.
|
|
660
|
-
useClientChatUploadFilesMutation
|
|
661
|
-
} from "@gleanwork/api-client/react-query/clientChatUploadFiles.js";
|
|
662
|
-
```
|
|
663
|
-
|
|
664
|
-
### Parameters
|
|
665
|
-
|
|
666
|
-
| Parameter | Type | Required | Description |
|
|
667
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
668
|
-
| `uploadChatFilesRequest` | [components.UploadChatFilesRequest](../../models/components/uploadchatfilesrequest.md) | :heavy_check_mark: | N/A |
|
|
669
|
-
| `timezoneOffset` | *number* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. |
|
|
670
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
671
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
672
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
673
|
-
|
|
674
|
-
### Response
|
|
675
|
-
|
|
676
|
-
**Promise\<[components.UploadChatFilesResponse](../../models/components/uploadchatfilesresponse.md)\>**
|
|
677
|
-
|
|
678
|
-
### Errors
|
|
679
|
-
|
|
680
|
-
| Error Type | Status Code | Content Type |
|
|
681
|
-
| ----------------- | ----------------- | ----------------- |
|
|
682
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
683
|
-
|
|
684
|
-
## getFiles
|
|
685
|
-
|
|
686
|
-
Get files uploaded by a user for Chat.
|
|
687
|
-
|
|
688
|
-
### Example Usage
|
|
689
|
-
|
|
690
|
-
```typescript
|
|
691
|
-
import { Glean } from "@gleanwork/api-client";
|
|
692
|
-
|
|
693
|
-
const glean = new Glean({
|
|
694
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
695
|
-
});
|
|
696
|
-
|
|
697
|
-
async function run() {
|
|
698
|
-
const result = await glean.client.chat.getFiles({
|
|
699
|
-
fileIds: [
|
|
700
|
-
"<value>",
|
|
701
|
-
"<value>",
|
|
702
|
-
],
|
|
703
|
-
});
|
|
704
|
-
|
|
705
|
-
// Handle the result
|
|
706
|
-
console.log(result);
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
run();
|
|
710
|
-
```
|
|
711
|
-
|
|
712
|
-
### Standalone function
|
|
713
|
-
|
|
714
|
-
The standalone function version of this method:
|
|
715
|
-
|
|
716
|
-
```typescript
|
|
717
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
718
|
-
import { clientChatGetFiles } from "@gleanwork/api-client/funcs/clientChatGetFiles.js";
|
|
719
|
-
|
|
720
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
721
|
-
// You can create one instance of it to use across an application.
|
|
722
|
-
const glean = new GleanCore({
|
|
723
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
724
|
-
});
|
|
725
|
-
|
|
726
|
-
async function run() {
|
|
727
|
-
const res = await clientChatGetFiles(glean, {
|
|
728
|
-
fileIds: [
|
|
729
|
-
"<value>",
|
|
730
|
-
"<value>",
|
|
731
|
-
],
|
|
732
|
-
});
|
|
733
|
-
|
|
734
|
-
if (!res.ok) {
|
|
735
|
-
throw res.error;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
const { value: result } = res;
|
|
739
|
-
|
|
740
|
-
// Handle the result
|
|
741
|
-
console.log(result);
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
run();
|
|
745
|
-
```
|
|
746
|
-
|
|
747
|
-
### React hooks and utilities
|
|
748
|
-
|
|
749
|
-
This method can be used in React components through the following hooks and
|
|
750
|
-
associated utilities.
|
|
751
|
-
|
|
752
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
753
|
-
> below and how to get started using React hooks.
|
|
754
|
-
|
|
755
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
756
|
-
|
|
757
|
-
```tsx
|
|
758
|
-
import {
|
|
759
|
-
// Mutation hook for triggering the API call.
|
|
760
|
-
useClientChatGetFilesMutation
|
|
761
|
-
} from "@gleanwork/api-client/react-query/clientChatGetFiles.js";
|
|
762
|
-
```
|
|
763
|
-
|
|
764
|
-
### Parameters
|
|
765
|
-
|
|
766
|
-
| Parameter | Type | Required | Description |
|
|
767
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
768
|
-
| `getChatFilesRequest` | [components.GetChatFilesRequest](../../models/components/getchatfilesrequest.md) | :heavy_check_mark: | N/A |
|
|
769
|
-
| `timezoneOffset` | *number* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. |
|
|
770
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
771
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
772
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
773
|
-
|
|
774
|
-
### Response
|
|
775
|
-
|
|
776
|
-
**Promise\<[components.GetChatFilesResponse](../../models/components/getchatfilesresponse.md)\>**
|
|
777
|
-
|
|
778
|
-
### Errors
|
|
779
|
-
|
|
780
|
-
| Error Type | Status Code | Content Type |
|
|
781
|
-
| ----------------- | ----------------- | ----------------- |
|
|
782
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
783
|
-
|
|
784
|
-
## deleteFiles
|
|
785
|
-
|
|
786
|
-
Delete files uploaded by a user for Chat.
|
|
787
|
-
|
|
788
|
-
### Example Usage
|
|
789
|
-
|
|
790
|
-
```typescript
|
|
791
|
-
import { Glean } from "@gleanwork/api-client";
|
|
792
|
-
|
|
793
|
-
const glean = new Glean({
|
|
794
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
795
|
-
});
|
|
796
|
-
|
|
797
|
-
async function run() {
|
|
798
|
-
await glean.client.chat.deleteFiles({
|
|
799
|
-
fileIds: [
|
|
800
|
-
"<value>",
|
|
801
|
-
],
|
|
802
|
-
});
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
run();
|
|
808
|
-
```
|
|
809
|
-
|
|
810
|
-
### Standalone function
|
|
811
|
-
|
|
812
|
-
The standalone function version of this method:
|
|
813
|
-
|
|
814
|
-
```typescript
|
|
815
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
816
|
-
import { clientChatDeleteFiles } from "@gleanwork/api-client/funcs/clientChatDeleteFiles.js";
|
|
817
|
-
|
|
818
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
819
|
-
// You can create one instance of it to use across an application.
|
|
820
|
-
const glean = new GleanCore({
|
|
821
|
-
bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
|
|
822
|
-
});
|
|
823
|
-
|
|
824
|
-
async function run() {
|
|
825
|
-
const res = await clientChatDeleteFiles(glean, {
|
|
826
|
-
fileIds: [
|
|
827
|
-
"<value>",
|
|
828
|
-
],
|
|
829
|
-
});
|
|
830
|
-
|
|
831
|
-
if (!res.ok) {
|
|
832
|
-
throw res.error;
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
const { value: result } = res;
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
run();
|
|
841
|
-
```
|
|
842
|
-
|
|
843
|
-
### React hooks and utilities
|
|
844
|
-
|
|
845
|
-
This method can be used in React components through the following hooks and
|
|
846
|
-
associated utilities.
|
|
847
|
-
|
|
848
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
849
|
-
> below and how to get started using React hooks.
|
|
850
|
-
|
|
851
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
852
|
-
|
|
853
|
-
```tsx
|
|
854
|
-
import {
|
|
855
|
-
// Mutation hook for triggering the API call.
|
|
856
|
-
useClientChatDeleteFilesMutation
|
|
857
|
-
} from "@gleanwork/api-client/react-query/clientChatDeleteFiles.js";
|
|
858
|
-
```
|
|
859
|
-
|
|
860
|
-
### Parameters
|
|
861
|
-
|
|
862
|
-
| Parameter | Type | Required | Description |
|
|
863
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
864
|
-
| `deleteChatFilesRequest` | [components.DeleteChatFilesRequest](../../models/components/deletechatfilesrequest.md) | :heavy_check_mark: | N/A |
|
|
865
|
-
| `timezoneOffset` | *number* | :heavy_minus_sign: | The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC. |
|
|
866
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
867
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
868
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
869
|
-
|
|
870
|
-
### Response
|
|
871
|
-
|
|
872
|
-
**Promise\<void\>**
|
|
873
|
-
|
|
874
|
-
### Errors
|
|
875
|
-
|
|
876
116
|
| Error Type | Status Code | Content Type |
|
|
877
117
|
| ----------------- | ----------------- | ----------------- |
|
|
878
118
|
| errors.GleanError | 4XX, 5XX | \*/\* |
|