@gleanwork/api-client 0.13.1 → 0.13.3
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 +2 -1
- package/dist/commonjs/__tests__/messages.test.js +1 -1
- package/dist/commonjs/__tests__/messages.test.js.map +1 -1
- package/dist/commonjs/__tests__/summarize.test.js +4 -3
- package/dist/commonjs/__tests__/summarize.test.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/components/agentsinsightsv2response.d.ts +4 -0
- package/dist/commonjs/models/components/agentsinsightsv2response.d.ts.map +1 -1
- package/dist/commonjs/models/components/agentsinsightsv2response.js +4 -0
- package/dist/commonjs/models/components/agentsinsightsv2response.js.map +1 -1
- package/dist/commonjs/models/components/chatmessagefragment.d.ts +1 -1
- package/dist/commonjs/models/components/debugdatasourcestatusresponse.d.ts +3 -1
- package/dist/commonjs/models/components/debugdatasourcestatusresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/debugdatasourcestatusresponse.js.map +1 -1
- package/dist/commonjs/models/components/peragentinsight.d.ts +10 -0
- package/dist/commonjs/models/components/peragentinsight.d.ts.map +1 -1
- package/dist/commonjs/models/components/peragentinsight.js +4 -0
- package/dist/commonjs/models/components/peragentinsight.js.map +1 -1
- package/dist/esm/__tests__/messages.test.js +1 -1
- package/dist/esm/__tests__/messages.test.js.map +1 -1
- package/dist/esm/__tests__/summarize.test.js +4 -3
- package/dist/esm/__tests__/summarize.test.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/components/agentsinsightsv2response.d.ts +4 -0
- package/dist/esm/models/components/agentsinsightsv2response.d.ts.map +1 -1
- package/dist/esm/models/components/agentsinsightsv2response.js +4 -0
- package/dist/esm/models/components/agentsinsightsv2response.js.map +1 -1
- package/dist/esm/models/components/chatmessagefragment.d.ts +1 -1
- package/dist/esm/models/components/debugdatasourcestatusresponse.d.ts +3 -1
- package/dist/esm/models/components/debugdatasourcestatusresponse.d.ts.map +1 -1
- package/dist/esm/models/components/debugdatasourcestatusresponse.js.map +1 -1
- package/dist/esm/models/components/peragentinsight.d.ts +10 -0
- package/dist/esm/models/components/peragentinsight.d.ts.map +1 -1
- package/dist/esm/models/components/peragentinsight.js +4 -0
- package/dist/esm/models/components/peragentinsight.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/messages.test.ts +1 -1
- package/src/__tests__/summarize.test.ts +4 -3
- package/src/lib/config.ts +3 -3
- package/src/models/components/agentsinsightsv2response.ts +8 -0
- package/src/models/components/chatmessagefragment.ts +1 -1
- package/src/models/components/debugdatasourcestatusresponse.ts +3 -1
- package/src/models/components/peragentinsight.ts +14 -0
- package/.devcontainer/README.md +0 -35
- package/docs/sdks/activity/README.md +0 -242
- package/docs/sdks/agents/README.md +0 -498
- package/docs/sdks/announcements/README.md +0 -137560
- package/docs/sdks/answers/README.md +0 -4966
- package/docs/sdks/chat/README.md +0 -967
- package/docs/sdks/clientauthentication/README.md +0 -98
- package/docs/sdks/clientdocuments/README.md +0 -457
- package/docs/sdks/clientshortcuts/README.md +0 -9340
- package/docs/sdks/collections/README.md +0 -4148
- package/docs/sdks/datasource/README.md +0 -98
- package/docs/sdks/datasources/README.md +0 -211
- package/docs/sdks/entities/README.md +0 -225
- package/docs/sdks/indexingauthentication/README.md +0 -93
- package/docs/sdks/indexingdocuments/README.md +0 -983
- package/docs/sdks/indexingshortcuts/README.md +0 -251
- package/docs/sdks/insights/README.md +0 -94
- package/docs/sdks/messages/README.md +0 -102
- package/docs/sdks/people/README.md +0 -1052
- package/docs/sdks/permissions/README.md +0 -1198
- package/docs/sdks/pins/README.md +0 -506
- package/docs/sdks/policies/README.md +0 -478
- package/docs/sdks/reports/README.md +0 -290
- package/docs/sdks/search/README.md +0 -986
- package/docs/sdks/tools/README.md +0 -208
- package/docs/sdks/verification/README.md +0 -276
- package/docs/sdks/visibilityoverrides/README.md +0 -192
- package/examples/README.md +0 -31
- package/src/__tests__/mockserver/README.md +0 -52
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
# ClientAuthentication
|
|
2
|
-
(*client.authentication*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [createToken](#createtoken) - Create authentication token
|
|
9
|
-
|
|
10
|
-
## createToken
|
|
11
|
-
|
|
12
|
-
Creates an authentication token for the authenticated user. These are
|
|
13
|
-
specifically intended to be used with the [Web SDK](https://developers.glean.com/web).
|
|
14
|
-
|
|
15
|
-
Note: The tokens generated from this endpoint are **not** valid tokens
|
|
16
|
-
for use with the Client API (e.g. `/rest/api/v1/*`).
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
### Example Usage
|
|
20
|
-
|
|
21
|
-
<!-- UsageSnippet language="typescript" operationID="createauthtoken" method="post" path="/rest/api/v1/createauthtoken" -->
|
|
22
|
-
```typescript
|
|
23
|
-
import { Glean } from "@gleanwork/api-client";
|
|
24
|
-
|
|
25
|
-
const glean = new Glean({
|
|
26
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
async function run() {
|
|
30
|
-
const result = await glean.client.authentication.createToken();
|
|
31
|
-
|
|
32
|
-
console.log(result);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
run();
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Standalone function
|
|
39
|
-
|
|
40
|
-
The standalone function version of this method:
|
|
41
|
-
|
|
42
|
-
```typescript
|
|
43
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
44
|
-
import { clientAuthenticationCreateToken } from "@gleanwork/api-client/funcs/clientAuthenticationCreateToken.js";
|
|
45
|
-
|
|
46
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
47
|
-
// You can create one instance of it to use across an application.
|
|
48
|
-
const glean = new GleanCore({
|
|
49
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
async function run() {
|
|
53
|
-
const res = await clientAuthenticationCreateToken(glean);
|
|
54
|
-
if (res.ok) {
|
|
55
|
-
const { value: result } = res;
|
|
56
|
-
console.log(result);
|
|
57
|
-
} else {
|
|
58
|
-
console.log("clientAuthenticationCreateToken failed:", res.error);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
run();
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### React hooks and utilities
|
|
66
|
-
|
|
67
|
-
This method can be used in React components through the following hooks and
|
|
68
|
-
associated utilities.
|
|
69
|
-
|
|
70
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
71
|
-
> below and how to get started using React hooks.
|
|
72
|
-
|
|
73
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
74
|
-
|
|
75
|
-
```tsx
|
|
76
|
-
import {
|
|
77
|
-
// Mutation hook for triggering the API call.
|
|
78
|
-
useClientAuthenticationCreateTokenMutation
|
|
79
|
-
} from "@gleanwork/api-client/react-query/clientAuthenticationCreateToken.js";
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Parameters
|
|
83
|
-
|
|
84
|
-
| Parameter | Type | Required | Description |
|
|
85
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
86
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
87
|
-
| `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. |
|
|
88
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
89
|
-
|
|
90
|
-
### Response
|
|
91
|
-
|
|
92
|
-
**Promise\<[components.CreateAuthTokenResponse](../../models/components/createauthtokenresponse.md)\>**
|
|
93
|
-
|
|
94
|
-
### Errors
|
|
95
|
-
|
|
96
|
-
| Error Type | Status Code | Content Type |
|
|
97
|
-
| ----------------- | ----------------- | ----------------- |
|
|
98
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
@@ -1,457 +0,0 @@
|
|
|
1
|
-
# ClientDocuments
|
|
2
|
-
(*client.documents*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [retrievePermissions](#retrievepermissions) - Read document permissions
|
|
9
|
-
* [retrieve](#retrieve) - Read documents
|
|
10
|
-
* [retrieveByFacets](#retrievebyfacets) - Read documents by facets
|
|
11
|
-
* [summarize](#summarize) - Summarize documents
|
|
12
|
-
|
|
13
|
-
## retrievePermissions
|
|
14
|
-
|
|
15
|
-
Read the emails of all users who have access to the given document.
|
|
16
|
-
|
|
17
|
-
### Example Usage
|
|
18
|
-
|
|
19
|
-
<!-- UsageSnippet language="typescript" operationID="getdocpermissions" method="post" path="/rest/api/v1/getdocpermissions" -->
|
|
20
|
-
```typescript
|
|
21
|
-
import { Glean } from "@gleanwork/api-client";
|
|
22
|
-
|
|
23
|
-
const glean = new Glean({
|
|
24
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
async function run() {
|
|
28
|
-
const result = await glean.client.documents.retrievePermissions({});
|
|
29
|
-
|
|
30
|
-
console.log(result);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
run();
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Standalone function
|
|
37
|
-
|
|
38
|
-
The standalone function version of this method:
|
|
39
|
-
|
|
40
|
-
```typescript
|
|
41
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
42
|
-
import { clientDocumentsRetrievePermissions } from "@gleanwork/api-client/funcs/clientDocumentsRetrievePermissions.js";
|
|
43
|
-
|
|
44
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
45
|
-
// You can create one instance of it to use across an application.
|
|
46
|
-
const glean = new GleanCore({
|
|
47
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
async function run() {
|
|
51
|
-
const res = await clientDocumentsRetrievePermissions(glean, {});
|
|
52
|
-
if (res.ok) {
|
|
53
|
-
const { value: result } = res;
|
|
54
|
-
console.log(result);
|
|
55
|
-
} else {
|
|
56
|
-
console.log("clientDocumentsRetrievePermissions failed:", res.error);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
run();
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### React hooks and utilities
|
|
64
|
-
|
|
65
|
-
This method can be used in React components through the following hooks and
|
|
66
|
-
associated utilities.
|
|
67
|
-
|
|
68
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
69
|
-
> below and how to get started using React hooks.
|
|
70
|
-
|
|
71
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
72
|
-
|
|
73
|
-
```tsx
|
|
74
|
-
import {
|
|
75
|
-
// Mutation hook for triggering the API call.
|
|
76
|
-
useClientDocumentsRetrievePermissionsMutation
|
|
77
|
-
} from "@gleanwork/api-client/react-query/clientDocumentsRetrievePermissions.js";
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Parameters
|
|
81
|
-
|
|
82
|
-
| Parameter | Type | Required | Description |
|
|
83
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
84
|
-
| `request` | [components.GetDocPermissionsRequest](../../models/components/getdocpermissionsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
85
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
86
|
-
| `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. |
|
|
87
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
88
|
-
|
|
89
|
-
### Response
|
|
90
|
-
|
|
91
|
-
**Promise\<[components.GetDocPermissionsResponse](../../models/components/getdocpermissionsresponse.md)\>**
|
|
92
|
-
|
|
93
|
-
### Errors
|
|
94
|
-
|
|
95
|
-
| Error Type | Status Code | Content Type |
|
|
96
|
-
| ----------------- | ----------------- | ----------------- |
|
|
97
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
98
|
-
|
|
99
|
-
## retrieve
|
|
100
|
-
|
|
101
|
-
Read the documents including metadata (does not include enhanced metadata via `/documentmetadata`) for the given list of Glean Document IDs or URLs specified in the request.
|
|
102
|
-
|
|
103
|
-
### Example Usage
|
|
104
|
-
|
|
105
|
-
<!-- UsageSnippet language="typescript" operationID="getdocuments" method="post" path="/rest/api/v1/getdocuments" -->
|
|
106
|
-
```typescript
|
|
107
|
-
import { Glean } from "@gleanwork/api-client";
|
|
108
|
-
|
|
109
|
-
const glean = new Glean({
|
|
110
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
async function run() {
|
|
114
|
-
const result = await glean.client.documents.retrieve();
|
|
115
|
-
|
|
116
|
-
console.log(result);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
run();
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Standalone function
|
|
123
|
-
|
|
124
|
-
The standalone function version of this method:
|
|
125
|
-
|
|
126
|
-
```typescript
|
|
127
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
128
|
-
import { clientDocumentsRetrieve } from "@gleanwork/api-client/funcs/clientDocumentsRetrieve.js";
|
|
129
|
-
|
|
130
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
131
|
-
// You can create one instance of it to use across an application.
|
|
132
|
-
const glean = new GleanCore({
|
|
133
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
async function run() {
|
|
137
|
-
const res = await clientDocumentsRetrieve(glean);
|
|
138
|
-
if (res.ok) {
|
|
139
|
-
const { value: result } = res;
|
|
140
|
-
console.log(result);
|
|
141
|
-
} else {
|
|
142
|
-
console.log("clientDocumentsRetrieve failed:", res.error);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
run();
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### React hooks and utilities
|
|
150
|
-
|
|
151
|
-
This method can be used in React components through the following hooks and
|
|
152
|
-
associated utilities.
|
|
153
|
-
|
|
154
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
155
|
-
> below and how to get started using React hooks.
|
|
156
|
-
|
|
157
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
158
|
-
|
|
159
|
-
```tsx
|
|
160
|
-
import {
|
|
161
|
-
// Mutation hook for triggering the API call.
|
|
162
|
-
useClientDocumentsRetrieveMutation
|
|
163
|
-
} from "@gleanwork/api-client/react-query/clientDocumentsRetrieve.js";
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Parameters
|
|
167
|
-
|
|
168
|
-
| Parameter | Type | Required | Description |
|
|
169
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
170
|
-
| `request` | [components.GetDocumentsRequest](../../models/components/getdocumentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
171
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
172
|
-
| `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. |
|
|
173
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
174
|
-
|
|
175
|
-
### Response
|
|
176
|
-
|
|
177
|
-
**Promise\<[components.GetDocumentsResponse](../../models/components/getdocumentsresponse.md)\>**
|
|
178
|
-
|
|
179
|
-
### Errors
|
|
180
|
-
|
|
181
|
-
| Error Type | Status Code | Content Type |
|
|
182
|
-
| ----------------- | ----------------- | ----------------- |
|
|
183
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
184
|
-
|
|
185
|
-
## retrieveByFacets
|
|
186
|
-
|
|
187
|
-
Read the documents including metadata (does not include enhanced metadata via `/documentmetadata`) macthing the given facet conditions.
|
|
188
|
-
|
|
189
|
-
### Example Usage
|
|
190
|
-
|
|
191
|
-
<!-- UsageSnippet language="typescript" operationID="getdocumentsbyfacets" method="post" path="/rest/api/v1/getdocumentsbyfacets" -->
|
|
192
|
-
```typescript
|
|
193
|
-
import { Glean } from "@gleanwork/api-client";
|
|
194
|
-
|
|
195
|
-
const glean = new Glean({
|
|
196
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
async function run() {
|
|
200
|
-
const result = await glean.client.documents.retrieveByFacets({
|
|
201
|
-
filterSets: [
|
|
202
|
-
{
|
|
203
|
-
filters: [
|
|
204
|
-
{
|
|
205
|
-
fieldName: "type",
|
|
206
|
-
values: [
|
|
207
|
-
{
|
|
208
|
-
value: "Spreadsheet",
|
|
209
|
-
relationType: "EQUALS",
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
value: "Presentation",
|
|
213
|
-
relationType: "EQUALS",
|
|
214
|
-
},
|
|
215
|
-
],
|
|
216
|
-
},
|
|
217
|
-
],
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
filters: [
|
|
221
|
-
{
|
|
222
|
-
fieldName: "type",
|
|
223
|
-
values: [
|
|
224
|
-
{
|
|
225
|
-
value: "Spreadsheet",
|
|
226
|
-
relationType: "EQUALS",
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
value: "Presentation",
|
|
230
|
-
relationType: "EQUALS",
|
|
231
|
-
},
|
|
232
|
-
],
|
|
233
|
-
},
|
|
234
|
-
],
|
|
235
|
-
},
|
|
236
|
-
],
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
console.log(result);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
run();
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
### Standalone function
|
|
246
|
-
|
|
247
|
-
The standalone function version of this method:
|
|
248
|
-
|
|
249
|
-
```typescript
|
|
250
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
251
|
-
import { clientDocumentsRetrieveByFacets } from "@gleanwork/api-client/funcs/clientDocumentsRetrieveByFacets.js";
|
|
252
|
-
|
|
253
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
254
|
-
// You can create one instance of it to use across an application.
|
|
255
|
-
const glean = new GleanCore({
|
|
256
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
async function run() {
|
|
260
|
-
const res = await clientDocumentsRetrieveByFacets(glean, {
|
|
261
|
-
filterSets: [
|
|
262
|
-
{
|
|
263
|
-
filters: [
|
|
264
|
-
{
|
|
265
|
-
fieldName: "type",
|
|
266
|
-
values: [
|
|
267
|
-
{
|
|
268
|
-
value: "Spreadsheet",
|
|
269
|
-
relationType: "EQUALS",
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
value: "Presentation",
|
|
273
|
-
relationType: "EQUALS",
|
|
274
|
-
},
|
|
275
|
-
],
|
|
276
|
-
},
|
|
277
|
-
],
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
filters: [
|
|
281
|
-
{
|
|
282
|
-
fieldName: "type",
|
|
283
|
-
values: [
|
|
284
|
-
{
|
|
285
|
-
value: "Spreadsheet",
|
|
286
|
-
relationType: "EQUALS",
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
value: "Presentation",
|
|
290
|
-
relationType: "EQUALS",
|
|
291
|
-
},
|
|
292
|
-
],
|
|
293
|
-
},
|
|
294
|
-
],
|
|
295
|
-
},
|
|
296
|
-
],
|
|
297
|
-
});
|
|
298
|
-
if (res.ok) {
|
|
299
|
-
const { value: result } = res;
|
|
300
|
-
console.log(result);
|
|
301
|
-
} else {
|
|
302
|
-
console.log("clientDocumentsRetrieveByFacets failed:", res.error);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
run();
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
### React hooks and utilities
|
|
310
|
-
|
|
311
|
-
This method can be used in React components through the following hooks and
|
|
312
|
-
associated utilities.
|
|
313
|
-
|
|
314
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
315
|
-
> below and how to get started using React hooks.
|
|
316
|
-
|
|
317
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
318
|
-
|
|
319
|
-
```tsx
|
|
320
|
-
import {
|
|
321
|
-
// Mutation hook for triggering the API call.
|
|
322
|
-
useClientDocumentsRetrieveByFacetsMutation
|
|
323
|
-
} from "@gleanwork/api-client/react-query/clientDocumentsRetrieveByFacets.js";
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
### Parameters
|
|
327
|
-
|
|
328
|
-
| Parameter | Type | Required | Description |
|
|
329
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
330
|
-
| `request` | [components.GetDocumentsByFacetsRequest](../../models/components/getdocumentsbyfacetsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
331
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
332
|
-
| `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. |
|
|
333
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
334
|
-
|
|
335
|
-
### Response
|
|
336
|
-
|
|
337
|
-
**Promise\<[components.GetDocumentsByFacetsResponse](../../models/components/getdocumentsbyfacetsresponse.md)\>**
|
|
338
|
-
|
|
339
|
-
### Errors
|
|
340
|
-
|
|
341
|
-
| Error Type | Status Code | Content Type |
|
|
342
|
-
| ----------------- | ----------------- | ----------------- |
|
|
343
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
344
|
-
|
|
345
|
-
## summarize
|
|
346
|
-
|
|
347
|
-
Generate an AI summary of the requested documents.
|
|
348
|
-
|
|
349
|
-
### Example Usage
|
|
350
|
-
|
|
351
|
-
<!-- UsageSnippet language="typescript" operationID="summarize" method="post" path="/rest/api/v1/summarize" -->
|
|
352
|
-
```typescript
|
|
353
|
-
import { Glean } from "@gleanwork/api-client";
|
|
354
|
-
|
|
355
|
-
const glean = new Glean({
|
|
356
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
357
|
-
});
|
|
358
|
-
|
|
359
|
-
async function run() {
|
|
360
|
-
const result = await glean.client.documents.summarize({
|
|
361
|
-
documentSpecs: [
|
|
362
|
-
{
|
|
363
|
-
ugcType: "CHATS",
|
|
364
|
-
ugcId: "<id>",
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
ugcType: "CHATS",
|
|
368
|
-
ugcId: "<id>",
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
id: "<id>",
|
|
372
|
-
},
|
|
373
|
-
],
|
|
374
|
-
});
|
|
375
|
-
|
|
376
|
-
console.log(result);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
run();
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
### Standalone function
|
|
383
|
-
|
|
384
|
-
The standalone function version of this method:
|
|
385
|
-
|
|
386
|
-
```typescript
|
|
387
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
388
|
-
import { clientDocumentsSummarize } from "@gleanwork/api-client/funcs/clientDocumentsSummarize.js";
|
|
389
|
-
|
|
390
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
391
|
-
// You can create one instance of it to use across an application.
|
|
392
|
-
const glean = new GleanCore({
|
|
393
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
394
|
-
});
|
|
395
|
-
|
|
396
|
-
async function run() {
|
|
397
|
-
const res = await clientDocumentsSummarize(glean, {
|
|
398
|
-
documentSpecs: [
|
|
399
|
-
{
|
|
400
|
-
ugcType: "CHATS",
|
|
401
|
-
ugcId: "<id>",
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
ugcType: "CHATS",
|
|
405
|
-
ugcId: "<id>",
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
id: "<id>",
|
|
409
|
-
},
|
|
410
|
-
],
|
|
411
|
-
});
|
|
412
|
-
if (res.ok) {
|
|
413
|
-
const { value: result } = res;
|
|
414
|
-
console.log(result);
|
|
415
|
-
} else {
|
|
416
|
-
console.log("clientDocumentsSummarize failed:", res.error);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
run();
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
### React hooks and utilities
|
|
424
|
-
|
|
425
|
-
This method can be used in React components through the following hooks and
|
|
426
|
-
associated utilities.
|
|
427
|
-
|
|
428
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
429
|
-
> below and how to get started using React hooks.
|
|
430
|
-
|
|
431
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
432
|
-
|
|
433
|
-
```tsx
|
|
434
|
-
import {
|
|
435
|
-
// Mutation hook for triggering the API call.
|
|
436
|
-
useClientDocumentsSummarizeMutation
|
|
437
|
-
} from "@gleanwork/api-client/react-query/clientDocumentsSummarize.js";
|
|
438
|
-
```
|
|
439
|
-
|
|
440
|
-
### Parameters
|
|
441
|
-
|
|
442
|
-
| Parameter | Type | Required | Description |
|
|
443
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
444
|
-
| `request` | [components.SummarizeRequest](../../models/components/summarizerequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
445
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
446
|
-
| `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. |
|
|
447
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
448
|
-
|
|
449
|
-
### Response
|
|
450
|
-
|
|
451
|
-
**Promise\<[components.SummarizeResponse](../../models/components/summarizeresponse.md)\>**
|
|
452
|
-
|
|
453
|
-
### Errors
|
|
454
|
-
|
|
455
|
-
| Error Type | Status Code | Content Type |
|
|
456
|
-
| ----------------- | ----------------- | ----------------- |
|
|
457
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|