graphlit-client 1.0.20250531005 → 1.0.20250610001
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/CHANGELOG.md +64 -0
- package/README.md +441 -53
- package/dist/client.d.ts +126 -1
- package/dist/client.js +1616 -1569
- package/dist/generated/graphql-documents.d.ts +1 -0
- package/dist/generated/graphql-documents.js +372 -310
- package/dist/generated/graphql-types.d.ts +207 -23
- package/dist/generated/graphql-types.js +299 -246
- package/dist/model-mapping.d.ts +18 -0
- package/dist/model-mapping.js +95 -0
- package/dist/stream-helpers.d.ts +106 -0
- package/dist/stream-helpers.js +237 -0
- package/dist/streaming/chunk-buffer.d.ts +25 -0
- package/dist/streaming/chunk-buffer.js +170 -0
- package/dist/streaming/llm-formatters.d.ts +64 -0
- package/dist/streaming/llm-formatters.js +187 -0
- package/dist/streaming/providers.d.ts +18 -0
- package/dist/streaming/providers.js +353 -0
- package/dist/streaming/ui-event-adapter.d.ts +52 -0
- package/dist/streaming/ui-event-adapter.js +288 -0
- package/dist/types/agent.d.ts +39 -0
- package/dist/types/agent.js +1 -0
- package/dist/types/streaming.d.ts +58 -0
- package/dist/types/streaming.js +7 -0
- package/dist/types/ui-events.d.ts +38 -0
- package/dist/types/ui-events.js +1 -0
- package/package.json +32 -5
package/dist/client.js
CHANGED
@@ -1,56 +1,83 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
}
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
1
|
+
import * as jwt from "jsonwebtoken";
|
2
|
+
import { ApolloClient, InMemoryCache, createHttpLink, ApolloLink, ApolloError, } from "@apollo/client/core";
|
3
|
+
import * as Types from "./generated/graphql-types.js";
|
4
|
+
import * as Documents from "./generated/graphql-documents.js";
|
5
|
+
import * as dotenv from "dotenv";
|
6
|
+
import { getServiceType, } from "./model-mapping.js";
|
7
|
+
import { UIEventAdapter } from "./streaming/ui-event-adapter.js";
|
8
|
+
import { formatMessagesForOpenAI, formatMessagesForAnthropic, formatMessagesForGoogle, } from "./streaming/llm-formatters.js";
|
9
|
+
import { streamWithOpenAI, streamWithAnthropic, streamWithGoogle, } from "./streaming/providers.js";
|
10
|
+
// Optional imports for streaming LLM clients
|
11
|
+
// These are peer dependencies and may not be installed
|
12
|
+
let OpenAI;
|
13
|
+
let Anthropic;
|
14
|
+
let GoogleGenerativeAI;
|
15
|
+
try {
|
16
|
+
OpenAI = require("openai").default || require("openai");
|
17
|
+
}
|
18
|
+
catch (e) {
|
19
|
+
// OpenAI not installed
|
20
|
+
}
|
21
|
+
try {
|
22
|
+
Anthropic =
|
23
|
+
require("@anthropic-ai/sdk").default || require("@anthropic-ai/sdk");
|
24
|
+
}
|
25
|
+
catch (e) {
|
26
|
+
// Anthropic SDK not installed
|
27
|
+
}
|
28
|
+
try {
|
29
|
+
GoogleGenerativeAI = require("@google/generative-ai").GoogleGenerativeAI;
|
30
|
+
}
|
31
|
+
catch (e) {
|
32
|
+
// Google Generative AI not installed
|
33
|
+
}
|
34
|
+
// Provider categorization for streaming capabilities
|
35
|
+
const STREAMING_PROVIDERS = {
|
36
|
+
// Native streaming with dedicated SDKs
|
37
|
+
NATIVE: [
|
38
|
+
Types.ModelServiceTypes.OpenAi,
|
39
|
+
Types.ModelServiceTypes.Anthropic,
|
40
|
+
Types.ModelServiceTypes.Google,
|
41
|
+
],
|
42
|
+
// OpenAI-compatible streaming (use OpenAI SDK)
|
43
|
+
OPENAI_COMPATIBLE: [
|
44
|
+
Types.ModelServiceTypes.Groq,
|
45
|
+
Types.ModelServiceTypes.Cerebras,
|
46
|
+
Types.ModelServiceTypes.Mistral,
|
47
|
+
Types.ModelServiceTypes.Deepseek,
|
48
|
+
],
|
49
|
+
// May require fallback simulation
|
50
|
+
FALLBACK_CANDIDATES: [
|
51
|
+
Types.ModelServiceTypes.AzureAi,
|
52
|
+
Types.ModelServiceTypes.AzureOpenAi,
|
53
|
+
Types.ModelServiceTypes.Cohere,
|
54
|
+
Types.ModelServiceTypes.Bedrock,
|
55
|
+
Types.ModelServiceTypes.Jina,
|
56
|
+
Types.ModelServiceTypes.Replicate,
|
57
|
+
Types.ModelServiceTypes.Voyage,
|
58
|
+
],
|
43
59
|
};
|
44
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
45
|
-
exports.Types = exports.Graphlit = void 0;
|
46
|
-
const jwt = __importStar(require("jsonwebtoken"));
|
47
|
-
const core_1 = require("@apollo/client/core");
|
48
|
-
const Documents = __importStar(require("./generated/graphql-documents.js"));
|
49
|
-
const dotenv = __importStar(require("dotenv"));
|
50
60
|
// Define the Graphlit class
|
51
61
|
class Graphlit {
|
62
|
+
client;
|
63
|
+
token;
|
64
|
+
apiUri;
|
65
|
+
organizationId;
|
66
|
+
environmentId;
|
67
|
+
ownerId;
|
68
|
+
userId;
|
69
|
+
jwtSecret;
|
70
|
+
// Streaming client instances (optional - can be provided by user)
|
71
|
+
openaiClient;
|
72
|
+
anthropicClient;
|
73
|
+
googleClient;
|
52
74
|
constructor(organizationId, environmentId, jwtSecret, ownerId, userId, apiUri) {
|
53
|
-
this.apiUri =
|
75
|
+
this.apiUri =
|
76
|
+
apiUri ||
|
77
|
+
(typeof process !== "undefined"
|
78
|
+
? process.env.GRAPHLIT_API_URL
|
79
|
+
: undefined) ||
|
80
|
+
"https://data-scus.graphlit.io/api/v1/graphql";
|
54
81
|
if (typeof process !== "undefined") {
|
55
82
|
dotenv.config();
|
56
83
|
this.organizationId =
|
@@ -83,10 +110,10 @@ class Graphlit {
|
|
83
110
|
refreshClient() {
|
84
111
|
this.client = undefined;
|
85
112
|
this.generateToken();
|
86
|
-
const httpLink =
|
113
|
+
const httpLink = createHttpLink({
|
87
114
|
uri: this.apiUri,
|
88
115
|
});
|
89
|
-
const authLink = new
|
116
|
+
const authLink = new ApolloLink((operation, forward) => {
|
90
117
|
operation.setContext({
|
91
118
|
headers: {
|
92
119
|
Authorization: this.token ? `Bearer ${this.token}` : "",
|
@@ -94,9 +121,9 @@ class Graphlit {
|
|
94
121
|
});
|
95
122
|
return forward(operation);
|
96
123
|
});
|
97
|
-
this.client = new
|
124
|
+
this.client = new ApolloClient({
|
98
125
|
link: authLink.concat(httpLink),
|
99
|
-
cache: new
|
126
|
+
cache: new InMemoryCache(),
|
100
127
|
defaultOptions: {
|
101
128
|
watchQuery: {
|
102
129
|
errorPolicy: "all",
|
@@ -113,1792 +140,1814 @@ class Graphlit {
|
|
113
140
|
},
|
114
141
|
});
|
115
142
|
}
|
143
|
+
/**
|
144
|
+
* Set a custom OpenAI client instance for streaming
|
145
|
+
* @param client - OpenAI client instance (e.g., new OpenAI({ apiKey: "..." }))
|
146
|
+
*/
|
147
|
+
setOpenAIClient(client) {
|
148
|
+
this.openaiClient = client;
|
149
|
+
}
|
150
|
+
/**
|
151
|
+
* Set a custom Anthropic client instance for streaming
|
152
|
+
* @param client - Anthropic client instance (e.g., new Anthropic({ apiKey: "..." }))
|
153
|
+
*/
|
154
|
+
setAnthropicClient(client) {
|
155
|
+
this.anthropicClient = client;
|
156
|
+
}
|
157
|
+
/**
|
158
|
+
* Set a custom Google Generative AI client instance for streaming
|
159
|
+
* @param client - Google GenerativeAI client instance (e.g., new GoogleGenerativeAI(apiKey))
|
160
|
+
*/
|
161
|
+
setGoogleClient(client) {
|
162
|
+
this.googleClient = client;
|
163
|
+
}
|
116
164
|
generateToken() {
|
117
165
|
if (!this.jwtSecret) {
|
118
166
|
throw new Error("Graphlit environment JWT secret is required.");
|
119
167
|
}
|
120
168
|
const expiration = Math.floor(Date.now() / 1000) + 24 * 60 * 60; // one day from now
|
121
169
|
const payload = {
|
122
|
-
"https://graphlit.io/jwt/claims":
|
170
|
+
"https://graphlit.io/jwt/claims": {
|
171
|
+
"x-graphlit-organization-id": this.organizationId,
|
172
|
+
"x-graphlit-environment-id": this.environmentId,
|
173
|
+
...(this.ownerId && { "x-graphlit-owner-id": this.ownerId }),
|
174
|
+
...(this.userId && { "x-graphlit-user-id": this.userId }),
|
175
|
+
"x-graphlit-role": "Owner",
|
176
|
+
},
|
123
177
|
exp: expiration,
|
124
178
|
iss: "graphlit",
|
125
179
|
aud: "https://portal.graphlit.io",
|
126
180
|
};
|
127
181
|
this.token = jwt.sign(payload, this.jwtSecret, { algorithm: "HS256" });
|
128
182
|
}
|
129
|
-
getProject() {
|
130
|
-
return
|
131
|
-
return this.queryAndCheckError(Documents.GetProject, {});
|
132
|
-
});
|
183
|
+
async getProject() {
|
184
|
+
return this.queryAndCheckError(Documents.GetProject, {});
|
133
185
|
}
|
134
|
-
updateProject(project) {
|
135
|
-
return
|
136
|
-
return this.mutateAndCheckError(Documents.UpdateProject, { project: project });
|
137
|
-
});
|
186
|
+
async updateProject(project) {
|
187
|
+
return this.mutateAndCheckError(Documents.UpdateProject, { project: project });
|
138
188
|
}
|
139
|
-
lookupProjectUsage(correlationId) {
|
140
|
-
return
|
141
|
-
return this.queryAndCheckError(Documents.LookupUsage, { correlationId: correlationId });
|
142
|
-
});
|
189
|
+
async lookupProjectUsage(correlationId) {
|
190
|
+
return this.queryAndCheckError(Documents.LookupUsage, { correlationId: correlationId });
|
143
191
|
}
|
144
|
-
lookupProjectCredits(correlationId) {
|
145
|
-
return
|
146
|
-
return this.queryAndCheckError(Documents.LookupCredits, { correlationId: correlationId });
|
147
|
-
});
|
192
|
+
async lookupProjectCredits(correlationId) {
|
193
|
+
return this.queryAndCheckError(Documents.LookupCredits, { correlationId: correlationId });
|
148
194
|
}
|
149
|
-
queryProjectTokens(startDate, duration) {
|
150
|
-
return
|
151
|
-
return this.queryAndCheckError(Documents.QueryTokens, { startDate: startDate, duration: duration });
|
152
|
-
});
|
195
|
+
async queryProjectTokens(startDate, duration) {
|
196
|
+
return this.queryAndCheckError(Documents.QueryTokens, { startDate: startDate, duration: duration });
|
153
197
|
}
|
154
|
-
queryProjectUsage(startDate, duration, names, excludedNames, offset, limit) {
|
155
|
-
return
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
limit: limit,
|
163
|
-
});
|
198
|
+
async queryProjectUsage(startDate, duration, names, excludedNames, offset, limit) {
|
199
|
+
return this.queryAndCheckError(Documents.QueryUsage, {
|
200
|
+
startDate: startDate,
|
201
|
+
duration: duration,
|
202
|
+
names: names,
|
203
|
+
excludedNames: excludedNames,
|
204
|
+
offset: offset,
|
205
|
+
limit: limit,
|
164
206
|
});
|
165
207
|
}
|
166
|
-
queryProjectCredits(startDate, duration) {
|
167
|
-
return
|
168
|
-
return this.queryAndCheckError(Documents.QueryCredits, { startDate: startDate, duration: duration });
|
169
|
-
});
|
208
|
+
async queryProjectCredits(startDate, duration) {
|
209
|
+
return this.queryAndCheckError(Documents.QueryCredits, { startDate: startDate, duration: duration });
|
170
210
|
}
|
171
|
-
sendNotification(connector, text, textType) {
|
172
|
-
return
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
textType: textType,
|
177
|
-
});
|
211
|
+
async sendNotification(connector, text, textType) {
|
212
|
+
return this.mutateAndCheckError(Documents.SendNotification, {
|
213
|
+
connector: connector,
|
214
|
+
text: text,
|
215
|
+
textType: textType,
|
178
216
|
});
|
179
217
|
}
|
180
|
-
mapWeb(uri, allowedPaths, excludedPaths, correlationId) {
|
181
|
-
return
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
correlationId: correlationId,
|
187
|
-
});
|
218
|
+
async mapWeb(uri, allowedPaths, excludedPaths, correlationId) {
|
219
|
+
return this.queryAndCheckError(Documents.MapWeb, {
|
220
|
+
uri: uri,
|
221
|
+
allowedPaths: allowedPaths,
|
222
|
+
excludedPaths: excludedPaths,
|
223
|
+
correlationId: correlationId,
|
188
224
|
});
|
189
225
|
}
|
190
|
-
searchWeb(text, service, limit, correlationId) {
|
191
|
-
return
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
correlationId: correlationId,
|
197
|
-
});
|
226
|
+
async searchWeb(text, service, limit, correlationId) {
|
227
|
+
return this.queryAndCheckError(Documents.SearchWeb, {
|
228
|
+
text: text,
|
229
|
+
service: service,
|
230
|
+
limit: limit,
|
231
|
+
correlationId: correlationId,
|
198
232
|
});
|
199
233
|
}
|
200
|
-
createAlert(alert, correlationId) {
|
201
|
-
return
|
202
|
-
return this.mutateAndCheckError(Documents.CreateAlert, { alert: alert, correlationId: correlationId });
|
203
|
-
});
|
234
|
+
async createAlert(alert, correlationId) {
|
235
|
+
return this.mutateAndCheckError(Documents.CreateAlert, { alert: alert, correlationId: correlationId });
|
204
236
|
}
|
205
|
-
updateAlert(alert) {
|
206
|
-
return
|
207
|
-
return this.mutateAndCheckError(Documents.UpdateAlert, { alert: alert });
|
208
|
-
});
|
237
|
+
async updateAlert(alert) {
|
238
|
+
return this.mutateAndCheckError(Documents.UpdateAlert, { alert: alert });
|
209
239
|
}
|
210
|
-
deleteAlert(id) {
|
211
|
-
return
|
212
|
-
return this.mutateAndCheckError(Documents.DeleteAlert, { id: id });
|
213
|
-
});
|
240
|
+
async deleteAlert(id) {
|
241
|
+
return this.mutateAndCheckError(Documents.DeleteAlert, { id: id });
|
214
242
|
}
|
215
|
-
deleteAlerts(ids, isSynchronous) {
|
216
|
-
return
|
217
|
-
return this.mutateAndCheckError(Documents.DeleteAlerts, { ids: ids, isSynchronous: isSynchronous });
|
218
|
-
});
|
243
|
+
async deleteAlerts(ids, isSynchronous) {
|
244
|
+
return this.mutateAndCheckError(Documents.DeleteAlerts, { ids: ids, isSynchronous: isSynchronous });
|
219
245
|
}
|
220
|
-
deleteAllAlerts(filter, isSynchronous, correlationId) {
|
221
|
-
return
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
correlationId: correlationId,
|
226
|
-
});
|
246
|
+
async deleteAllAlerts(filter, isSynchronous, correlationId) {
|
247
|
+
return this.mutateAndCheckError(Documents.DeleteAllAlerts, {
|
248
|
+
filter: filter,
|
249
|
+
isSynchronous: isSynchronous,
|
250
|
+
correlationId: correlationId,
|
227
251
|
});
|
228
252
|
}
|
229
|
-
enableAlert(id) {
|
230
|
-
return
|
231
|
-
return this.mutateAndCheckError(Documents.EnableAlert, { id: id });
|
232
|
-
});
|
253
|
+
async enableAlert(id) {
|
254
|
+
return this.mutateAndCheckError(Documents.EnableAlert, { id: id });
|
233
255
|
}
|
234
|
-
disableAlert(id) {
|
235
|
-
return
|
236
|
-
return this.mutateAndCheckError(Documents.DisableAlert, { id: id });
|
237
|
-
});
|
256
|
+
async disableAlert(id) {
|
257
|
+
return this.mutateAndCheckError(Documents.DisableAlert, { id: id });
|
238
258
|
}
|
239
|
-
getAlert(id) {
|
240
|
-
return
|
241
|
-
return this.queryAndCheckError(Documents.GetAlert, { id: id });
|
242
|
-
});
|
259
|
+
async getAlert(id) {
|
260
|
+
return this.queryAndCheckError(Documents.GetAlert, { id: id });
|
243
261
|
}
|
244
|
-
queryAlerts(filter) {
|
245
|
-
return
|
246
|
-
return this.queryAndCheckError(Documents.QueryAlerts, { filter: filter });
|
247
|
-
});
|
262
|
+
async queryAlerts(filter) {
|
263
|
+
return this.queryAndCheckError(Documents.QueryAlerts, { filter: filter });
|
248
264
|
}
|
249
|
-
countAlerts(filter) {
|
250
|
-
return
|
251
|
-
return this.queryAndCheckError(Documents.CountAlerts, { filter: filter });
|
252
|
-
});
|
265
|
+
async countAlerts(filter) {
|
266
|
+
return this.queryAndCheckError(Documents.CountAlerts, { filter: filter });
|
253
267
|
}
|
254
|
-
createCollection(collection) {
|
255
|
-
return
|
256
|
-
return this.mutateAndCheckError(Documents.CreateCollection, { collection: collection });
|
257
|
-
});
|
268
|
+
async createCollection(collection) {
|
269
|
+
return this.mutateAndCheckError(Documents.CreateCollection, { collection: collection });
|
258
270
|
}
|
259
|
-
updateCollection(collection) {
|
260
|
-
return
|
261
|
-
return this.mutateAndCheckError(Documents.UpdateCollection, { collection: collection });
|
262
|
-
});
|
271
|
+
async updateCollection(collection) {
|
272
|
+
return this.mutateAndCheckError(Documents.UpdateCollection, { collection: collection });
|
263
273
|
}
|
264
|
-
deleteCollection(id) {
|
265
|
-
return
|
266
|
-
return this.mutateAndCheckError(Documents.DeleteCollection, { id: id });
|
267
|
-
});
|
274
|
+
async deleteCollection(id) {
|
275
|
+
return this.mutateAndCheckError(Documents.DeleteCollection, { id: id });
|
268
276
|
}
|
269
|
-
deleteCollections(ids, isSynchronous) {
|
270
|
-
return
|
271
|
-
return this.mutateAndCheckError(Documents.DeleteCollections, { ids: ids, isSynchronous: isSynchronous });
|
272
|
-
});
|
277
|
+
async deleteCollections(ids, isSynchronous) {
|
278
|
+
return this.mutateAndCheckError(Documents.DeleteCollections, { ids: ids, isSynchronous: isSynchronous });
|
273
279
|
}
|
274
|
-
deleteAllCollections(filter, isSynchronous, correlationId) {
|
275
|
-
return
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
correlationId: correlationId,
|
280
|
-
});
|
280
|
+
async deleteAllCollections(filter, isSynchronous, correlationId) {
|
281
|
+
return this.mutateAndCheckError(Documents.DeleteAllCollections, {
|
282
|
+
filter: filter,
|
283
|
+
isSynchronous: isSynchronous,
|
284
|
+
correlationId: correlationId,
|
281
285
|
});
|
282
286
|
}
|
283
|
-
addContentsToCollections(contents, collections) {
|
284
|
-
return
|
285
|
-
|
286
|
-
|
287
|
-
collections: collections,
|
288
|
-
});
|
287
|
+
async addContentsToCollections(contents, collections) {
|
288
|
+
return this.mutateAndCheckError(Documents.AddContentsToCollections, {
|
289
|
+
contents: contents,
|
290
|
+
collections: collections,
|
289
291
|
});
|
290
292
|
}
|
291
|
-
removeContentsFromCollection(contents, collection) {
|
292
|
-
return
|
293
|
-
|
294
|
-
|
295
|
-
collection: collection,
|
296
|
-
});
|
293
|
+
async removeContentsFromCollection(contents, collection) {
|
294
|
+
return this.mutateAndCheckError(Documents.RemoveContentsFromCollection, {
|
295
|
+
contents: contents,
|
296
|
+
collection: collection,
|
297
297
|
});
|
298
298
|
}
|
299
|
-
getCollection(id) {
|
300
|
-
return
|
301
|
-
return this.queryAndCheckError(Documents.GetCollection, { id: id });
|
302
|
-
});
|
299
|
+
async getCollection(id) {
|
300
|
+
return this.queryAndCheckError(Documents.GetCollection, { id: id });
|
303
301
|
}
|
304
|
-
queryCollections(filter) {
|
305
|
-
return
|
306
|
-
return this.queryAndCheckError(Documents.QueryCollections, { filter: filter });
|
307
|
-
});
|
302
|
+
async queryCollections(filter) {
|
303
|
+
return this.queryAndCheckError(Documents.QueryCollections, { filter: filter });
|
308
304
|
}
|
309
|
-
countCollections(filter) {
|
310
|
-
return
|
311
|
-
return this.queryAndCheckError(Documents.CountCollections, { filter: filter });
|
312
|
-
});
|
305
|
+
async countCollections(filter) {
|
306
|
+
return this.queryAndCheckError(Documents.CountCollections, { filter: filter });
|
313
307
|
}
|
314
|
-
describeImage(prompt, uri, specification, correlationId) {
|
315
|
-
return
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
correlationId: correlationId,
|
321
|
-
});
|
308
|
+
async describeImage(prompt, uri, specification, correlationId) {
|
309
|
+
return this.mutateAndCheckError(Documents.DescribeImage, {
|
310
|
+
prompt: prompt,
|
311
|
+
uri: uri,
|
312
|
+
specification: specification,
|
313
|
+
correlationId: correlationId,
|
322
314
|
});
|
323
315
|
}
|
324
|
-
describeEncodedImage(prompt, mimeType, data, specification, correlationId) {
|
325
|
-
return
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
correlationId: correlationId,
|
332
|
-
});
|
316
|
+
async describeEncodedImage(prompt, mimeType, data, specification, correlationId) {
|
317
|
+
return this.mutateAndCheckError(Documents.DescribeEncodedImage, {
|
318
|
+
prompt: prompt,
|
319
|
+
mimeType: mimeType,
|
320
|
+
data: data,
|
321
|
+
specification: specification,
|
322
|
+
correlationId: correlationId,
|
333
323
|
});
|
334
324
|
}
|
335
|
-
screenshotPage(uri, maximumHeight, isSynchronous, workflow, collections, correlationId) {
|
336
|
-
return
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
correlationId: correlationId,
|
344
|
-
});
|
325
|
+
async screenshotPage(uri, maximumHeight, isSynchronous, workflow, collections, correlationId) {
|
326
|
+
return this.mutateAndCheckError(Documents.ScreenshotPage, {
|
327
|
+
uri: uri,
|
328
|
+
maximumHeight: maximumHeight,
|
329
|
+
isSynchronous: isSynchronous,
|
330
|
+
workflow: workflow,
|
331
|
+
collections: collections,
|
332
|
+
correlationId: correlationId,
|
345
333
|
});
|
346
|
-
}
|
347
|
-
ingestTextBatch(batch, textType, collections, observations, correlationId) {
|
348
|
-
return
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
334
|
+
}
|
335
|
+
async ingestTextBatch(batch, textType, collections, observations, correlationId) {
|
336
|
+
return this.mutateAndCheckError(Documents.IngestTextBatch, {
|
337
|
+
batch: batch,
|
338
|
+
textType: textType,
|
339
|
+
collections: collections,
|
340
|
+
observations: observations,
|
341
|
+
correlationId: correlationId,
|
342
|
+
});
|
343
|
+
}
|
344
|
+
async ingestBatch(uris, workflow, collections, observations, correlationId) {
|
345
|
+
return this.mutateAndCheckError(Documents.IngestBatch, {
|
346
|
+
uris: uris,
|
347
|
+
workflow: workflow,
|
348
|
+
collections: collections,
|
349
|
+
observations: observations,
|
350
|
+
correlationId: correlationId,
|
351
|
+
});
|
352
|
+
}
|
353
|
+
async ingestUri(uri, name, id, isSynchronous, workflow, collections, observations, correlationId) {
|
354
|
+
return this.mutateAndCheckError(Documents.IngestUri, {
|
355
|
+
uri: uri,
|
356
|
+
name: name,
|
357
|
+
id: id,
|
358
|
+
isSynchronous: isSynchronous,
|
359
|
+
workflow: workflow,
|
360
|
+
collections: collections,
|
361
|
+
observations: observations,
|
362
|
+
correlationId: correlationId,
|
363
|
+
});
|
364
|
+
}
|
365
|
+
async ingestText(text, name, textType, uri, id, isSynchronous, workflow, collections, observations, correlationId) {
|
366
|
+
return this.mutateAndCheckError(Documents.IngestText, {
|
367
|
+
name: name,
|
368
|
+
text: text,
|
369
|
+
textType: textType,
|
370
|
+
uri: uri,
|
371
|
+
id: id,
|
372
|
+
isSynchronous: isSynchronous,
|
373
|
+
workflow: workflow,
|
374
|
+
collections: collections,
|
375
|
+
observations: observations,
|
376
|
+
correlationId: correlationId,
|
377
|
+
});
|
378
|
+
}
|
379
|
+
async ingestMemory(text, name, textType, id, collections, correlationId) {
|
380
|
+
return this.mutateAndCheckError(Documents.IngestMemory, {
|
381
|
+
name: name,
|
382
|
+
text: text,
|
383
|
+
textType: textType,
|
384
|
+
id: id,
|
385
|
+
collections: collections,
|
386
|
+
correlationId: correlationId,
|
387
|
+
});
|
388
|
+
}
|
389
|
+
async ingestEvent(markdown, name, description, eventDate, id, collections, correlationId) {
|
390
|
+
return this.mutateAndCheckError(Documents.IngestEvent, {
|
391
|
+
name: name,
|
392
|
+
markdown: markdown,
|
393
|
+
description: description,
|
394
|
+
eventDate: eventDate,
|
395
|
+
id: id,
|
396
|
+
collections: collections,
|
397
|
+
correlationId: correlationId,
|
398
|
+
});
|
399
|
+
}
|
400
|
+
async ingestEncodedFile(name, data, mimeType, fileCreationDate, fileModifiedDate, id, isSynchronous, workflow, collections, observations, correlationId) {
|
401
|
+
return this.mutateAndCheckError(Documents.IngestEncodedFile, {
|
402
|
+
name: name,
|
403
|
+
data: data,
|
404
|
+
mimeType: mimeType,
|
405
|
+
fileCreationDate: fileCreationDate,
|
406
|
+
fileModifiedDate: fileModifiedDate,
|
407
|
+
id: id,
|
408
|
+
isSynchronous: isSynchronous,
|
409
|
+
workflow: workflow,
|
410
|
+
collections: collections,
|
411
|
+
observations: observations,
|
412
|
+
correlationId: correlationId,
|
413
|
+
});
|
414
|
+
}
|
415
|
+
async updateContent(content) {
|
416
|
+
return this.mutateAndCheckError(Documents.UpdateContent, { content: content });
|
417
|
+
}
|
418
|
+
async deleteContent(id) {
|
419
|
+
return this.mutateAndCheckError(Documents.DeleteContent, { id: id });
|
420
|
+
}
|
421
|
+
async deleteContents(ids, isSynchronous) {
|
422
|
+
return this.mutateAndCheckError(Documents.DeleteContents, { ids: ids, isSynchronous: isSynchronous });
|
423
|
+
}
|
424
|
+
async deleteAllContents(filter, isSynchronous, correlationId) {
|
425
|
+
return this.mutateAndCheckError(Documents.DeleteAllContents, {
|
426
|
+
filter: filter,
|
427
|
+
isSynchronous: isSynchronous,
|
428
|
+
correlationId: correlationId,
|
429
|
+
});
|
430
|
+
}
|
431
|
+
async summarizeText(summarization, text, textType, correlationId) {
|
432
|
+
return this.mutateAndCheckError(Documents.SummarizeText, {
|
433
|
+
summarization: summarization,
|
434
|
+
text: text,
|
435
|
+
textType: textType,
|
436
|
+
correlationId: correlationId,
|
437
|
+
});
|
438
|
+
}
|
439
|
+
async summarizeContents(summarizations, filter, correlationId) {
|
440
|
+
return this.mutateAndCheckError(Documents.SummarizeContents, {
|
441
|
+
summarizations: summarizations,
|
442
|
+
filter: filter,
|
443
|
+
correlationId: correlationId,
|
444
|
+
});
|
445
|
+
}
|
446
|
+
async extractText(prompt, text, tools, specification, textType, correlationId) {
|
447
|
+
return this.mutateAndCheckError(Documents.ExtractText, {
|
448
|
+
prompt: prompt,
|
449
|
+
text: text,
|
450
|
+
textType: textType,
|
451
|
+
specification: specification,
|
452
|
+
tools: tools,
|
453
|
+
correlationId: correlationId,
|
454
|
+
});
|
455
|
+
}
|
456
|
+
async extractContents(prompt, tools, specification, filter, correlationId) {
|
457
|
+
return this.mutateAndCheckError(Documents.ExtractContents, {
|
458
|
+
prompt: prompt,
|
459
|
+
filter: filter,
|
460
|
+
specification: specification,
|
461
|
+
tools: tools,
|
462
|
+
correlationId: correlationId,
|
463
|
+
});
|
464
|
+
}
|
465
|
+
async publishContents(publishPrompt, connector, summaryPrompt, summarySpecification, publishSpecification, name, filter, workflow, isSynchronous, includeDetails, correlationId) {
|
466
|
+
return this.mutateAndCheckError(Documents.PublishContents, {
|
467
|
+
summaryPrompt: summaryPrompt,
|
468
|
+
summarySpecification: summarySpecification,
|
469
|
+
connector: connector,
|
470
|
+
publishPrompt: publishPrompt,
|
471
|
+
publishSpecification: publishSpecification,
|
472
|
+
name: name,
|
473
|
+
filter: filter,
|
474
|
+
workflow: workflow,
|
475
|
+
isSynchronous: isSynchronous,
|
476
|
+
includeDetails: includeDetails,
|
477
|
+
correlationId: correlationId,
|
478
|
+
});
|
479
|
+
}
|
480
|
+
async publishText(text, textType, connector, name, workflow, isSynchronous, correlationId) {
|
481
|
+
return this.mutateAndCheckError(Documents.PublishText, {
|
482
|
+
text: text,
|
483
|
+
textType: textType,
|
484
|
+
connector: connector,
|
485
|
+
name: name,
|
486
|
+
workflow: workflow,
|
487
|
+
isSynchronous: isSynchronous,
|
488
|
+
correlationId: correlationId,
|
489
|
+
});
|
490
|
+
}
|
491
|
+
async getContent(id) {
|
492
|
+
return this.queryAndCheckError(Documents.GetContent, { id: id });
|
493
|
+
}
|
494
|
+
async queryContents(filter) {
|
495
|
+
return this.queryAndCheckError(Documents.QueryContents, { filter: filter });
|
496
|
+
}
|
497
|
+
async queryContentsFacets(filter) {
|
498
|
+
return this.queryAndCheckError(Documents.QueryContentsFacets, { filter: filter });
|
499
|
+
}
|
500
|
+
async queryContentsGraph(filter) {
|
501
|
+
return this.queryAndCheckError(Documents.QueryContentsGraph, {
|
502
|
+
filter: filter,
|
503
|
+
graph: {
|
504
|
+
/* return everything */
|
505
|
+
},
|
356
506
|
});
|
357
507
|
}
|
358
|
-
|
359
|
-
return
|
360
|
-
return this.mutateAndCheckError(Documents.IngestBatch, {
|
361
|
-
uris: uris,
|
362
|
-
workflow: workflow,
|
363
|
-
collections: collections,
|
364
|
-
observations: observations,
|
365
|
-
correlationId: correlationId,
|
366
|
-
});
|
367
|
-
});
|
508
|
+
async countContents(filter) {
|
509
|
+
return this.queryAndCheckError(Documents.CountContents, { filter: filter });
|
368
510
|
}
|
369
|
-
|
370
|
-
return
|
371
|
-
return this.mutateAndCheckError(Documents.IngestUri, {
|
372
|
-
uri: uri,
|
373
|
-
name: name,
|
374
|
-
id: id,
|
375
|
-
isSynchronous: isSynchronous,
|
376
|
-
workflow: workflow,
|
377
|
-
collections: collections,
|
378
|
-
observations: observations,
|
379
|
-
correlationId: correlationId,
|
380
|
-
});
|
381
|
-
});
|
511
|
+
async isContentDone(id) {
|
512
|
+
return this.queryAndCheckError(Documents.IsContentDone, { id: id });
|
382
513
|
}
|
383
|
-
|
384
|
-
return
|
385
|
-
|
386
|
-
|
387
|
-
text: text,
|
388
|
-
textType: textType,
|
389
|
-
uri: uri,
|
390
|
-
id: id,
|
391
|
-
isSynchronous: isSynchronous,
|
392
|
-
workflow: workflow,
|
393
|
-
collections: collections,
|
394
|
-
observations: observations,
|
395
|
-
correlationId: correlationId,
|
396
|
-
});
|
514
|
+
async createConversation(conversation, correlationId) {
|
515
|
+
return this.mutateAndCheckError(Documents.CreateConversation, {
|
516
|
+
conversation: conversation,
|
517
|
+
correlationId: correlationId,
|
397
518
|
});
|
398
519
|
}
|
399
|
-
|
400
|
-
return
|
401
|
-
return this.mutateAndCheckError(Documents.IngestMemory, {
|
402
|
-
name: name,
|
403
|
-
text: text,
|
404
|
-
textType: textType,
|
405
|
-
id: id,
|
406
|
-
collections: collections,
|
407
|
-
correlationId: correlationId,
|
408
|
-
});
|
409
|
-
});
|
520
|
+
async updateConversation(conversation) {
|
521
|
+
return this.mutateAndCheckError(Documents.UpdateConversation, { conversation: conversation });
|
410
522
|
}
|
411
|
-
|
412
|
-
return
|
413
|
-
return this.mutateAndCheckError(Documents.IngestEvent, {
|
414
|
-
name: name,
|
415
|
-
markdown: markdown,
|
416
|
-
description: description,
|
417
|
-
eventDate: eventDate,
|
418
|
-
id: id,
|
419
|
-
collections: collections,
|
420
|
-
correlationId: correlationId,
|
421
|
-
});
|
422
|
-
});
|
523
|
+
async deleteConversation(id) {
|
524
|
+
return this.mutateAndCheckError(Documents.DeleteConversation, { id: id });
|
423
525
|
}
|
424
|
-
|
425
|
-
return
|
426
|
-
|
427
|
-
|
428
|
-
data: data,
|
429
|
-
mimeType: mimeType,
|
430
|
-
fileCreationDate: fileCreationDate,
|
431
|
-
fileModifiedDate: fileModifiedDate,
|
432
|
-
id: id,
|
433
|
-
isSynchronous: isSynchronous,
|
434
|
-
workflow: workflow,
|
435
|
-
collections: collections,
|
436
|
-
observations: observations,
|
437
|
-
correlationId: correlationId,
|
438
|
-
});
|
526
|
+
async deleteConversations(ids, isSynchronous) {
|
527
|
+
return this.mutateAndCheckError(Documents.DeleteConversations, {
|
528
|
+
ids: ids,
|
529
|
+
isSynchronous: isSynchronous,
|
439
530
|
});
|
440
531
|
}
|
441
|
-
|
442
|
-
return
|
443
|
-
|
532
|
+
async deleteAllConversations(filter, isSynchronous, correlationId) {
|
533
|
+
return this.mutateAndCheckError(Documents.DeleteAllConversations, {
|
534
|
+
filter: filter,
|
535
|
+
isSynchronous: isSynchronous,
|
536
|
+
correlationId: correlationId,
|
444
537
|
});
|
445
538
|
}
|
446
|
-
|
447
|
-
return
|
448
|
-
return this.mutateAndCheckError(Documents.DeleteContent, { id: id });
|
449
|
-
});
|
539
|
+
async clearConversation(id) {
|
540
|
+
return this.mutateAndCheckError(Documents.ClearConversation, { id: id });
|
450
541
|
}
|
451
|
-
|
452
|
-
return
|
453
|
-
return this.mutateAndCheckError(Documents.DeleteContents, { ids: ids, isSynchronous: isSynchronous });
|
454
|
-
});
|
542
|
+
async closeConversation(id) {
|
543
|
+
return this.mutateAndCheckError(Documents.CloseConversation, { id: id });
|
455
544
|
}
|
456
|
-
|
457
|
-
return
|
458
|
-
return this.mutateAndCheckError(Documents.DeleteAllContents, {
|
459
|
-
filter: filter,
|
460
|
-
isSynchronous: isSynchronous,
|
461
|
-
correlationId: correlationId,
|
462
|
-
});
|
463
|
-
});
|
545
|
+
async getConversation(id) {
|
546
|
+
return this.queryAndCheckError(Documents.GetConversation, { id: id });
|
464
547
|
}
|
465
|
-
|
466
|
-
return
|
467
|
-
return this.mutateAndCheckError(Documents.SummarizeText, {
|
468
|
-
summarization: summarization,
|
469
|
-
text: text,
|
470
|
-
textType: textType,
|
471
|
-
correlationId: correlationId,
|
472
|
-
});
|
473
|
-
});
|
548
|
+
async queryConversations(filter) {
|
549
|
+
return this.queryAndCheckError(Documents.QueryConversations, { filter: filter });
|
474
550
|
}
|
475
|
-
|
476
|
-
return
|
477
|
-
return this.mutateAndCheckError(Documents.SummarizeContents, {
|
478
|
-
summarizations: summarizations,
|
479
|
-
filter: filter,
|
480
|
-
correlationId: correlationId,
|
481
|
-
});
|
482
|
-
});
|
551
|
+
async countConversations(filter) {
|
552
|
+
return this.queryAndCheckError(Documents.CountConversations, { filter: filter });
|
483
553
|
}
|
484
|
-
|
485
|
-
return
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
tools: tools,
|
492
|
-
correlationId: correlationId,
|
493
|
-
});
|
554
|
+
async reviseImage(prompt, uri, id, specification, correlationId) {
|
555
|
+
return this.mutateAndCheckError(Documents.ReviseImage, {
|
556
|
+
prompt: prompt,
|
557
|
+
uri: uri,
|
558
|
+
id: id,
|
559
|
+
specification: specification,
|
560
|
+
correlationId: correlationId,
|
494
561
|
});
|
495
562
|
}
|
496
|
-
|
497
|
-
return
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
});
|
563
|
+
async reviseEncodedImage(prompt, mimeType, data, id, specification, correlationId) {
|
564
|
+
return this.mutateAndCheckError(Documents.ReviseEncodedImage, {
|
565
|
+
prompt: prompt,
|
566
|
+
mimeType: mimeType,
|
567
|
+
data: data,
|
568
|
+
id: id,
|
569
|
+
specification: specification,
|
570
|
+
correlationId: correlationId,
|
505
571
|
});
|
506
572
|
}
|
507
|
-
|
508
|
-
return
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
publishSpecification: publishSpecification,
|
515
|
-
name: name,
|
516
|
-
filter: filter,
|
517
|
-
workflow: workflow,
|
518
|
-
isSynchronous: isSynchronous,
|
519
|
-
includeDetails: includeDetails,
|
520
|
-
correlationId: correlationId,
|
521
|
-
});
|
573
|
+
async reviseText(prompt, text, id, specification, correlationId) {
|
574
|
+
return this.mutateAndCheckError(Documents.ReviseText, {
|
575
|
+
prompt: prompt,
|
576
|
+
text: text,
|
577
|
+
id: id,
|
578
|
+
specification: specification,
|
579
|
+
correlationId: correlationId,
|
522
580
|
});
|
523
581
|
}
|
524
|
-
|
525
|
-
return
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
workflow: workflow,
|
532
|
-
isSynchronous: isSynchronous,
|
533
|
-
correlationId: correlationId,
|
534
|
-
});
|
582
|
+
async reviseContent(prompt, content, id, specification, correlationId) {
|
583
|
+
return this.mutateAndCheckError(Documents.ReviseContent, {
|
584
|
+
prompt: prompt,
|
585
|
+
content: content,
|
586
|
+
id: id,
|
587
|
+
specification: specification,
|
588
|
+
correlationId: correlationId,
|
535
589
|
});
|
536
590
|
}
|
537
|
-
|
538
|
-
return
|
539
|
-
|
591
|
+
async prompt(prompt, mimeType, data, specification, messages, correlationId) {
|
592
|
+
return this.mutateAndCheckError(Documents.Prompt, {
|
593
|
+
prompt: prompt,
|
594
|
+
mimeType: mimeType,
|
595
|
+
data: data,
|
596
|
+
specification: specification,
|
597
|
+
messages: messages,
|
598
|
+
correlationId: correlationId,
|
540
599
|
});
|
541
600
|
}
|
542
|
-
|
543
|
-
return
|
544
|
-
|
601
|
+
async retrieveSources(prompt, filter, augmentedFilter, retrievalStrategy, rerankingStrategy, correlationId) {
|
602
|
+
return this.mutateAndCheckError(Documents.RetrieveSources, {
|
603
|
+
prompt: prompt,
|
604
|
+
filter: filter,
|
605
|
+
augmentedFilter: augmentedFilter,
|
606
|
+
retrievalStrategy: retrievalStrategy,
|
607
|
+
rerankingStrategy: rerankingStrategy,
|
608
|
+
correlationId: correlationId,
|
545
609
|
});
|
546
610
|
}
|
547
|
-
|
548
|
-
return
|
549
|
-
|
611
|
+
async formatConversation(prompt, id, specification, tools, includeDetails, correlationId) {
|
612
|
+
return this.mutateAndCheckError(Documents.FormatConversation, {
|
613
|
+
prompt: prompt,
|
614
|
+
id: id,
|
615
|
+
specification: specification,
|
616
|
+
tools: tools,
|
617
|
+
includeDetails: includeDetails,
|
618
|
+
correlationId: correlationId,
|
550
619
|
});
|
551
620
|
}
|
552
|
-
|
553
|
-
return
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
/* return everything */
|
558
|
-
},
|
559
|
-
});
|
621
|
+
async completeConversation(completion, id, correlationId) {
|
622
|
+
return this.mutateAndCheckError(Documents.CompleteConversation, {
|
623
|
+
completion: completion,
|
624
|
+
id: id,
|
625
|
+
correlationId: correlationId,
|
560
626
|
});
|
561
627
|
}
|
562
|
-
|
563
|
-
return
|
564
|
-
|
628
|
+
async askGraphlit(prompt, type, id, specification, correlationId) {
|
629
|
+
return this.mutateAndCheckError(Documents.AskGraphlit, {
|
630
|
+
prompt: prompt,
|
631
|
+
type: type,
|
632
|
+
id: id,
|
633
|
+
specification: specification,
|
634
|
+
correlationId: correlationId,
|
565
635
|
});
|
566
636
|
}
|
567
|
-
|
568
|
-
return
|
569
|
-
|
637
|
+
async promptConversation(prompt, id, specification, mimeType, data, tools, requireTool, includeDetails, correlationId) {
|
638
|
+
return this.mutateAndCheckError(Documents.PromptConversation, {
|
639
|
+
prompt: prompt,
|
640
|
+
id: id,
|
641
|
+
specification: specification,
|
642
|
+
mimeType: mimeType,
|
643
|
+
data: data,
|
644
|
+
tools: tools,
|
645
|
+
requireTool: requireTool,
|
646
|
+
includeDetails: includeDetails,
|
647
|
+
correlationId: correlationId,
|
570
648
|
});
|
571
649
|
}
|
572
|
-
|
573
|
-
return
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
});
|
650
|
+
async continueConversation(id, responses, correlationId) {
|
651
|
+
return this.mutateAndCheckError(Documents.ContinueConversation, {
|
652
|
+
id: id,
|
653
|
+
responses: responses,
|
654
|
+
correlationId: correlationId,
|
578
655
|
});
|
579
656
|
}
|
580
|
-
|
581
|
-
return
|
582
|
-
|
657
|
+
async publishConversation(id, connector, name, workflow, isSynchronous, correlationId) {
|
658
|
+
return this.mutateAndCheckError(Documents.PublishConversation, {
|
659
|
+
id: id,
|
660
|
+
connector: connector,
|
661
|
+
name: name,
|
662
|
+
workflow: workflow,
|
663
|
+
isSynchronous: isSynchronous,
|
664
|
+
correlationId: correlationId,
|
583
665
|
});
|
584
666
|
}
|
585
|
-
|
586
|
-
return
|
587
|
-
|
667
|
+
async suggestConversation(id, count, correlationId) {
|
668
|
+
return this.mutateAndCheckError(Documents.SuggestConversation, {
|
669
|
+
id: id,
|
670
|
+
count: count,
|
671
|
+
correlationId: correlationId,
|
588
672
|
});
|
589
673
|
}
|
590
|
-
|
591
|
-
return
|
592
|
-
|
593
|
-
|
594
|
-
isSynchronous: isSynchronous,
|
595
|
-
});
|
674
|
+
async queryOneDriveFolders(properties, folderId) {
|
675
|
+
return this.queryAndCheckError(Documents.QueryOneDriveFolders, {
|
676
|
+
properties: properties,
|
677
|
+
folderId: folderId,
|
596
678
|
});
|
597
679
|
}
|
598
|
-
|
599
|
-
return
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
correlationId: correlationId,
|
604
|
-
});
|
680
|
+
async querySharePointFolders(properties, libraryId, folderId) {
|
681
|
+
return this.queryAndCheckError(Documents.QuerySharePointFolders, {
|
682
|
+
properties: properties,
|
683
|
+
libraryId: libraryId,
|
684
|
+
folderId: folderId,
|
605
685
|
});
|
606
686
|
}
|
607
|
-
|
608
|
-
return
|
609
|
-
return this.mutateAndCheckError(Documents.ClearConversation, { id: id });
|
610
|
-
});
|
687
|
+
async querySharePointLibraries(properties) {
|
688
|
+
return this.queryAndCheckError(Documents.QuerySharePointLibraries, { properties: properties });
|
611
689
|
}
|
612
|
-
|
613
|
-
return
|
614
|
-
return this.mutateAndCheckError(Documents.CloseConversation, { id: id });
|
615
|
-
});
|
690
|
+
async queryMicrosoftTeamsTeams(properties) {
|
691
|
+
return this.queryAndCheckError(Documents.QueryMicrosoftTeamsTeams, { properties: properties });
|
616
692
|
}
|
617
|
-
|
618
|
-
return
|
619
|
-
|
693
|
+
async queryMicrosoftTeamsChannels(properties, teamId) {
|
694
|
+
return this.queryAndCheckError(Documents.QueryMicrosoftTeamsChannels, {
|
695
|
+
properties: properties,
|
696
|
+
teamId: teamId,
|
620
697
|
});
|
621
698
|
}
|
622
|
-
|
623
|
-
return
|
624
|
-
return this.queryAndCheckError(Documents.QueryConversations, { filter: filter });
|
625
|
-
});
|
699
|
+
async querySlackChannels(properties) {
|
700
|
+
return this.queryAndCheckError(Documents.QuerySlackChannels, { properties: properties });
|
626
701
|
}
|
627
|
-
|
628
|
-
return
|
629
|
-
return this.queryAndCheckError(Documents.CountConversations, { filter: filter });
|
630
|
-
});
|
702
|
+
async queryLinearProjects(properties) {
|
703
|
+
return this.queryAndCheckError(Documents.QueryLinearProjects, { properties: properties });
|
631
704
|
}
|
632
|
-
|
633
|
-
return
|
634
|
-
return this.mutateAndCheckError(Documents.ReviseImage, {
|
635
|
-
prompt: prompt,
|
636
|
-
uri: uri,
|
637
|
-
id: id,
|
638
|
-
specification: specification,
|
639
|
-
correlationId: correlationId,
|
640
|
-
});
|
641
|
-
});
|
705
|
+
async queryNotionDatabases(properties) {
|
706
|
+
return this.queryAndCheckError(Documents.QueryNotionDatabases, { properties: properties });
|
642
707
|
}
|
643
|
-
|
644
|
-
return
|
645
|
-
|
646
|
-
|
647
|
-
mimeType: mimeType,
|
648
|
-
data: data,
|
649
|
-
id: id,
|
650
|
-
specification: specification,
|
651
|
-
correlationId: correlationId,
|
652
|
-
});
|
708
|
+
async queryNotionPages(properties, identifier) {
|
709
|
+
return this.queryAndCheckError(Documents.QueryNotionPages, {
|
710
|
+
properties: properties,
|
711
|
+
identifier: identifier,
|
653
712
|
});
|
654
713
|
}
|
655
|
-
|
656
|
-
return
|
657
|
-
return this.mutateAndCheckError(Documents.ReviseText, {
|
658
|
-
prompt: prompt,
|
659
|
-
text: text,
|
660
|
-
id: id,
|
661
|
-
specification: specification,
|
662
|
-
correlationId: correlationId,
|
663
|
-
});
|
664
|
-
});
|
714
|
+
async createFeed(feed, correlationId) {
|
715
|
+
return this.mutateAndCheckError(Documents.CreateFeed, { feed: feed, correlationId: correlationId });
|
665
716
|
}
|
666
|
-
|
667
|
-
return
|
668
|
-
return this.mutateAndCheckError(Documents.ReviseContent, {
|
669
|
-
prompt: prompt,
|
670
|
-
content: content,
|
671
|
-
id: id,
|
672
|
-
specification: specification,
|
673
|
-
correlationId: correlationId,
|
674
|
-
});
|
675
|
-
});
|
717
|
+
async updateFeed(feed) {
|
718
|
+
return this.mutateAndCheckError(Documents.UpdateFeed, { feed: feed });
|
676
719
|
}
|
677
|
-
|
678
|
-
return
|
679
|
-
return this.mutateAndCheckError(Documents.Prompt, {
|
680
|
-
prompt: prompt,
|
681
|
-
mimeType: mimeType,
|
682
|
-
data: data,
|
683
|
-
specification: specification,
|
684
|
-
messages: messages,
|
685
|
-
correlationId: correlationId,
|
686
|
-
});
|
687
|
-
});
|
720
|
+
async deleteFeed(id) {
|
721
|
+
return this.mutateAndCheckError(Documents.DeleteFeed, { id: id });
|
688
722
|
}
|
689
|
-
|
690
|
-
return
|
691
|
-
return this.mutateAndCheckError(Documents.RetrieveSources, {
|
692
|
-
prompt: prompt,
|
693
|
-
filter: filter,
|
694
|
-
augmentedFilter: augmentedFilter,
|
695
|
-
retrievalStrategy: retrievalStrategy,
|
696
|
-
rerankingStrategy: rerankingStrategy,
|
697
|
-
correlationId: correlationId,
|
698
|
-
});
|
699
|
-
});
|
723
|
+
async deleteFeeds(ids, isSynchronous) {
|
724
|
+
return this.mutateAndCheckError(Documents.DeleteFeeds, { ids: ids, isSynchronous: isSynchronous });
|
700
725
|
}
|
701
|
-
|
702
|
-
return
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
specification: specification,
|
707
|
-
includeDetails: includeDetails,
|
708
|
-
correlationId: correlationId,
|
709
|
-
});
|
726
|
+
async deleteAllFeeds(filter, isSynchronous, correlationId) {
|
727
|
+
return this.mutateAndCheckError(Documents.DeleteAllFeeds, {
|
728
|
+
filter: filter,
|
729
|
+
isSynchronous: isSynchronous,
|
730
|
+
correlationId: correlationId,
|
710
731
|
});
|
711
732
|
}
|
712
|
-
|
713
|
-
return
|
714
|
-
return this.mutateAndCheckError(Documents.CompleteConversation, {
|
715
|
-
completion: completion,
|
716
|
-
id: id,
|
717
|
-
correlationId: correlationId,
|
718
|
-
});
|
719
|
-
});
|
733
|
+
async enableFeed(id) {
|
734
|
+
return this.mutateAndCheckError(Documents.EnableFeed, { id: id });
|
720
735
|
}
|
721
|
-
|
722
|
-
return
|
723
|
-
return this.mutateAndCheckError(Documents.AskGraphlit, {
|
724
|
-
prompt: prompt,
|
725
|
-
type: type,
|
726
|
-
id: id,
|
727
|
-
specification: specification,
|
728
|
-
correlationId: correlationId,
|
729
|
-
});
|
730
|
-
});
|
736
|
+
async disableFeed(id) {
|
737
|
+
return this.mutateAndCheckError(Documents.DisableFeed, { id: id });
|
731
738
|
}
|
732
|
-
|
733
|
-
return
|
734
|
-
return this.mutateAndCheckError(Documents.PromptConversation, {
|
735
|
-
prompt: prompt,
|
736
|
-
id: id,
|
737
|
-
specification: specification,
|
738
|
-
mimeType: mimeType,
|
739
|
-
data: data,
|
740
|
-
tools: tools,
|
741
|
-
requireTool: requireTool,
|
742
|
-
includeDetails: includeDetails,
|
743
|
-
correlationId: correlationId,
|
744
|
-
});
|
745
|
-
});
|
739
|
+
async getFeed(id) {
|
740
|
+
return this.queryAndCheckError(Documents.GetFeed, { id: id });
|
746
741
|
}
|
747
|
-
|
748
|
-
return
|
749
|
-
return this.mutateAndCheckError(Documents.ContinueConversation, {
|
750
|
-
id: id,
|
751
|
-
responses: responses,
|
752
|
-
correlationId: correlationId,
|
753
|
-
});
|
754
|
-
});
|
742
|
+
async queryFeeds(filter) {
|
743
|
+
return this.queryAndCheckError(Documents.QueryFeeds, { filter: filter });
|
755
744
|
}
|
756
|
-
|
757
|
-
return
|
758
|
-
return this.mutateAndCheckError(Documents.PublishConversation, {
|
759
|
-
id: id,
|
760
|
-
connector: connector,
|
761
|
-
name: name,
|
762
|
-
workflow: workflow,
|
763
|
-
isSynchronous: isSynchronous,
|
764
|
-
correlationId: correlationId,
|
765
|
-
});
|
766
|
-
});
|
745
|
+
async countFeeds(filter) {
|
746
|
+
return this.queryAndCheckError(Documents.CountFeeds, { filter: filter });
|
767
747
|
}
|
768
|
-
|
769
|
-
return
|
770
|
-
return this.mutateAndCheckError(Documents.SuggestConversation, {
|
771
|
-
id: id,
|
772
|
-
count: count,
|
773
|
-
correlationId: correlationId,
|
774
|
-
});
|
775
|
-
});
|
748
|
+
async feedExists(filter) {
|
749
|
+
return this.queryAndCheckError(Documents.FeedExists, { filter: filter });
|
776
750
|
}
|
777
|
-
|
778
|
-
return
|
779
|
-
return this.queryAndCheckError(Documents.QueryOneDriveFolders, {
|
780
|
-
properties: properties,
|
781
|
-
folderId: folderId,
|
782
|
-
});
|
783
|
-
});
|
751
|
+
async isFeedDone(id) {
|
752
|
+
return this.queryAndCheckError(Documents.IsFeedDone, { id: id });
|
784
753
|
}
|
785
|
-
|
786
|
-
return
|
787
|
-
return this.queryAndCheckError(Documents.QuerySharePointFolders, {
|
788
|
-
properties: properties,
|
789
|
-
libraryId: libraryId,
|
790
|
-
folderId: folderId,
|
791
|
-
});
|
792
|
-
});
|
754
|
+
async promptSpecifications(prompt, ids) {
|
755
|
+
return this.mutateAndCheckError(Documents.PromptSpecifications, { prompt: prompt, ids: ids });
|
793
756
|
}
|
794
|
-
|
795
|
-
return
|
796
|
-
return this.queryAndCheckError(Documents.QuerySharePointLibraries, { properties: properties });
|
797
|
-
});
|
757
|
+
async createSpecification(specification) {
|
758
|
+
return this.mutateAndCheckError(Documents.CreateSpecification, { specification: specification });
|
798
759
|
}
|
799
|
-
|
800
|
-
return
|
801
|
-
return this.queryAndCheckError(Documents.QueryMicrosoftTeamsTeams, { properties: properties });
|
802
|
-
});
|
760
|
+
async updateSpecification(specification) {
|
761
|
+
return this.mutateAndCheckError(Documents.UpdateSpecification, { specification: specification });
|
803
762
|
}
|
804
|
-
|
805
|
-
return
|
806
|
-
return this.queryAndCheckError(Documents.QueryMicrosoftTeamsChannels, {
|
807
|
-
properties: properties,
|
808
|
-
teamId: teamId,
|
809
|
-
});
|
810
|
-
});
|
763
|
+
async upsertSpecification(specification) {
|
764
|
+
return this.mutateAndCheckError(Documents.UpsertSpecification, { specification: specification });
|
811
765
|
}
|
812
|
-
|
813
|
-
return
|
814
|
-
return this.queryAndCheckError(Documents.QuerySlackChannels, { properties: properties });
|
815
|
-
});
|
766
|
+
async deleteSpecification(id) {
|
767
|
+
return this.mutateAndCheckError(Documents.DeleteSpecification, { id: id });
|
816
768
|
}
|
817
|
-
|
818
|
-
return
|
819
|
-
|
769
|
+
async deleteSpecifications(ids, isSynchronous) {
|
770
|
+
return this.mutateAndCheckError(Documents.DeleteSpecifications, {
|
771
|
+
ids: ids,
|
772
|
+
isSynchronous: isSynchronous,
|
820
773
|
});
|
821
774
|
}
|
822
|
-
|
823
|
-
return
|
824
|
-
|
775
|
+
async deleteAllSpecifications(filter, isSynchronous, correlationId) {
|
776
|
+
return this.mutateAndCheckError(Documents.DeleteAllSpecifications, {
|
777
|
+
filter: filter,
|
778
|
+
isSynchronous: isSynchronous,
|
779
|
+
correlationId: correlationId,
|
825
780
|
});
|
826
781
|
}
|
827
|
-
|
828
|
-
return
|
829
|
-
return this.queryAndCheckError(Documents.QueryNotionPages, {
|
830
|
-
properties: properties,
|
831
|
-
identifier: identifier,
|
832
|
-
});
|
833
|
-
});
|
782
|
+
async getSpecification(id) {
|
783
|
+
return this.queryAndCheckError(Documents.GetSpecification, { id: id });
|
834
784
|
}
|
835
|
-
|
836
|
-
return
|
837
|
-
return this.mutateAndCheckError(Documents.CreateFeed, { feed: feed, correlationId: correlationId });
|
838
|
-
});
|
785
|
+
async querySpecifications(filter) {
|
786
|
+
return this.queryAndCheckError(Documents.QuerySpecifications, { filter: filter });
|
839
787
|
}
|
840
|
-
|
841
|
-
return
|
842
|
-
return this.mutateAndCheckError(Documents.UpdateFeed, { feed: feed });
|
843
|
-
});
|
788
|
+
async countSpecifications(filter) {
|
789
|
+
return this.queryAndCheckError(Documents.CountSpecifications, { filter: filter });
|
844
790
|
}
|
845
|
-
|
846
|
-
return
|
847
|
-
return this.mutateAndCheckError(Documents.DeleteFeed, { id: id });
|
848
|
-
});
|
791
|
+
async specificationExists(filter) {
|
792
|
+
return this.queryAndCheckError(Documents.SpecificationExists, { filter: filter });
|
849
793
|
}
|
850
|
-
|
851
|
-
return
|
852
|
-
return this.mutateAndCheckError(Documents.DeleteFeeds, { ids: ids, isSynchronous: isSynchronous });
|
853
|
-
});
|
794
|
+
async queryModels(filter) {
|
795
|
+
return this.queryAndCheckError(Documents.QueryModels, { filter: filter });
|
854
796
|
}
|
855
|
-
|
856
|
-
return
|
857
|
-
return this.mutateAndCheckError(Documents.DeleteAllFeeds, {
|
858
|
-
filter: filter,
|
859
|
-
isSynchronous: isSynchronous,
|
860
|
-
correlationId: correlationId,
|
861
|
-
});
|
862
|
-
});
|
797
|
+
async createWorkflow(workflow) {
|
798
|
+
return this.mutateAndCheckError(Documents.CreateWorkflow, { workflow: workflow });
|
863
799
|
}
|
864
|
-
|
865
|
-
return
|
866
|
-
return this.mutateAndCheckError(Documents.EnableFeed, { id: id });
|
867
|
-
});
|
800
|
+
async updateWorkflow(workflow) {
|
801
|
+
return this.mutateAndCheckError(Documents.UpdateWorkflow, { workflow: workflow });
|
868
802
|
}
|
869
|
-
|
870
|
-
return
|
871
|
-
return this.mutateAndCheckError(Documents.DisableFeed, { id: id });
|
872
|
-
});
|
803
|
+
async upsertWorkflow(workflow) {
|
804
|
+
return this.mutateAndCheckError(Documents.UpsertWorkflow, { workflow: workflow });
|
873
805
|
}
|
874
|
-
|
875
|
-
return
|
876
|
-
return this.queryAndCheckError(Documents.GetFeed, { id: id });
|
877
|
-
});
|
806
|
+
async deleteWorkflow(id) {
|
807
|
+
return this.mutateAndCheckError(Documents.DeleteWorkflow, { id: id });
|
878
808
|
}
|
879
|
-
|
880
|
-
return
|
881
|
-
return this.queryAndCheckError(Documents.QueryFeeds, { filter: filter });
|
882
|
-
});
|
809
|
+
async deleteWorkflows(ids, isSynchronous) {
|
810
|
+
return this.mutateAndCheckError(Documents.DeleteWorkflows, { ids: ids, isSynchronous: isSynchronous });
|
883
811
|
}
|
884
|
-
|
885
|
-
return
|
886
|
-
|
812
|
+
async deleteAllWorkflows(filter, isSynchronous, correlationId) {
|
813
|
+
return this.mutateAndCheckError(Documents.DeleteAllWorkflows, {
|
814
|
+
filter: filter,
|
815
|
+
isSynchronous: isSynchronous,
|
816
|
+
correlationId: correlationId,
|
887
817
|
});
|
888
818
|
}
|
889
|
-
|
890
|
-
return
|
891
|
-
return this.queryAndCheckError(Documents.FeedExists, { filter: filter });
|
892
|
-
});
|
819
|
+
async getWorkflow(id) {
|
820
|
+
return this.queryAndCheckError(Documents.GetWorkflow, { id: id });
|
893
821
|
}
|
894
|
-
|
895
|
-
return
|
896
|
-
return this.queryAndCheckError(Documents.IsFeedDone, { id: id });
|
897
|
-
});
|
822
|
+
async queryWorkflows(filter) {
|
823
|
+
return this.queryAndCheckError(Documents.QueryWorkflows, { filter: filter });
|
898
824
|
}
|
899
|
-
|
900
|
-
return
|
901
|
-
return this.mutateAndCheckError(Documents.PromptSpecifications, { prompt: prompt, ids: ids });
|
902
|
-
});
|
825
|
+
async countWorkflows(filter) {
|
826
|
+
return this.queryAndCheckError(Documents.CountWorkflows, { filter: filter });
|
903
827
|
}
|
904
|
-
|
905
|
-
return
|
906
|
-
return this.mutateAndCheckError(Documents.CreateSpecification, { specification: specification });
|
907
|
-
});
|
828
|
+
async workflowExists(filter) {
|
829
|
+
return this.queryAndCheckError(Documents.WorkflowExists, { filter: filter });
|
908
830
|
}
|
909
|
-
|
910
|
-
return
|
911
|
-
return this.mutateAndCheckError(Documents.UpdateSpecification, { specification: specification });
|
912
|
-
});
|
831
|
+
async createUser(user) {
|
832
|
+
return this.mutateAndCheckError(Documents.CreateUser, { user: user });
|
913
833
|
}
|
914
|
-
|
915
|
-
return
|
916
|
-
return this.mutateAndCheckError(Documents.UpsertSpecification, { specification: specification });
|
917
|
-
});
|
834
|
+
async updateUser(user) {
|
835
|
+
return this.mutateAndCheckError(Documents.UpdateUser, { user: user });
|
918
836
|
}
|
919
|
-
|
920
|
-
return
|
921
|
-
return this.mutateAndCheckError(Documents.DeleteSpecification, { id: id });
|
922
|
-
});
|
837
|
+
async deleteUser(id) {
|
838
|
+
return this.mutateAndCheckError(Documents.DeleteUser, { id: id });
|
923
839
|
}
|
924
|
-
|
925
|
-
return
|
926
|
-
return this.mutateAndCheckError(Documents.DeleteSpecifications, {
|
927
|
-
ids: ids,
|
928
|
-
isSynchronous: isSynchronous,
|
929
|
-
});
|
930
|
-
});
|
840
|
+
async getUser() {
|
841
|
+
return this.queryAndCheckError(Documents.GetUser, {});
|
931
842
|
}
|
932
|
-
|
933
|
-
return
|
934
|
-
return this.mutateAndCheckError(Documents.DeleteAllSpecifications, {
|
935
|
-
filter: filter,
|
936
|
-
isSynchronous: isSynchronous,
|
937
|
-
correlationId: correlationId,
|
938
|
-
});
|
939
|
-
});
|
843
|
+
async queryUsers(filter) {
|
844
|
+
return this.queryAndCheckError(Documents.QueryUsers, { filter: filter });
|
940
845
|
}
|
941
|
-
|
942
|
-
return
|
943
|
-
return this.queryAndCheckError(Documents.GetSpecification, { id: id });
|
944
|
-
});
|
846
|
+
async countUsers(filter) {
|
847
|
+
return this.queryAndCheckError(Documents.CountUsers, { filter: filter });
|
945
848
|
}
|
946
|
-
|
947
|
-
return
|
948
|
-
return this.queryAndCheckError(Documents.QuerySpecifications, { filter: filter });
|
949
|
-
});
|
849
|
+
async enableUser(id) {
|
850
|
+
return this.mutateAndCheckError(Documents.EnableUser, { id: id });
|
950
851
|
}
|
951
|
-
|
952
|
-
return
|
953
|
-
return this.queryAndCheckError(Documents.CountSpecifications, { filter: filter });
|
954
|
-
});
|
852
|
+
async disableUser(id) {
|
853
|
+
return this.mutateAndCheckError(Documents.DisableUser, { id: id });
|
955
854
|
}
|
956
|
-
|
957
|
-
return
|
958
|
-
return this.queryAndCheckError(Documents.SpecificationExists, { filter: filter });
|
959
|
-
});
|
855
|
+
async createCategory(category) {
|
856
|
+
return this.mutateAndCheckError(Documents.CreateCategory, { category: category });
|
960
857
|
}
|
961
|
-
|
962
|
-
return
|
963
|
-
return this.queryAndCheckError(Documents.QueryModels, { filter: filter });
|
964
|
-
});
|
858
|
+
async updateCategory(category) {
|
859
|
+
return this.mutateAndCheckError(Documents.UpdateCategory, { category: category });
|
965
860
|
}
|
966
|
-
|
967
|
-
return
|
968
|
-
return this.mutateAndCheckError(Documents.CreateWorkflow, { workflow: workflow });
|
969
|
-
});
|
861
|
+
async upsertCategory(category) {
|
862
|
+
return this.mutateAndCheckError(Documents.UpsertCategory, { category: category });
|
970
863
|
}
|
971
|
-
|
972
|
-
return
|
973
|
-
return this.mutateAndCheckError(Documents.UpdateWorkflow, { workflow: workflow });
|
974
|
-
});
|
864
|
+
async deleteCategory(id) {
|
865
|
+
return this.mutateAndCheckError(Documents.DeleteCategory, { id: id });
|
975
866
|
}
|
976
|
-
|
977
|
-
return
|
978
|
-
return this.mutateAndCheckError(Documents.UpsertWorkflow, { workflow: workflow });
|
979
|
-
});
|
867
|
+
async deleteCategories(ids, isSynchronous) {
|
868
|
+
return this.mutateAndCheckError(Documents.DeleteCategories, { ids: ids, isSynchronous: isSynchronous });
|
980
869
|
}
|
981
|
-
|
982
|
-
return
|
983
|
-
|
870
|
+
async deleteAllCategories(filter, isSynchronous, correlationId) {
|
871
|
+
return this.mutateAndCheckError(Documents.DeleteAllCategories, {
|
872
|
+
filter: filter,
|
873
|
+
isSynchronous: isSynchronous,
|
874
|
+
correlationId: correlationId,
|
984
875
|
});
|
985
876
|
}
|
986
|
-
|
987
|
-
return
|
988
|
-
return this.mutateAndCheckError(Documents.DeleteWorkflows, { ids: ids, isSynchronous: isSynchronous });
|
989
|
-
});
|
877
|
+
async getCategory(id) {
|
878
|
+
return this.queryAndCheckError(Documents.GetCategory, { id: id });
|
990
879
|
}
|
991
|
-
|
992
|
-
return
|
993
|
-
return this.mutateAndCheckError(Documents.DeleteAllWorkflows, {
|
994
|
-
filter: filter,
|
995
|
-
isSynchronous: isSynchronous,
|
996
|
-
correlationId: correlationId,
|
997
|
-
});
|
998
|
-
});
|
880
|
+
async queryCategories(filter) {
|
881
|
+
return this.queryAndCheckError(Documents.QueryCategories, { filter: filter });
|
999
882
|
}
|
1000
|
-
|
1001
|
-
return
|
1002
|
-
return this.queryAndCheckError(Documents.GetWorkflow, { id: id });
|
1003
|
-
});
|
883
|
+
async createLabel(label) {
|
884
|
+
return this.mutateAndCheckError(Documents.CreateLabel, { label: label });
|
1004
885
|
}
|
1005
|
-
|
1006
|
-
return
|
1007
|
-
return this.queryAndCheckError(Documents.QueryWorkflows, { filter: filter });
|
1008
|
-
});
|
886
|
+
async updateLabel(label) {
|
887
|
+
return this.mutateAndCheckError(Documents.UpdateLabel, { label: label });
|
1009
888
|
}
|
1010
|
-
|
1011
|
-
return
|
1012
|
-
return this.queryAndCheckError(Documents.CountWorkflows, { filter: filter });
|
1013
|
-
});
|
889
|
+
async upsertLabel(label) {
|
890
|
+
return this.mutateAndCheckError(Documents.UpsertLabel, { label: label });
|
1014
891
|
}
|
1015
|
-
|
1016
|
-
return
|
1017
|
-
return this.queryAndCheckError(Documents.WorkflowExists, { filter: filter });
|
1018
|
-
});
|
892
|
+
async deleteLabel(id) {
|
893
|
+
return this.mutateAndCheckError(Documents.DeleteLabel, { id: id });
|
1019
894
|
}
|
1020
|
-
|
1021
|
-
return
|
1022
|
-
return this.mutateAndCheckError(Documents.CreateUser, { user: user });
|
1023
|
-
});
|
895
|
+
async deleteLabels(ids, isSynchronous) {
|
896
|
+
return this.mutateAndCheckError(Documents.DeleteLabels, { ids: ids, isSynchronous: isSynchronous });
|
1024
897
|
}
|
1025
|
-
|
1026
|
-
return
|
1027
|
-
|
898
|
+
async deleteAllLabels(filter, isSynchronous, correlationId) {
|
899
|
+
return this.mutateAndCheckError(Documents.DeleteAllLabels, {
|
900
|
+
filter: filter,
|
901
|
+
isSynchronous: isSynchronous,
|
902
|
+
correlationId: correlationId,
|
1028
903
|
});
|
1029
904
|
}
|
1030
|
-
|
1031
|
-
return
|
1032
|
-
return this.mutateAndCheckError(Documents.DeleteUser, { id: id });
|
1033
|
-
});
|
905
|
+
async getLabel(id) {
|
906
|
+
return this.queryAndCheckError(Documents.GetLabel, { id: id });
|
1034
907
|
}
|
1035
|
-
|
1036
|
-
return
|
1037
|
-
return this.queryAndCheckError(Documents.GetUser, {});
|
1038
|
-
});
|
908
|
+
async queryLabels(filter) {
|
909
|
+
return this.queryAndCheckError(Documents.QueryLabels, { filter: filter });
|
1039
910
|
}
|
1040
|
-
|
1041
|
-
return
|
1042
|
-
return this.queryAndCheckError(Documents.QueryUsers, { filter: filter });
|
1043
|
-
});
|
911
|
+
async createPerson(person) {
|
912
|
+
return this.mutateAndCheckError(Documents.CreatePerson, { person: person });
|
1044
913
|
}
|
1045
|
-
|
1046
|
-
return
|
1047
|
-
return this.queryAndCheckError(Documents.CountUsers, { filter: filter });
|
1048
|
-
});
|
914
|
+
async updatePerson(person) {
|
915
|
+
return this.mutateAndCheckError(Documents.UpdatePerson, { person: person });
|
1049
916
|
}
|
1050
|
-
|
1051
|
-
return
|
1052
|
-
return this.mutateAndCheckError(Documents.EnableUser, { id: id });
|
1053
|
-
});
|
917
|
+
async deletePerson(id) {
|
918
|
+
return this.mutateAndCheckError(Documents.DeletePerson, { id: id });
|
1054
919
|
}
|
1055
|
-
|
1056
|
-
return
|
1057
|
-
return this.mutateAndCheckError(Documents.DisableUser, { id: id });
|
1058
|
-
});
|
920
|
+
async deletePersons(ids, isSynchronous) {
|
921
|
+
return this.mutateAndCheckError(Documents.DeletePersons, { ids: ids, isSynchronous: isSynchronous });
|
1059
922
|
}
|
1060
|
-
|
1061
|
-
return
|
1062
|
-
|
923
|
+
async deleteAllPersons(filter, isSynchronous, correlationId) {
|
924
|
+
return this.mutateAndCheckError(Documents.DeleteAllPersons, {
|
925
|
+
filter: filter,
|
926
|
+
isSynchronous: isSynchronous,
|
927
|
+
correlationId: correlationId,
|
1063
928
|
});
|
1064
929
|
}
|
1065
|
-
|
1066
|
-
return
|
1067
|
-
return this.mutateAndCheckError(Documents.UpdateCategory, { category: category });
|
1068
|
-
});
|
930
|
+
async getPerson(id) {
|
931
|
+
return this.queryAndCheckError(Documents.GetPerson, { id: id });
|
1069
932
|
}
|
1070
|
-
|
1071
|
-
return
|
1072
|
-
return this.mutateAndCheckError(Documents.UpsertCategory, { category: category });
|
1073
|
-
});
|
933
|
+
async queryPersons(filter) {
|
934
|
+
return this.queryAndCheckError(Documents.QueryPersons, { filter: filter });
|
1074
935
|
}
|
1075
|
-
|
1076
|
-
return
|
1077
|
-
return this.mutateAndCheckError(Documents.DeleteCategory, { id: id });
|
1078
|
-
});
|
936
|
+
async createOrganization(organization) {
|
937
|
+
return this.mutateAndCheckError(Documents.CreateOrganization, { organization: organization });
|
1079
938
|
}
|
1080
|
-
|
1081
|
-
return
|
1082
|
-
return this.mutateAndCheckError(Documents.DeleteCategories, { ids: ids, isSynchronous: isSynchronous });
|
1083
|
-
});
|
939
|
+
async updateOrganization(organization) {
|
940
|
+
return this.mutateAndCheckError(Documents.UpdateOrganization, { organization: organization });
|
1084
941
|
}
|
1085
|
-
|
1086
|
-
return
|
1087
|
-
return this.mutateAndCheckError(Documents.DeleteAllCategories, {
|
1088
|
-
filter: filter,
|
1089
|
-
isSynchronous: isSynchronous,
|
1090
|
-
correlationId: correlationId,
|
1091
|
-
});
|
1092
|
-
});
|
942
|
+
async deleteOrganization(id) {
|
943
|
+
return this.mutateAndCheckError(Documents.DeleteOrganization, { id: id });
|
1093
944
|
}
|
1094
|
-
|
1095
|
-
return
|
1096
|
-
|
945
|
+
async deleteOrganizations(ids, isSynchronous) {
|
946
|
+
return this.mutateAndCheckError(Documents.DeleteOrganizations, {
|
947
|
+
ids: ids,
|
948
|
+
isSynchronous: isSynchronous,
|
1097
949
|
});
|
1098
950
|
}
|
1099
|
-
|
1100
|
-
return
|
1101
|
-
|
951
|
+
async deleteAllOrganizations(filter, isSynchronous, correlationId) {
|
952
|
+
return this.mutateAndCheckError(Documents.DeleteAllOrganizations, {
|
953
|
+
filter: filter,
|
954
|
+
isSynchronous: isSynchronous,
|
955
|
+
correlationId: correlationId,
|
1102
956
|
});
|
1103
957
|
}
|
1104
|
-
|
1105
|
-
return
|
1106
|
-
return this.mutateAndCheckError(Documents.CreateLabel, { label: label });
|
1107
|
-
});
|
958
|
+
async getOrganization(id) {
|
959
|
+
return this.queryAndCheckError(Documents.GetOrganization, { id: id });
|
1108
960
|
}
|
1109
|
-
|
1110
|
-
return
|
1111
|
-
return this.mutateAndCheckError(Documents.UpdateLabel, { label: label });
|
1112
|
-
});
|
961
|
+
async queryOrganizations(filter) {
|
962
|
+
return this.queryAndCheckError(Documents.QueryOrganizations, { filter: filter });
|
1113
963
|
}
|
1114
|
-
|
1115
|
-
return
|
1116
|
-
return this.mutateAndCheckError(Documents.UpsertLabel, { label: label });
|
1117
|
-
});
|
964
|
+
async createPlace(place) {
|
965
|
+
return this.mutateAndCheckError(Documents.CreatePlace, { place: place });
|
1118
966
|
}
|
1119
|
-
|
1120
|
-
return
|
1121
|
-
return this.mutateAndCheckError(Documents.DeleteLabel, { id: id });
|
1122
|
-
});
|
967
|
+
async updatePlace(place) {
|
968
|
+
return this.mutateAndCheckError(Documents.UpdatePlace, { place: place });
|
1123
969
|
}
|
1124
|
-
|
1125
|
-
return
|
1126
|
-
return this.mutateAndCheckError(Documents.DeleteLabels, { ids: ids, isSynchronous: isSynchronous });
|
1127
|
-
});
|
970
|
+
async deletePlace(id) {
|
971
|
+
return this.mutateAndCheckError(Documents.DeletePlace, { id: id });
|
1128
972
|
}
|
1129
|
-
|
1130
|
-
return
|
1131
|
-
return this.mutateAndCheckError(Documents.DeleteAllLabels, {
|
1132
|
-
filter: filter,
|
1133
|
-
isSynchronous: isSynchronous,
|
1134
|
-
correlationId: correlationId,
|
1135
|
-
});
|
1136
|
-
});
|
973
|
+
async deletePlaces(ids, isSynchronous) {
|
974
|
+
return this.mutateAndCheckError(Documents.DeletePlaces, { ids: ids, isSynchronous: isSynchronous });
|
1137
975
|
}
|
1138
|
-
|
1139
|
-
return
|
1140
|
-
|
976
|
+
async deleteAllPlaces(filter, isSynchronous, correlationId) {
|
977
|
+
return this.mutateAndCheckError(Documents.DeleteAllPlaces, {
|
978
|
+
filter: filter,
|
979
|
+
isSynchronous: isSynchronous,
|
980
|
+
correlationId: correlationId,
|
1141
981
|
});
|
1142
982
|
}
|
1143
|
-
|
1144
|
-
return
|
1145
|
-
return this.queryAndCheckError(Documents.QueryLabels, { filter: filter });
|
1146
|
-
});
|
983
|
+
async getPlace(id) {
|
984
|
+
return this.queryAndCheckError(Documents.GetPlace, { id: id });
|
1147
985
|
}
|
1148
|
-
|
1149
|
-
return
|
1150
|
-
return this.mutateAndCheckError(Documents.CreatePerson, { person: person });
|
1151
|
-
});
|
986
|
+
async queryPlaces(filter) {
|
987
|
+
return this.queryAndCheckError(Documents.QueryPlaces, { filter: filter });
|
1152
988
|
}
|
1153
|
-
|
1154
|
-
return
|
1155
|
-
return this.mutateAndCheckError(Documents.UpdatePerson, { person: person });
|
1156
|
-
});
|
989
|
+
async createEvent(event) {
|
990
|
+
return this.mutateAndCheckError(Documents.CreateEvent, { event: event });
|
1157
991
|
}
|
1158
|
-
|
1159
|
-
return
|
1160
|
-
return this.mutateAndCheckError(Documents.DeletePerson, { id: id });
|
1161
|
-
});
|
992
|
+
async updateEvent(event) {
|
993
|
+
return this.mutateAndCheckError(Documents.UpdateEvent, { event: event });
|
1162
994
|
}
|
1163
|
-
|
1164
|
-
return
|
1165
|
-
return this.mutateAndCheckError(Documents.DeletePersons, { ids: ids, isSynchronous: isSynchronous });
|
1166
|
-
});
|
995
|
+
async deleteEvent(id) {
|
996
|
+
return this.mutateAndCheckError(Documents.DeleteEvent, { id: id });
|
1167
997
|
}
|
1168
|
-
|
1169
|
-
return
|
1170
|
-
return this.mutateAndCheckError(Documents.DeleteAllPersons, {
|
1171
|
-
filter: filter,
|
1172
|
-
isSynchronous: isSynchronous,
|
1173
|
-
correlationId: correlationId,
|
1174
|
-
});
|
1175
|
-
});
|
998
|
+
async deleteEvents(ids, isSynchronous) {
|
999
|
+
return this.mutateAndCheckError(Documents.DeleteEvents, { ids: ids, isSynchronous: isSynchronous });
|
1176
1000
|
}
|
1177
|
-
|
1178
|
-
return
|
1179
|
-
|
1001
|
+
async deleteAllEvents(filter, isSynchronous, correlationId) {
|
1002
|
+
return this.mutateAndCheckError(Documents.DeleteAllEvents, {
|
1003
|
+
filter: filter,
|
1004
|
+
isSynchronous: isSynchronous,
|
1005
|
+
correlationId: correlationId,
|
1180
1006
|
});
|
1181
1007
|
}
|
1182
|
-
|
1183
|
-
return
|
1184
|
-
return this.queryAndCheckError(Documents.QueryPersons, { filter: filter });
|
1185
|
-
});
|
1008
|
+
async getEvent(id) {
|
1009
|
+
return this.queryAndCheckError(Documents.GetEvent, { id: id });
|
1186
1010
|
}
|
1187
|
-
|
1188
|
-
return
|
1189
|
-
return this.mutateAndCheckError(Documents.CreateOrganization, { organization: organization });
|
1190
|
-
});
|
1011
|
+
async queryEvents(filter) {
|
1012
|
+
return this.queryAndCheckError(Documents.QueryEvents, { filter: filter });
|
1191
1013
|
}
|
1192
|
-
|
1193
|
-
return
|
1194
|
-
return this.mutateAndCheckError(Documents.UpdateOrganization, { organization: organization });
|
1195
|
-
});
|
1014
|
+
async createProduct(product) {
|
1015
|
+
return this.mutateAndCheckError(Documents.CreateProduct, { product: product });
|
1196
1016
|
}
|
1197
|
-
|
1198
|
-
return
|
1199
|
-
return this.mutateAndCheckError(Documents.DeleteOrganization, { id: id });
|
1200
|
-
});
|
1017
|
+
async updateProduct(product) {
|
1018
|
+
return this.mutateAndCheckError(Documents.UpdateProduct, { product: product });
|
1201
1019
|
}
|
1202
|
-
|
1203
|
-
return
|
1204
|
-
return this.mutateAndCheckError(Documents.DeleteOrganizations, {
|
1205
|
-
ids: ids,
|
1206
|
-
isSynchronous: isSynchronous,
|
1207
|
-
});
|
1208
|
-
});
|
1020
|
+
async deleteProduct(id) {
|
1021
|
+
return this.mutateAndCheckError(Documents.DeleteProduct, { id: id });
|
1209
1022
|
}
|
1210
|
-
|
1211
|
-
return
|
1212
|
-
return this.mutateAndCheckError(Documents.DeleteAllOrganizations, {
|
1213
|
-
filter: filter,
|
1214
|
-
isSynchronous: isSynchronous,
|
1215
|
-
correlationId: correlationId,
|
1216
|
-
});
|
1217
|
-
});
|
1023
|
+
async deleteProducts(ids, isSynchronous) {
|
1024
|
+
return this.mutateAndCheckError(Documents.DeleteProducts, { ids: ids, isSynchronous: isSynchronous });
|
1218
1025
|
}
|
1219
|
-
|
1220
|
-
return
|
1221
|
-
|
1026
|
+
async deleteAllProducts(filter, isSynchronous, correlationId) {
|
1027
|
+
return this.mutateAndCheckError(Documents.DeleteAllProducts, {
|
1028
|
+
filter: filter,
|
1029
|
+
isSynchronous: isSynchronous,
|
1030
|
+
correlationId: correlationId,
|
1222
1031
|
});
|
1223
1032
|
}
|
1224
|
-
|
1225
|
-
return
|
1226
|
-
return this.queryAndCheckError(Documents.QueryOrganizations, { filter: filter });
|
1227
|
-
});
|
1033
|
+
async getProduct(id) {
|
1034
|
+
return this.queryAndCheckError(Documents.GetProduct, { id: id });
|
1228
1035
|
}
|
1229
|
-
|
1230
|
-
return
|
1231
|
-
return this.mutateAndCheckError(Documents.CreatePlace, { place: place });
|
1232
|
-
});
|
1036
|
+
async queryProducts(filter) {
|
1037
|
+
return this.queryAndCheckError(Documents.QueryProducts, { filter: filter });
|
1233
1038
|
}
|
1234
|
-
|
1235
|
-
return
|
1236
|
-
return this.mutateAndCheckError(Documents.UpdatePlace, { place: place });
|
1237
|
-
});
|
1039
|
+
async createRepo(repo) {
|
1040
|
+
return this.mutateAndCheckError(Documents.CreateRepo, { repo: repo });
|
1238
1041
|
}
|
1239
|
-
|
1240
|
-
return
|
1241
|
-
return this.mutateAndCheckError(Documents.DeletePlace, { id: id });
|
1242
|
-
});
|
1042
|
+
async updateRepo(repo) {
|
1043
|
+
return this.mutateAndCheckError(Documents.UpdateRepo, { repo: repo });
|
1243
1044
|
}
|
1244
|
-
|
1245
|
-
return
|
1246
|
-
return this.mutateAndCheckError(Documents.DeletePlaces, { ids: ids, isSynchronous: isSynchronous });
|
1247
|
-
});
|
1045
|
+
async deleteRepo(id) {
|
1046
|
+
return this.mutateAndCheckError(Documents.DeleteRepo, { id: id });
|
1248
1047
|
}
|
1249
|
-
|
1250
|
-
return
|
1251
|
-
return this.mutateAndCheckError(Documents.DeleteAllPlaces, {
|
1252
|
-
filter: filter,
|
1253
|
-
isSynchronous: isSynchronous,
|
1254
|
-
correlationId: correlationId,
|
1255
|
-
});
|
1256
|
-
});
|
1048
|
+
async deleteRepos(ids, isSynchronous) {
|
1049
|
+
return this.mutateAndCheckError(Documents.DeleteRepos, { ids: ids, isSynchronous: isSynchronous });
|
1257
1050
|
}
|
1258
|
-
|
1259
|
-
return
|
1260
|
-
|
1051
|
+
async deleteAllRepos(filter, isSynchronous, correlationId) {
|
1052
|
+
return this.mutateAndCheckError(Documents.DeleteAllRepos, {
|
1053
|
+
filter: filter,
|
1054
|
+
isSynchronous: isSynchronous,
|
1055
|
+
correlationId: correlationId,
|
1261
1056
|
});
|
1262
1057
|
}
|
1263
|
-
|
1264
|
-
return
|
1265
|
-
return this.queryAndCheckError(Documents.QueryPlaces, { filter: filter });
|
1266
|
-
});
|
1058
|
+
async getRepo(id) {
|
1059
|
+
return this.queryAndCheckError(Documents.GetRepo, { id: id });
|
1267
1060
|
}
|
1268
|
-
|
1269
|
-
return
|
1270
|
-
return this.mutateAndCheckError(Documents.CreateEvent, { event: event });
|
1271
|
-
});
|
1061
|
+
async queryRepos(filter) {
|
1062
|
+
return this.queryAndCheckError(Documents.QueryRepos, { filter: filter });
|
1272
1063
|
}
|
1273
|
-
|
1274
|
-
return
|
1275
|
-
return this.mutateAndCheckError(Documents.UpdateEvent, { event: event });
|
1276
|
-
});
|
1064
|
+
async createSoftware(software) {
|
1065
|
+
return this.mutateAndCheckError(Documents.CreateSoftware, { software: software });
|
1277
1066
|
}
|
1278
|
-
|
1279
|
-
return
|
1280
|
-
return this.mutateAndCheckError(Documents.DeleteEvent, { id: id });
|
1281
|
-
});
|
1067
|
+
async updateSoftware(software) {
|
1068
|
+
return this.mutateAndCheckError(Documents.UpdateSoftware, { software: software });
|
1282
1069
|
}
|
1283
|
-
|
1284
|
-
return
|
1285
|
-
return this.mutateAndCheckError(Documents.DeleteEvents, { ids: ids, isSynchronous: isSynchronous });
|
1286
|
-
});
|
1070
|
+
async deleteSoftware(id) {
|
1071
|
+
return this.mutateAndCheckError(Documents.DeleteSoftware, { id: id });
|
1287
1072
|
}
|
1288
|
-
|
1289
|
-
return
|
1290
|
-
return this.mutateAndCheckError(Documents.DeleteAllEvents, {
|
1291
|
-
filter: filter,
|
1292
|
-
isSynchronous: isSynchronous,
|
1293
|
-
correlationId: correlationId,
|
1294
|
-
});
|
1295
|
-
});
|
1073
|
+
async deleteSoftwares(ids, isSynchronous) {
|
1074
|
+
return this.mutateAndCheckError(Documents.DeleteSoftwares, { ids: ids, isSynchronous: isSynchronous });
|
1296
1075
|
}
|
1297
|
-
|
1298
|
-
return
|
1299
|
-
|
1076
|
+
async deleteAllSoftwares(filter, isSynchronous, correlationId) {
|
1077
|
+
return this.mutateAndCheckError(Documents.DeleteAllSoftwares, {
|
1078
|
+
filter: filter,
|
1079
|
+
isSynchronous: isSynchronous,
|
1080
|
+
correlationId: correlationId,
|
1300
1081
|
});
|
1301
1082
|
}
|
1302
|
-
|
1303
|
-
return
|
1304
|
-
return this.queryAndCheckError(Documents.QueryEvents, { filter: filter });
|
1305
|
-
});
|
1083
|
+
async getSoftware(id) {
|
1084
|
+
return this.queryAndCheckError(Documents.GetSoftware, { id: id });
|
1306
1085
|
}
|
1307
|
-
|
1308
|
-
return
|
1309
|
-
return this.mutateAndCheckError(Documents.CreateProduct, { product: product });
|
1310
|
-
});
|
1086
|
+
async querySoftwares(filter) {
|
1087
|
+
return this.queryAndCheckError(Documents.QuerySoftwares, { filter: filter });
|
1311
1088
|
}
|
1312
|
-
|
1313
|
-
return
|
1314
|
-
return this.mutateAndCheckError(Documents.UpdateProduct, { product: product });
|
1315
|
-
});
|
1089
|
+
async createMedicalCondition(MedicalCondition) {
|
1090
|
+
return this.mutateAndCheckError(Documents.CreateMedicalCondition, { MedicalCondition: MedicalCondition });
|
1316
1091
|
}
|
1317
|
-
|
1318
|
-
return
|
1319
|
-
return this.mutateAndCheckError(Documents.DeleteProduct, { id: id });
|
1320
|
-
});
|
1092
|
+
async updateMedicalCondition(MedicalCondition) {
|
1093
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalCondition, { MedicalCondition: MedicalCondition });
|
1321
1094
|
}
|
1322
|
-
|
1323
|
-
return
|
1324
|
-
return this.mutateAndCheckError(Documents.DeleteProducts, { ids: ids, isSynchronous: isSynchronous });
|
1325
|
-
});
|
1095
|
+
async deleteMedicalCondition(id) {
|
1096
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalCondition, { id: id });
|
1326
1097
|
}
|
1327
|
-
|
1328
|
-
return
|
1329
|
-
|
1330
|
-
|
1331
|
-
isSynchronous: isSynchronous,
|
1332
|
-
correlationId: correlationId,
|
1333
|
-
});
|
1098
|
+
async deleteMedicalConditions(ids, isSynchronous) {
|
1099
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalConditions, {
|
1100
|
+
ids: ids,
|
1101
|
+
isSynchronous: isSynchronous,
|
1334
1102
|
});
|
1335
1103
|
}
|
1336
|
-
|
1337
|
-
return
|
1338
|
-
|
1104
|
+
async deleteAllMedicalConditions(filter, isSynchronous, correlationId) {
|
1105
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalConditions, {
|
1106
|
+
filter: filter,
|
1107
|
+
isSynchronous: isSynchronous,
|
1108
|
+
correlationId: correlationId,
|
1339
1109
|
});
|
1340
1110
|
}
|
1341
|
-
|
1342
|
-
return
|
1343
|
-
return this.queryAndCheckError(Documents.QueryProducts, { filter: filter });
|
1344
|
-
});
|
1111
|
+
async getMedicalCondition(id) {
|
1112
|
+
return this.queryAndCheckError(Documents.GetMedicalCondition, { id: id });
|
1345
1113
|
}
|
1346
|
-
|
1347
|
-
return
|
1348
|
-
return this.mutateAndCheckError(Documents.CreateRepo, { repo: repo });
|
1349
|
-
});
|
1114
|
+
async queryMedicalConditions(filter) {
|
1115
|
+
return this.queryAndCheckError(Documents.QueryMedicalConditions, { filter: filter });
|
1350
1116
|
}
|
1351
|
-
|
1352
|
-
return
|
1353
|
-
return this.mutateAndCheckError(Documents.UpdateRepo, { repo: repo });
|
1354
|
-
});
|
1117
|
+
async createMedicalGuideline(MedicalGuideline) {
|
1118
|
+
return this.mutateAndCheckError(Documents.CreateMedicalGuideline, { MedicalGuideline: MedicalGuideline });
|
1355
1119
|
}
|
1356
|
-
|
1357
|
-
return
|
1358
|
-
return this.mutateAndCheckError(Documents.DeleteRepo, { id: id });
|
1359
|
-
});
|
1120
|
+
async updateMedicalGuideline(MedicalGuideline) {
|
1121
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalGuideline, { MedicalGuideline: MedicalGuideline });
|
1360
1122
|
}
|
1361
|
-
|
1362
|
-
return
|
1363
|
-
return this.mutateAndCheckError(Documents.DeleteRepos, { ids: ids, isSynchronous: isSynchronous });
|
1364
|
-
});
|
1123
|
+
async deleteMedicalGuideline(id) {
|
1124
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalGuideline, { id: id });
|
1365
1125
|
}
|
1366
|
-
|
1367
|
-
return
|
1368
|
-
|
1369
|
-
|
1370
|
-
isSynchronous: isSynchronous,
|
1371
|
-
correlationId: correlationId,
|
1372
|
-
});
|
1126
|
+
async deleteMedicalGuidelines(ids, isSynchronous) {
|
1127
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalGuidelines, {
|
1128
|
+
ids: ids,
|
1129
|
+
isSynchronous: isSynchronous,
|
1373
1130
|
});
|
1374
1131
|
}
|
1375
|
-
|
1376
|
-
return
|
1377
|
-
|
1132
|
+
async deleteAllMedicalGuidelines(filter, isSynchronous, correlationId) {
|
1133
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalGuidelines, {
|
1134
|
+
filter: filter,
|
1135
|
+
isSynchronous: isSynchronous,
|
1136
|
+
correlationId: correlationId,
|
1378
1137
|
});
|
1379
1138
|
}
|
1380
|
-
|
1381
|
-
return
|
1382
|
-
return this.queryAndCheckError(Documents.QueryRepos, { filter: filter });
|
1383
|
-
});
|
1139
|
+
async getMedicalGuideline(id) {
|
1140
|
+
return this.queryAndCheckError(Documents.GetMedicalGuideline, { id: id });
|
1384
1141
|
}
|
1385
|
-
|
1386
|
-
return
|
1387
|
-
return this.mutateAndCheckError(Documents.CreateSoftware, { software: software });
|
1388
|
-
});
|
1389
|
-
}
|
1390
|
-
updateSoftware(software) {
|
1391
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1392
|
-
return this.mutateAndCheckError(Documents.UpdateSoftware, { software: software });
|
1393
|
-
});
|
1142
|
+
async queryMedicalGuidelines(filter) {
|
1143
|
+
return this.queryAndCheckError(Documents.QueryMedicalGuidelines, { filter: filter });
|
1394
1144
|
}
|
1395
|
-
|
1396
|
-
return
|
1397
|
-
return this.mutateAndCheckError(Documents.DeleteSoftware, { id: id });
|
1398
|
-
});
|
1145
|
+
async createMedicalDrug(MedicalDrug) {
|
1146
|
+
return this.mutateAndCheckError(Documents.CreateMedicalDrug, { MedicalDrug: MedicalDrug });
|
1399
1147
|
}
|
1400
|
-
|
1401
|
-
return
|
1402
|
-
return this.mutateAndCheckError(Documents.DeleteSoftwares, { ids: ids, isSynchronous: isSynchronous });
|
1403
|
-
});
|
1148
|
+
async updateMedicalDrug(MedicalDrug) {
|
1149
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalDrug, { MedicalDrug: MedicalDrug });
|
1404
1150
|
}
|
1405
|
-
|
1406
|
-
return
|
1407
|
-
return this.mutateAndCheckError(Documents.DeleteAllSoftwares, {
|
1408
|
-
filter: filter,
|
1409
|
-
isSynchronous: isSynchronous,
|
1410
|
-
correlationId: correlationId,
|
1411
|
-
});
|
1412
|
-
});
|
1151
|
+
async deleteMedicalDrug(id) {
|
1152
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalDrug, { id: id });
|
1413
1153
|
}
|
1414
|
-
|
1415
|
-
return
|
1416
|
-
return this.queryAndCheckError(Documents.GetSoftware, { id: id });
|
1417
|
-
});
|
1154
|
+
async deleteMedicalDrugs(ids, isSynchronous) {
|
1155
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalDrugs, { ids: ids, isSynchronous: isSynchronous });
|
1418
1156
|
}
|
1419
|
-
|
1420
|
-
return
|
1421
|
-
|
1157
|
+
async deleteAllMedicalDrugs(filter, isSynchronous, correlationId) {
|
1158
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalDrugs, {
|
1159
|
+
filter: filter,
|
1160
|
+
isSynchronous: isSynchronous,
|
1161
|
+
correlationId: correlationId,
|
1422
1162
|
});
|
1423
1163
|
}
|
1424
|
-
|
1425
|
-
return
|
1426
|
-
return this.mutateAndCheckError(Documents.CreateMedicalCondition, { MedicalCondition: MedicalCondition });
|
1427
|
-
});
|
1164
|
+
async getMedicalDrug(id) {
|
1165
|
+
return this.queryAndCheckError(Documents.GetMedicalDrug, { id: id });
|
1428
1166
|
}
|
1429
|
-
|
1430
|
-
return
|
1431
|
-
return this.mutateAndCheckError(Documents.UpdateMedicalCondition, { MedicalCondition: MedicalCondition });
|
1432
|
-
});
|
1167
|
+
async queryMedicalDrugs(filter) {
|
1168
|
+
return this.queryAndCheckError(Documents.QueryMedicalDrugs, { filter: filter });
|
1433
1169
|
}
|
1434
|
-
|
1435
|
-
return
|
1436
|
-
|
1170
|
+
async createMedicalIndication(MedicalIndication) {
|
1171
|
+
return this.mutateAndCheckError(Documents.CreateMedicalIndication, {
|
1172
|
+
MedicalIndication: MedicalIndication,
|
1437
1173
|
});
|
1438
1174
|
}
|
1439
|
-
|
1440
|
-
return
|
1441
|
-
|
1442
|
-
ids: ids,
|
1443
|
-
isSynchronous: isSynchronous,
|
1444
|
-
});
|
1175
|
+
async updateMedicalIndication(MedicalIndication) {
|
1176
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalIndication, {
|
1177
|
+
MedicalIndication: MedicalIndication,
|
1445
1178
|
});
|
1446
1179
|
}
|
1447
|
-
|
1448
|
-
return
|
1449
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalConditions, {
|
1450
|
-
filter: filter,
|
1451
|
-
isSynchronous: isSynchronous,
|
1452
|
-
correlationId: correlationId,
|
1453
|
-
});
|
1454
|
-
});
|
1180
|
+
async deleteMedicalIndication(id) {
|
1181
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalIndication, { id: id });
|
1455
1182
|
}
|
1456
|
-
|
1457
|
-
return
|
1458
|
-
|
1183
|
+
async deleteMedicalIndications(ids, isSynchronous) {
|
1184
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalIndications, {
|
1185
|
+
ids: ids,
|
1186
|
+
isSynchronous: isSynchronous,
|
1459
1187
|
});
|
1460
1188
|
}
|
1461
|
-
|
1462
|
-
return
|
1463
|
-
|
1189
|
+
async deleteAllMedicalIndications(filter, isSynchronous, correlationId) {
|
1190
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalIndications, {
|
1191
|
+
filter: filter,
|
1192
|
+
isSynchronous: isSynchronous,
|
1193
|
+
correlationId: correlationId,
|
1464
1194
|
});
|
1465
1195
|
}
|
1466
|
-
|
1467
|
-
return
|
1468
|
-
return this.mutateAndCheckError(Documents.CreateMedicalGuideline, { MedicalGuideline: MedicalGuideline });
|
1469
|
-
});
|
1196
|
+
async getMedicalIndication(id) {
|
1197
|
+
return this.queryAndCheckError(Documents.GetMedicalIndication, { id: id });
|
1470
1198
|
}
|
1471
|
-
|
1472
|
-
return
|
1473
|
-
return this.mutateAndCheckError(Documents.UpdateMedicalGuideline, { MedicalGuideline: MedicalGuideline });
|
1474
|
-
});
|
1199
|
+
async queryMedicalIndications(filter) {
|
1200
|
+
return this.queryAndCheckError(Documents.QueryMedicalIndications, { filter: filter });
|
1475
1201
|
}
|
1476
|
-
|
1477
|
-
return
|
1478
|
-
|
1202
|
+
async createMedicalContraindication(MedicalContraindication) {
|
1203
|
+
return this.mutateAndCheckError(Documents.CreateMedicalContraindication, {
|
1204
|
+
MedicalContraindication: MedicalContraindication,
|
1479
1205
|
});
|
1480
1206
|
}
|
1481
|
-
|
1482
|
-
return
|
1483
|
-
|
1484
|
-
ids: ids,
|
1485
|
-
isSynchronous: isSynchronous,
|
1486
|
-
});
|
1207
|
+
async updateMedicalContraindication(MedicalContraindication) {
|
1208
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalContraindication, {
|
1209
|
+
MedicalContraindication: MedicalContraindication,
|
1487
1210
|
});
|
1488
1211
|
}
|
1489
|
-
|
1490
|
-
return
|
1491
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalGuidelines, {
|
1492
|
-
filter: filter,
|
1493
|
-
isSynchronous: isSynchronous,
|
1494
|
-
correlationId: correlationId,
|
1495
|
-
});
|
1496
|
-
});
|
1212
|
+
async deleteMedicalContraindication(id) {
|
1213
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalContraindication, { id: id });
|
1497
1214
|
}
|
1498
|
-
|
1499
|
-
return
|
1500
|
-
|
1215
|
+
async deleteMedicalContraindications(ids, isSynchronous) {
|
1216
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalContraindications, {
|
1217
|
+
ids: ids,
|
1218
|
+
isSynchronous: isSynchronous,
|
1501
1219
|
});
|
1502
1220
|
}
|
1503
|
-
|
1504
|
-
return
|
1505
|
-
|
1221
|
+
async deleteAllMedicalContraindications(filter, isSynchronous, correlationId) {
|
1222
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalContraindications, {
|
1223
|
+
filter: filter,
|
1224
|
+
isSynchronous: isSynchronous,
|
1225
|
+
correlationId: correlationId,
|
1506
1226
|
});
|
1507
1227
|
}
|
1508
|
-
|
1509
|
-
return
|
1510
|
-
return this.mutateAndCheckError(Documents.CreateMedicalDrug, { MedicalDrug: MedicalDrug });
|
1511
|
-
});
|
1228
|
+
async getMedicalContraindication(id) {
|
1229
|
+
return this.queryAndCheckError(Documents.GetMedicalContraindication, { id: id });
|
1512
1230
|
}
|
1513
|
-
|
1514
|
-
return
|
1515
|
-
return this.mutateAndCheckError(Documents.UpdateMedicalDrug, { MedicalDrug: MedicalDrug });
|
1516
|
-
});
|
1517
|
-
}
|
1518
|
-
deleteMedicalDrug(id) {
|
1519
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1520
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalDrug, { id: id });
|
1521
|
-
});
|
1522
|
-
}
|
1523
|
-
deleteMedicalDrugs(ids, isSynchronous) {
|
1524
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1525
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalDrugs, { ids: ids, isSynchronous: isSynchronous });
|
1526
|
-
});
|
1527
|
-
}
|
1528
|
-
deleteAllMedicalDrugs(filter, isSynchronous, correlationId) {
|
1529
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1530
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalDrugs, {
|
1531
|
-
filter: filter,
|
1532
|
-
isSynchronous: isSynchronous,
|
1533
|
-
correlationId: correlationId,
|
1534
|
-
});
|
1535
|
-
});
|
1536
|
-
}
|
1537
|
-
getMedicalDrug(id) {
|
1538
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1539
|
-
return this.queryAndCheckError(Documents.GetMedicalDrug, { id: id });
|
1540
|
-
});
|
1541
|
-
}
|
1542
|
-
queryMedicalDrugs(filter) {
|
1543
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1544
|
-
return this.queryAndCheckError(Documents.QueryMedicalDrugs, { filter: filter });
|
1545
|
-
});
|
1546
|
-
}
|
1547
|
-
createMedicalIndication(MedicalIndication) {
|
1548
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1549
|
-
return this.mutateAndCheckError(Documents.CreateMedicalIndication, {
|
1550
|
-
MedicalIndication: MedicalIndication,
|
1551
|
-
});
|
1552
|
-
});
|
1553
|
-
}
|
1554
|
-
updateMedicalIndication(MedicalIndication) {
|
1555
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1556
|
-
return this.mutateAndCheckError(Documents.UpdateMedicalIndication, {
|
1557
|
-
MedicalIndication: MedicalIndication,
|
1558
|
-
});
|
1559
|
-
});
|
1560
|
-
}
|
1561
|
-
deleteMedicalIndication(id) {
|
1562
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1563
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalIndication, { id: id });
|
1564
|
-
});
|
1565
|
-
}
|
1566
|
-
deleteMedicalIndications(ids, isSynchronous) {
|
1567
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1568
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalIndications, {
|
1569
|
-
ids: ids,
|
1570
|
-
isSynchronous: isSynchronous,
|
1571
|
-
});
|
1572
|
-
});
|
1573
|
-
}
|
1574
|
-
deleteAllMedicalIndications(filter, isSynchronous, correlationId) {
|
1575
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1576
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalIndications, {
|
1577
|
-
filter: filter,
|
1578
|
-
isSynchronous: isSynchronous,
|
1579
|
-
correlationId: correlationId,
|
1580
|
-
});
|
1581
|
-
});
|
1231
|
+
async queryMedicalContraindications(filter) {
|
1232
|
+
return this.queryAndCheckError(Documents.QueryMedicalContraindications, { filter: filter });
|
1582
1233
|
}
|
1583
|
-
|
1584
|
-
return
|
1585
|
-
return this.queryAndCheckError(Documents.GetMedicalIndication, { id: id });
|
1586
|
-
});
|
1234
|
+
async createMedicalTest(MedicalTest) {
|
1235
|
+
return this.mutateAndCheckError(Documents.CreateMedicalTest, { MedicalTest: MedicalTest });
|
1587
1236
|
}
|
1588
|
-
|
1589
|
-
return
|
1590
|
-
return this.queryAndCheckError(Documents.QueryMedicalIndications, { filter: filter });
|
1591
|
-
});
|
1237
|
+
async updateMedicalTest(MedicalTest) {
|
1238
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalTest, { MedicalTest: MedicalTest });
|
1592
1239
|
}
|
1593
|
-
|
1594
|
-
return
|
1595
|
-
return this.mutateAndCheckError(Documents.CreateMedicalContraindication, {
|
1596
|
-
MedicalContraindication: MedicalContraindication,
|
1597
|
-
});
|
1598
|
-
});
|
1240
|
+
async deleteMedicalTest(id) {
|
1241
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalTest, { id: id });
|
1599
1242
|
}
|
1600
|
-
|
1601
|
-
return
|
1602
|
-
return this.mutateAndCheckError(Documents.UpdateMedicalContraindication, {
|
1603
|
-
MedicalContraindication: MedicalContraindication,
|
1604
|
-
});
|
1605
|
-
});
|
1243
|
+
async deleteMedicalTests(ids, isSynchronous) {
|
1244
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalTests, { ids: ids, isSynchronous: isSynchronous });
|
1606
1245
|
}
|
1607
|
-
|
1608
|
-
return
|
1609
|
-
|
1246
|
+
async deleteAllMedicalTests(filter, isSynchronous, correlationId) {
|
1247
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalTests, {
|
1248
|
+
filter: filter,
|
1249
|
+
isSynchronous: isSynchronous,
|
1250
|
+
correlationId: correlationId,
|
1610
1251
|
});
|
1611
1252
|
}
|
1612
|
-
|
1613
|
-
return
|
1614
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalContraindications, {
|
1615
|
-
ids: ids,
|
1616
|
-
isSynchronous: isSynchronous,
|
1617
|
-
});
|
1618
|
-
});
|
1253
|
+
async getMedicalTest(id) {
|
1254
|
+
return this.queryAndCheckError(Documents.GetMedicalTest, { id: id });
|
1619
1255
|
}
|
1620
|
-
|
1621
|
-
return
|
1622
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalContraindications, {
|
1623
|
-
filter: filter,
|
1624
|
-
isSynchronous: isSynchronous,
|
1625
|
-
correlationId: correlationId,
|
1626
|
-
});
|
1627
|
-
});
|
1256
|
+
async queryMedicalTests(filter) {
|
1257
|
+
return this.queryAndCheckError(Documents.QueryMedicalTests, { filter: filter });
|
1628
1258
|
}
|
1629
|
-
|
1630
|
-
return
|
1631
|
-
return this.queryAndCheckError(Documents.GetMedicalContraindication, { id: id });
|
1632
|
-
});
|
1259
|
+
async createMedicalDevice(MedicalDevice) {
|
1260
|
+
return this.mutateAndCheckError(Documents.CreateMedicalDevice, { MedicalDevice: MedicalDevice });
|
1633
1261
|
}
|
1634
|
-
|
1635
|
-
return
|
1636
|
-
return this.queryAndCheckError(Documents.QueryMedicalContraindications, { filter: filter });
|
1637
|
-
});
|
1262
|
+
async updateMedicalDevice(MedicalDevice) {
|
1263
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalDevice, { MedicalDevice: MedicalDevice });
|
1638
1264
|
}
|
1639
|
-
|
1640
|
-
return
|
1641
|
-
return this.mutateAndCheckError(Documents.CreateMedicalTest, { MedicalTest: MedicalTest });
|
1642
|
-
});
|
1265
|
+
async deleteMedicalDevice(id) {
|
1266
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalDevice, { id: id });
|
1643
1267
|
}
|
1644
|
-
|
1645
|
-
return
|
1646
|
-
|
1268
|
+
async deleteMedicalDevices(ids, isSynchronous) {
|
1269
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalDevices, {
|
1270
|
+
ids: ids,
|
1271
|
+
isSynchronous: isSynchronous,
|
1647
1272
|
});
|
1648
1273
|
}
|
1649
|
-
|
1650
|
-
return
|
1651
|
-
|
1274
|
+
async deleteAllMedicalDevices(filter, isSynchronous, correlationId) {
|
1275
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalDevices, {
|
1276
|
+
filter: filter,
|
1277
|
+
isSynchronous: isSynchronous,
|
1278
|
+
correlationId: correlationId,
|
1652
1279
|
});
|
1653
1280
|
}
|
1654
|
-
|
1655
|
-
return
|
1656
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalTests, { ids: ids, isSynchronous: isSynchronous });
|
1657
|
-
});
|
1281
|
+
async getMedicalDevice(id) {
|
1282
|
+
return this.queryAndCheckError(Documents.GetMedicalDevice, { id: id });
|
1658
1283
|
}
|
1659
|
-
|
1660
|
-
return
|
1661
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalTests, {
|
1662
|
-
filter: filter,
|
1663
|
-
isSynchronous: isSynchronous,
|
1664
|
-
correlationId: correlationId,
|
1665
|
-
});
|
1666
|
-
});
|
1284
|
+
async queryMedicalDevices(filter) {
|
1285
|
+
return this.queryAndCheckError(Documents.QueryMedicalDevices, { filter: filter });
|
1667
1286
|
}
|
1668
|
-
|
1669
|
-
return
|
1670
|
-
return this.queryAndCheckError(Documents.GetMedicalTest, { id: id });
|
1671
|
-
});
|
1287
|
+
async createMedicalProcedure(MedicalProcedure) {
|
1288
|
+
return this.mutateAndCheckError(Documents.CreateMedicalProcedure, { MedicalProcedure: MedicalProcedure });
|
1672
1289
|
}
|
1673
|
-
|
1674
|
-
return
|
1675
|
-
return this.queryAndCheckError(Documents.QueryMedicalTests, { filter: filter });
|
1676
|
-
});
|
1290
|
+
async updateMedicalProcedure(MedicalProcedure) {
|
1291
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalProcedure, { MedicalProcedure: MedicalProcedure });
|
1677
1292
|
}
|
1678
|
-
|
1679
|
-
return
|
1680
|
-
return this.mutateAndCheckError(Documents.CreateMedicalDevice, { MedicalDevice: MedicalDevice });
|
1681
|
-
});
|
1293
|
+
async deleteMedicalProcedure(id) {
|
1294
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalProcedure, { id: id });
|
1682
1295
|
}
|
1683
|
-
|
1684
|
-
return
|
1685
|
-
|
1296
|
+
async deleteMedicalProcedures(ids, isSynchronous) {
|
1297
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalProcedures, {
|
1298
|
+
ids: ids,
|
1299
|
+
isSynchronous: isSynchronous,
|
1686
1300
|
});
|
1687
1301
|
}
|
1688
|
-
|
1689
|
-
return
|
1690
|
-
|
1302
|
+
async deleteAllMedicalProcedures(filter, isSynchronous, correlationId) {
|
1303
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalProcedures, {
|
1304
|
+
filter: filter,
|
1305
|
+
isSynchronous: isSynchronous,
|
1306
|
+
correlationId: correlationId,
|
1691
1307
|
});
|
1692
1308
|
}
|
1693
|
-
|
1694
|
-
return
|
1695
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalDevices, {
|
1696
|
-
ids: ids,
|
1697
|
-
isSynchronous: isSynchronous,
|
1698
|
-
});
|
1699
|
-
});
|
1309
|
+
async getMedicalProcedure(id) {
|
1310
|
+
return this.queryAndCheckError(Documents.GetMedicalProcedure, { id: id });
|
1700
1311
|
}
|
1701
|
-
|
1702
|
-
return
|
1703
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalDevices, {
|
1704
|
-
filter: filter,
|
1705
|
-
isSynchronous: isSynchronous,
|
1706
|
-
correlationId: correlationId,
|
1707
|
-
});
|
1708
|
-
});
|
1312
|
+
async queryMedicalProcedures(filter) {
|
1313
|
+
return this.queryAndCheckError(Documents.QueryMedicalProcedures, { filter: filter });
|
1709
1314
|
}
|
1710
|
-
|
1711
|
-
return
|
1712
|
-
return this.queryAndCheckError(Documents.GetMedicalDevice, { id: id });
|
1713
|
-
});
|
1315
|
+
async createMedicalStudy(MedicalStudy) {
|
1316
|
+
return this.mutateAndCheckError(Documents.CreateMedicalStudy, { MedicalStudy: MedicalStudy });
|
1714
1317
|
}
|
1715
|
-
|
1716
|
-
return
|
1717
|
-
return this.queryAndCheckError(Documents.QueryMedicalDevices, { filter: filter });
|
1718
|
-
});
|
1318
|
+
async updateMedicalStudy(MedicalStudy) {
|
1319
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalStudy, { MedicalStudy: MedicalStudy });
|
1719
1320
|
}
|
1720
|
-
|
1721
|
-
return
|
1722
|
-
return this.mutateAndCheckError(Documents.CreateMedicalProcedure, { MedicalProcedure: MedicalProcedure });
|
1723
|
-
});
|
1321
|
+
async deleteMedicalStudy(id) {
|
1322
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalStudy, { id: id });
|
1724
1323
|
}
|
1725
|
-
|
1726
|
-
return
|
1727
|
-
|
1324
|
+
async deleteMedicalStudies(ids, isSynchronous) {
|
1325
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalStudies, {
|
1326
|
+
ids: ids,
|
1327
|
+
isSynchronous: isSynchronous,
|
1728
1328
|
});
|
1729
1329
|
}
|
1730
|
-
|
1731
|
-
return
|
1732
|
-
|
1330
|
+
async deleteAllMedicalStudies(filter, isSynchronous, correlationId) {
|
1331
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalStudies, {
|
1332
|
+
filter: filter,
|
1333
|
+
isSynchronous: isSynchronous,
|
1334
|
+
correlationId: correlationId,
|
1733
1335
|
});
|
1734
1336
|
}
|
1735
|
-
|
1736
|
-
return
|
1737
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalProcedures, {
|
1738
|
-
ids: ids,
|
1739
|
-
isSynchronous: isSynchronous,
|
1740
|
-
});
|
1741
|
-
});
|
1337
|
+
async getMedicalStudy(id) {
|
1338
|
+
return this.queryAndCheckError(Documents.GetMedicalStudy, { id: id });
|
1742
1339
|
}
|
1743
|
-
|
1744
|
-
return
|
1745
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalProcedures, {
|
1746
|
-
filter: filter,
|
1747
|
-
isSynchronous: isSynchronous,
|
1748
|
-
correlationId: correlationId,
|
1749
|
-
});
|
1750
|
-
});
|
1340
|
+
async queryMedicalStudies(filter) {
|
1341
|
+
return this.queryAndCheckError(Documents.QueryMedicalStudies, { filter: filter });
|
1751
1342
|
}
|
1752
|
-
|
1753
|
-
return
|
1754
|
-
return this.queryAndCheckError(Documents.GetMedicalProcedure, { id: id });
|
1755
|
-
});
|
1343
|
+
async createMedicalDrugClass(MedicalDrugClass) {
|
1344
|
+
return this.mutateAndCheckError(Documents.CreateMedicalDrugClass, { MedicalDrugClass: MedicalDrugClass });
|
1756
1345
|
}
|
1757
|
-
|
1758
|
-
return
|
1759
|
-
return this.queryAndCheckError(Documents.QueryMedicalProcedures, { filter: filter });
|
1760
|
-
});
|
1346
|
+
async updateMedicalDrugClass(MedicalDrugClass) {
|
1347
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalDrugClass, { MedicalDrugClass: MedicalDrugClass });
|
1761
1348
|
}
|
1762
|
-
|
1763
|
-
return
|
1764
|
-
return this.mutateAndCheckError(Documents.CreateMedicalStudy, { MedicalStudy: MedicalStudy });
|
1765
|
-
});
|
1349
|
+
async deleteMedicalDrugClass(id) {
|
1350
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalDrugClass, { id: id });
|
1766
1351
|
}
|
1767
|
-
|
1768
|
-
return
|
1769
|
-
|
1352
|
+
async deleteMedicalDrugClasses(ids, isSynchronous) {
|
1353
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalDrugClasses, {
|
1354
|
+
ids: ids,
|
1355
|
+
isSynchronous: isSynchronous,
|
1770
1356
|
});
|
1771
1357
|
}
|
1772
|
-
|
1773
|
-
return
|
1774
|
-
|
1358
|
+
async deleteAllMedicalDrugClasses(filter, isSynchronous, correlationId) {
|
1359
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalDrugClasses, {
|
1360
|
+
filter: filter,
|
1361
|
+
isSynchronous: isSynchronous,
|
1362
|
+
correlationId: correlationId,
|
1775
1363
|
});
|
1776
1364
|
}
|
1777
|
-
|
1778
|
-
return
|
1779
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalStudies, {
|
1780
|
-
ids: ids,
|
1781
|
-
isSynchronous: isSynchronous,
|
1782
|
-
});
|
1783
|
-
});
|
1365
|
+
async getMedicalDrugClass(id) {
|
1366
|
+
return this.queryAndCheckError(Documents.GetMedicalDrugClass, { id: id });
|
1784
1367
|
}
|
1785
|
-
|
1786
|
-
return
|
1787
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalStudies, {
|
1788
|
-
filter: filter,
|
1789
|
-
isSynchronous: isSynchronous,
|
1790
|
-
correlationId: correlationId,
|
1791
|
-
});
|
1792
|
-
});
|
1368
|
+
async queryMedicalDrugClasses(filter) {
|
1369
|
+
return this.queryAndCheckError(Documents.QueryMedicalDrugClasses, { filter: filter });
|
1793
1370
|
}
|
1794
|
-
|
1795
|
-
return
|
1796
|
-
return this.queryAndCheckError(Documents.GetMedicalStudy, { id: id });
|
1797
|
-
});
|
1371
|
+
async createMedicalTherapy(MedicalTherapy) {
|
1372
|
+
return this.mutateAndCheckError(Documents.CreateMedicalTherapy, { MedicalTherapy: MedicalTherapy });
|
1798
1373
|
}
|
1799
|
-
|
1800
|
-
return
|
1801
|
-
return this.queryAndCheckError(Documents.QueryMedicalStudies, { filter: filter });
|
1802
|
-
});
|
1374
|
+
async updateMedicalTherapy(MedicalTherapy) {
|
1375
|
+
return this.mutateAndCheckError(Documents.UpdateMedicalTherapy, { MedicalTherapy: MedicalTherapy });
|
1803
1376
|
}
|
1804
|
-
|
1805
|
-
return
|
1806
|
-
return this.mutateAndCheckError(Documents.CreateMedicalDrugClass, { MedicalDrugClass: MedicalDrugClass });
|
1807
|
-
});
|
1377
|
+
async deleteMedicalTherapy(id) {
|
1378
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalTherapy, { id: id });
|
1808
1379
|
}
|
1809
|
-
|
1810
|
-
return
|
1811
|
-
|
1380
|
+
async deleteMedicalTherapies(ids, isSynchronous) {
|
1381
|
+
return this.mutateAndCheckError(Documents.DeleteMedicalTherapies, {
|
1382
|
+
ids: ids,
|
1383
|
+
isSynchronous: isSynchronous,
|
1812
1384
|
});
|
1813
1385
|
}
|
1814
|
-
|
1815
|
-
return
|
1816
|
-
|
1386
|
+
async deleteAllMedicalTherapies(filter, isSynchronous, correlationId) {
|
1387
|
+
return this.mutateAndCheckError(Documents.DeleteAllMedicalTherapies, {
|
1388
|
+
filter: filter,
|
1389
|
+
isSynchronous: isSynchronous,
|
1390
|
+
correlationId: correlationId,
|
1817
1391
|
});
|
1818
1392
|
}
|
1819
|
-
|
1820
|
-
return
|
1821
|
-
return this.mutateAndCheckError(Documents.DeleteMedicalDrugClasses, {
|
1822
|
-
ids: ids,
|
1823
|
-
isSynchronous: isSynchronous,
|
1824
|
-
});
|
1825
|
-
});
|
1393
|
+
async getMedicalTherapy(id) {
|
1394
|
+
return this.queryAndCheckError(Documents.GetMedicalTherapy, { id: id });
|
1826
1395
|
}
|
1827
|
-
|
1828
|
-
return
|
1829
|
-
return this.mutateAndCheckError(Documents.DeleteAllMedicalDrugClasses, {
|
1830
|
-
filter: filter,
|
1831
|
-
isSynchronous: isSynchronous,
|
1832
|
-
correlationId: correlationId,
|
1833
|
-
});
|
1834
|
-
});
|
1396
|
+
async queryMedicalTherapies(filter) {
|
1397
|
+
return this.queryAndCheckError(Documents.QueryMedicalTherapies, { filter: filter });
|
1835
1398
|
}
|
1836
|
-
|
1837
|
-
return
|
1838
|
-
return this.queryAndCheckError(Documents.GetMedicalDrugClass, { id: id });
|
1839
|
-
});
|
1399
|
+
async createObservation(observation) {
|
1400
|
+
return this.mutateAndCheckError(Documents.CreateObservation, { observation: observation });
|
1840
1401
|
}
|
1841
|
-
|
1842
|
-
return
|
1843
|
-
return this.queryAndCheckError(Documents.QueryMedicalDrugClasses, { filter: filter });
|
1844
|
-
});
|
1402
|
+
async updateObservation(observation) {
|
1403
|
+
return this.mutateAndCheckError(Documents.UpdateObservation, { observation: observation });
|
1845
1404
|
}
|
1846
|
-
|
1847
|
-
return
|
1848
|
-
return this.mutateAndCheckError(Documents.CreateMedicalTherapy, { MedicalTherapy: MedicalTherapy });
|
1849
|
-
});
|
1405
|
+
async deleteObservation(id) {
|
1406
|
+
return this.mutateAndCheckError(Documents.DeleteObservation, { id: id });
|
1850
1407
|
}
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1408
|
+
/**
|
1409
|
+
* Creates an event handler that supports UI streaming mode
|
1410
|
+
* @internal
|
1411
|
+
*/
|
1412
|
+
/**
|
1413
|
+
* Check if streaming is supported with the current configuration
|
1414
|
+
* @param specification - Optional specification to check compatibility
|
1415
|
+
* @returns true if streaming is available, false otherwise
|
1416
|
+
*/
|
1417
|
+
supportsStreaming(specification) {
|
1418
|
+
// If we have a full specification, check its service type
|
1419
|
+
if (specification && "modelService" in specification) {
|
1420
|
+
const serviceType = specification.modelService;
|
1421
|
+
switch (serviceType) {
|
1422
|
+
case Types.ModelServiceTypes.OpenAi:
|
1423
|
+
return typeof OpenAI !== "undefined";
|
1424
|
+
case Types.ModelServiceTypes.Anthropic:
|
1425
|
+
return typeof Anthropic !== "undefined";
|
1426
|
+
case Types.ModelServiceTypes.Google:
|
1427
|
+
return typeof GoogleGenerativeAI !== "undefined";
|
1428
|
+
default:
|
1429
|
+
return false;
|
1430
|
+
}
|
1431
|
+
}
|
1432
|
+
// If we only have a reference or no specification, check if any client is available
|
1433
|
+
const hasOpenAI = typeof OpenAI !== "undefined";
|
1434
|
+
const hasAnthropic = typeof Anthropic !== "undefined";
|
1435
|
+
const hasGoogle = typeof GoogleGenerativeAI !== "undefined";
|
1436
|
+
return hasOpenAI || hasAnthropic || hasGoogle;
|
1437
|
+
}
|
1438
|
+
/**
|
1439
|
+
* Execute an agent with non-streaming response
|
1440
|
+
* @param prompt - The user prompt
|
1441
|
+
* @param conversationId - Optional conversation ID to continue
|
1442
|
+
* @param specification - Optional specification for the LLM
|
1443
|
+
* @param tools - Optional tool definitions
|
1444
|
+
* @param toolHandlers - Optional tool handler functions
|
1445
|
+
* @param options - Agent options
|
1446
|
+
* @returns Complete agent result with message and tool calls
|
1447
|
+
*/
|
1448
|
+
async promptAgent(prompt, conversationId, specification, tools, toolHandlers, options, mimeType, data, // base64 encoded
|
1449
|
+
correlationId) {
|
1450
|
+
const startTime = Date.now();
|
1451
|
+
const maxRounds = options?.maxToolRounds || 10;
|
1452
|
+
const timeout = options?.timeout || 300000; // 5 minutes default
|
1453
|
+
// Create abort controller for timeout
|
1454
|
+
const abortController = new AbortController();
|
1455
|
+
const timeoutId = setTimeout(() => abortController.abort(), timeout);
|
1456
|
+
try {
|
1457
|
+
// 1. Ensure conversation exists
|
1458
|
+
let actualConversationId = conversationId;
|
1459
|
+
if (!actualConversationId) {
|
1460
|
+
const createResponse = await this.createConversation({
|
1461
|
+
name: `Agent conversation`,
|
1462
|
+
specification: specification,
|
1463
|
+
tools: tools,
|
1464
|
+
}, correlationId);
|
1465
|
+
actualConversationId = createResponse.createConversation?.id;
|
1466
|
+
if (!actualConversationId) {
|
1467
|
+
throw new Error("Failed to create conversation");
|
1468
|
+
}
|
1469
|
+
}
|
1470
|
+
// 2. Initial prompt
|
1471
|
+
const promptResponse = await this.promptConversation(prompt, actualConversationId, specification, mimeType, data, tools, false, // requireTool
|
1472
|
+
false, // includeDetails
|
1473
|
+
correlationId);
|
1474
|
+
let currentMessage = promptResponse.promptConversation?.message;
|
1475
|
+
if (!currentMessage) {
|
1476
|
+
throw new Error("No message in prompt response");
|
1477
|
+
}
|
1478
|
+
// 3. Tool calling loop
|
1479
|
+
const allToolCalls = [];
|
1480
|
+
let rounds = 0;
|
1481
|
+
let totalTokens = 0;
|
1482
|
+
while (currentMessage.toolCalls?.length &&
|
1483
|
+
rounds < maxRounds &&
|
1484
|
+
!abortController.signal.aborted) {
|
1485
|
+
rounds++;
|
1486
|
+
// Execute tools
|
1487
|
+
const toolResults = await this.executeToolsForPromptAgent(currentMessage.toolCalls.filter((tc) => tc !== null), toolHandlers || {}, allToolCalls, abortController.signal);
|
1488
|
+
if (abortController.signal.aborted) {
|
1489
|
+
throw new Error("Operation timed out");
|
1490
|
+
}
|
1491
|
+
// Continue conversation
|
1492
|
+
const continueResponse = await this.continueConversation(actualConversationId, toolResults, correlationId);
|
1493
|
+
currentMessage = continueResponse.continueConversation?.message;
|
1494
|
+
if (!currentMessage)
|
1495
|
+
break;
|
1496
|
+
// Track token usage
|
1497
|
+
if (continueResponse.continueConversation?.message?.tokens) {
|
1498
|
+
totalTokens += continueResponse.continueConversation.message.tokens;
|
1499
|
+
}
|
1500
|
+
}
|
1501
|
+
return {
|
1502
|
+
message: currentMessage?.message || "",
|
1503
|
+
conversationId: actualConversationId,
|
1504
|
+
};
|
1505
|
+
}
|
1506
|
+
catch (error) {
|
1507
|
+
// Return partial result with error
|
1508
|
+
const isTimeout = error.message === "Operation timed out";
|
1509
|
+
return {
|
1510
|
+
message: "",
|
1511
|
+
conversationId: conversationId || "",
|
1512
|
+
error: {
|
1513
|
+
message: error.message || "Unknown error",
|
1514
|
+
code: error.code || (isTimeout ? "TIMEOUT" : "UNKNOWN"),
|
1515
|
+
recoverable: isTimeout || error.code === "RATE_LIMIT",
|
1516
|
+
details: error.response?.data,
|
1517
|
+
},
|
1518
|
+
};
|
1519
|
+
}
|
1520
|
+
finally {
|
1521
|
+
clearTimeout(timeoutId);
|
1522
|
+
}
|
1855
1523
|
}
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1524
|
+
/**
|
1525
|
+
* Execute an agent with streaming response
|
1526
|
+
* @param prompt - The user prompt
|
1527
|
+
* @param onEvent - Event handler for streaming events
|
1528
|
+
* @param conversationId - Optional conversation ID to continue
|
1529
|
+
* @param specification - Optional specification for the LLM
|
1530
|
+
* @param tools - Optional tool definitions
|
1531
|
+
* @param toolHandlers - Optional tool handler functions
|
1532
|
+
* @param options - Stream agent options
|
1533
|
+
* @throws Error if streaming is not supported
|
1534
|
+
*/
|
1535
|
+
async streamAgent(prompt, onEvent, conversationId, specification, tools, toolHandlers, options, mimeType, data, // base64 encoded
|
1536
|
+
correlationId) {
|
1537
|
+
const maxRounds = options?.maxToolRounds || 100;
|
1538
|
+
const abortSignal = options?.abortSignal;
|
1539
|
+
let uiAdapter;
|
1540
|
+
// Check if already aborted
|
1541
|
+
if (abortSignal?.aborted) {
|
1542
|
+
throw new Error("Operation aborted");
|
1543
|
+
}
|
1544
|
+
try {
|
1545
|
+
// Get full specification if needed
|
1546
|
+
const fullSpec = specification?.id
|
1547
|
+
? (await this.getSpecification(specification.id))
|
1548
|
+
.specification
|
1549
|
+
: undefined;
|
1550
|
+
// Check streaming support
|
1551
|
+
if (!this.supportsStreaming(fullSpec)) {
|
1552
|
+
throw new Error("Streaming is not supported for this specification. " +
|
1553
|
+
"Use promptAgent() instead or configure a streaming client.");
|
1554
|
+
}
|
1555
|
+
// Ensure conversation
|
1556
|
+
let actualConversationId = conversationId;
|
1557
|
+
if (!actualConversationId) {
|
1558
|
+
const createResponse = await this.createConversation({
|
1559
|
+
name: `Streaming agent conversation`,
|
1560
|
+
specification: specification,
|
1561
|
+
tools: tools,
|
1562
|
+
}, correlationId);
|
1563
|
+
actualConversationId = createResponse.createConversation?.id;
|
1564
|
+
if (!actualConversationId) {
|
1565
|
+
throw new Error("Failed to create conversation");
|
1566
|
+
}
|
1567
|
+
}
|
1568
|
+
// Create UI event adapter
|
1569
|
+
uiAdapter = new UIEventAdapter(onEvent, actualConversationId, {
|
1570
|
+
showTokenStream: options?.showTokenStream ?? true,
|
1571
|
+
smoothingEnabled: options?.smoothingEnabled ?? true,
|
1572
|
+
chunkingStrategy: options?.chunkingStrategy ?? "word",
|
1573
|
+
smoothingDelay: options?.smoothingDelay ?? 30,
|
1574
|
+
});
|
1575
|
+
// Start the streaming conversation
|
1576
|
+
await this.executeStreamingAgent(prompt, actualConversationId, fullSpec, tools, toolHandlers, uiAdapter, maxRounds, abortSignal, mimeType, data, correlationId);
|
1577
|
+
}
|
1578
|
+
catch (error) {
|
1579
|
+
const errorMessage = error instanceof Error ? error.message : "Streaming failed";
|
1580
|
+
if (uiAdapter) {
|
1581
|
+
uiAdapter.handleEvent({
|
1582
|
+
type: "error",
|
1583
|
+
error: errorMessage,
|
1584
|
+
});
|
1585
|
+
}
|
1586
|
+
else {
|
1587
|
+
// Fallback error event
|
1588
|
+
onEvent({
|
1589
|
+
type: "error",
|
1590
|
+
error: {
|
1591
|
+
message: errorMessage,
|
1592
|
+
recoverable: false,
|
1593
|
+
},
|
1594
|
+
conversationId: conversationId || "",
|
1595
|
+
timestamp: new Date(),
|
1596
|
+
});
|
1597
|
+
}
|
1598
|
+
throw error;
|
1599
|
+
}
|
1600
|
+
finally {
|
1601
|
+
// Clean up adapter
|
1602
|
+
if (uiAdapter) {
|
1603
|
+
uiAdapter.dispose();
|
1604
|
+
}
|
1605
|
+
}
|
1860
1606
|
}
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1864
|
-
|
1865
|
-
|
1607
|
+
/**
|
1608
|
+
* Execute the streaming agent workflow with tool calling loop
|
1609
|
+
*/
|
1610
|
+
async executeStreamingAgent(prompt, conversationId, specification, tools, toolHandlers, uiAdapter, maxRounds, abortSignal, mimeType, data, correlationId) {
|
1611
|
+
let currentRound = 0;
|
1612
|
+
let fullMessage = "";
|
1613
|
+
// Start the conversation
|
1614
|
+
uiAdapter.handleEvent({
|
1615
|
+
type: "start",
|
1616
|
+
conversationId,
|
1617
|
+
});
|
1618
|
+
// Format conversation once at the beginning
|
1619
|
+
const formatResponse = await this.formatConversation(prompt, conversationId, { id: specification.id }, tools, true, correlationId);
|
1620
|
+
const formattedPrompt = formatResponse.formatConversation?.message?.message;
|
1621
|
+
if (!formattedPrompt) {
|
1622
|
+
throw new Error("Failed to format conversation");
|
1623
|
+
}
|
1624
|
+
// Build message array with conversation history
|
1625
|
+
const messages = [];
|
1626
|
+
// Add system prompt if specified
|
1627
|
+
if (specification.systemPrompt) {
|
1628
|
+
messages.push({
|
1629
|
+
__typename: "ConversationMessage",
|
1630
|
+
role: Types.ConversationRoleTypes.System,
|
1631
|
+
message: specification.systemPrompt,
|
1632
|
+
timestamp: new Date().toISOString(),
|
1866
1633
|
});
|
1867
|
-
}
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1634
|
+
}
|
1635
|
+
// Get conversation history to maintain context
|
1636
|
+
const conversationResponse = await this.getConversation(conversationId);
|
1637
|
+
const conversation = conversationResponse.conversation;
|
1638
|
+
if (conversation?.messages && conversation.messages.length > 0) {
|
1639
|
+
// Add all previous messages (formatConversation already added the current prompt)
|
1640
|
+
const previousMessages = conversation.messages;
|
1641
|
+
messages.push(...previousMessages);
|
1642
|
+
}
|
1643
|
+
else {
|
1644
|
+
// If no history, just add the current user message
|
1645
|
+
messages.push({
|
1646
|
+
__typename: "ConversationMessage",
|
1647
|
+
role: Types.ConversationRoleTypes.User,
|
1648
|
+
message: formattedPrompt,
|
1649
|
+
timestamp: new Date().toISOString(),
|
1875
1650
|
});
|
1651
|
+
}
|
1652
|
+
const serviceType = getServiceType(specification);
|
1653
|
+
// Handle tool calling loop locally
|
1654
|
+
while (currentRound < maxRounds) {
|
1655
|
+
if (abortSignal?.aborted) {
|
1656
|
+
throw new Error("Operation aborted");
|
1657
|
+
}
|
1658
|
+
let toolCalls = [];
|
1659
|
+
let roundMessage = "";
|
1660
|
+
// Stream with appropriate provider
|
1661
|
+
if (serviceType === Types.ModelServiceTypes.OpenAi && OpenAI) {
|
1662
|
+
const openaiMessages = formatMessagesForOpenAI(messages);
|
1663
|
+
await this.streamWithOpenAI(specification, openaiMessages, tools, uiAdapter, (message, calls) => {
|
1664
|
+
roundMessage = message;
|
1665
|
+
toolCalls = calls;
|
1666
|
+
});
|
1667
|
+
}
|
1668
|
+
else if (serviceType === Types.ModelServiceTypes.Anthropic &&
|
1669
|
+
Anthropic) {
|
1670
|
+
const { system, messages: anthropicMessages } = formatMessagesForAnthropic(messages);
|
1671
|
+
await this.streamWithAnthropic(specification, anthropicMessages, system, tools, uiAdapter, (message, calls) => {
|
1672
|
+
roundMessage = message;
|
1673
|
+
toolCalls = calls;
|
1674
|
+
});
|
1675
|
+
}
|
1676
|
+
else if (serviceType === Types.ModelServiceTypes.Google &&
|
1677
|
+
GoogleGenerativeAI) {
|
1678
|
+
const googleMessages = formatMessagesForGoogle(messages);
|
1679
|
+
// Google doesn't use system prompts separately, they're incorporated into messages
|
1680
|
+
await this.streamWithGoogle(specification, googleMessages, undefined, // systemPrompt - Google handles this differently
|
1681
|
+
tools, uiAdapter, (message, calls) => {
|
1682
|
+
roundMessage = message;
|
1683
|
+
toolCalls = calls;
|
1684
|
+
});
|
1685
|
+
}
|
1686
|
+
else {
|
1687
|
+
// Fallback to non-streaming
|
1688
|
+
await this.fallbackToNonStreaming(prompt, conversationId, specification, tools, mimeType, data, uiAdapter, correlationId);
|
1689
|
+
break;
|
1690
|
+
}
|
1691
|
+
// Update the full message
|
1692
|
+
fullMessage = roundMessage;
|
1693
|
+
// If no tool calls, we're done
|
1694
|
+
if (!toolCalls || toolCalls.length === 0) {
|
1695
|
+
break;
|
1696
|
+
}
|
1697
|
+
// Execute tools and prepare for next round
|
1698
|
+
if (toolHandlers && toolCalls.length > 0) {
|
1699
|
+
// Add assistant message with tool calls to conversation
|
1700
|
+
const assistantMessage = {
|
1701
|
+
__typename: "ConversationMessage",
|
1702
|
+
role: Types.ConversationRoleTypes.Assistant,
|
1703
|
+
message: roundMessage,
|
1704
|
+
toolCalls: toolCalls,
|
1705
|
+
timestamp: new Date().toISOString(),
|
1706
|
+
};
|
1707
|
+
messages.push(assistantMessage);
|
1708
|
+
// Execute tools and add responses
|
1709
|
+
for (const toolCall of toolCalls) {
|
1710
|
+
const handler = toolHandlers[toolCall.name];
|
1711
|
+
if (!handler) {
|
1712
|
+
console.warn(`No handler for tool: ${toolCall.name}`);
|
1713
|
+
continue;
|
1714
|
+
}
|
1715
|
+
try {
|
1716
|
+
const args = JSON.parse(toolCall.arguments);
|
1717
|
+
// Update UI
|
1718
|
+
uiAdapter.handleEvent({
|
1719
|
+
type: "tool_call_start",
|
1720
|
+
toolCall: {
|
1721
|
+
id: toolCall.id,
|
1722
|
+
name: toolCall.name,
|
1723
|
+
},
|
1724
|
+
});
|
1725
|
+
// Execute tool
|
1726
|
+
const result = await handler(args);
|
1727
|
+
// Update UI
|
1728
|
+
uiAdapter.setToolResult(toolCall.id, result);
|
1729
|
+
// Add tool response to messages
|
1730
|
+
messages.push({
|
1731
|
+
__typename: "ConversationMessage",
|
1732
|
+
role: Types.ConversationRoleTypes.Tool,
|
1733
|
+
message: typeof result === "string" ? result : JSON.stringify(result),
|
1734
|
+
toolCallId: toolCall.id,
|
1735
|
+
timestamp: new Date().toISOString(),
|
1736
|
+
});
|
1737
|
+
}
|
1738
|
+
catch (error) {
|
1739
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
1740
|
+
console.error(`Tool execution error for ${toolCall.name}:`, error);
|
1741
|
+
// Update UI with error
|
1742
|
+
uiAdapter.setToolResult(toolCall.id, undefined, errorMessage);
|
1743
|
+
// Add error response
|
1744
|
+
messages.push({
|
1745
|
+
__typename: "ConversationMessage",
|
1746
|
+
role: Types.ConversationRoleTypes.Tool,
|
1747
|
+
message: `Error: ${errorMessage}`,
|
1748
|
+
toolCallId: toolCall.id,
|
1749
|
+
timestamp: new Date().toISOString(),
|
1750
|
+
});
|
1751
|
+
}
|
1752
|
+
}
|
1753
|
+
}
|
1754
|
+
currentRound++;
|
1755
|
+
}
|
1756
|
+
// Complete the conversation
|
1757
|
+
if (fullMessage) {
|
1758
|
+
await this.completeConversation(fullMessage.trim(), conversationId, correlationId);
|
1759
|
+
}
|
1760
|
+
// Emit completion event
|
1761
|
+
uiAdapter.handleEvent({
|
1762
|
+
type: "complete",
|
1763
|
+
conversationId,
|
1764
|
+
});
|
1765
|
+
}
|
1766
|
+
/**
|
1767
|
+
* Build message array for LLM from conversation history
|
1768
|
+
*/
|
1769
|
+
async buildMessageArray(conversationId, specification, currentPrompt) {
|
1770
|
+
const messages = [];
|
1771
|
+
// Add system prompt if present
|
1772
|
+
if (specification.systemPrompt) {
|
1773
|
+
const systemMessage = {
|
1774
|
+
__typename: "ConversationMessage",
|
1775
|
+
role: Types.ConversationRoleTypes.System,
|
1776
|
+
message: specification.systemPrompt,
|
1777
|
+
timestamp: new Date().toISOString(),
|
1778
|
+
};
|
1779
|
+
messages.push(systemMessage);
|
1780
|
+
}
|
1781
|
+
// Get conversation history
|
1782
|
+
const conversationResponse = await this.getConversation(conversationId);
|
1783
|
+
const conversation = conversationResponse.conversation;
|
1784
|
+
if (conversation?.messages && conversation.messages.length > 0) {
|
1785
|
+
// Add previous messages (excluding the current one)
|
1786
|
+
const previousMessages = conversation.messages.slice(0, -1);
|
1787
|
+
messages.push(...previousMessages);
|
1788
|
+
}
|
1789
|
+
// Add current user message
|
1790
|
+
const currentMessage = {
|
1791
|
+
__typename: "ConversationMessage",
|
1792
|
+
role: Types.ConversationRoleTypes.User, // Current prompt is from the user
|
1793
|
+
message: currentPrompt,
|
1794
|
+
timestamp: new Date().toISOString(),
|
1795
|
+
};
|
1796
|
+
messages.push(currentMessage);
|
1797
|
+
return messages;
|
1798
|
+
}
|
1799
|
+
/**
|
1800
|
+
* Execute tools during streaming with proper event emission
|
1801
|
+
*/
|
1802
|
+
async executeToolsInStream(toolCalls, toolHandlers, uiAdapter, abortSignal) {
|
1803
|
+
const toolPromises = toolCalls.map(async (toolCall) => {
|
1804
|
+
if (abortSignal?.aborted)
|
1805
|
+
return;
|
1806
|
+
const handler = toolHandlers[toolCall.name];
|
1807
|
+
if (!handler) {
|
1808
|
+
uiAdapter.setToolResult(toolCall.id, null, `No handler for tool: ${toolCall.name}`);
|
1809
|
+
return;
|
1810
|
+
}
|
1811
|
+
try {
|
1812
|
+
const args = toolCall.arguments ? JSON.parse(toolCall.arguments) : {};
|
1813
|
+
const result = await handler(args);
|
1814
|
+
uiAdapter.setToolResult(toolCall.id, result);
|
1815
|
+
}
|
1816
|
+
catch (error) {
|
1817
|
+
const errorMessage = error instanceof Error ? error.message : "Tool execution failed";
|
1818
|
+
uiAdapter.setToolResult(toolCall.id, null, errorMessage);
|
1819
|
+
}
|
1876
1820
|
});
|
1821
|
+
await Promise.all(toolPromises);
|
1822
|
+
}
|
1823
|
+
/**
|
1824
|
+
* Format tool results for API
|
1825
|
+
*/
|
1826
|
+
async formatToolResults(toolCalls, toolHandlers) {
|
1827
|
+
const results = [];
|
1828
|
+
for (const toolCall of toolCalls) {
|
1829
|
+
const handler = toolHandlers[toolCall.name];
|
1830
|
+
if (handler) {
|
1831
|
+
try {
|
1832
|
+
const args = toolCall.arguments ? JSON.parse(toolCall.arguments) : {};
|
1833
|
+
const result = await handler(args);
|
1834
|
+
results.push({
|
1835
|
+
id: toolCall.id,
|
1836
|
+
content: JSON.stringify(result),
|
1837
|
+
});
|
1838
|
+
}
|
1839
|
+
catch (error) {
|
1840
|
+
results.push({
|
1841
|
+
id: toolCall.id,
|
1842
|
+
content: JSON.stringify({
|
1843
|
+
error: error instanceof Error
|
1844
|
+
? error.message
|
1845
|
+
: "Tool execution failed",
|
1846
|
+
}),
|
1847
|
+
});
|
1848
|
+
}
|
1849
|
+
}
|
1850
|
+
}
|
1851
|
+
return results;
|
1852
|
+
}
|
1853
|
+
/**
|
1854
|
+
* Fallback to non-streaming when streaming is not available
|
1855
|
+
*/
|
1856
|
+
async fallbackToNonStreaming(prompt, conversationId, specification, tools, mimeType, data, uiAdapter, correlationId) {
|
1857
|
+
const response = await this.promptConversation(prompt, conversationId, { id: specification.id }, mimeType, data, tools, false, false, correlationId);
|
1858
|
+
const message = response.promptConversation?.message;
|
1859
|
+
if (message?.message) {
|
1860
|
+
// Simulate streaming by emitting tokens
|
1861
|
+
const words = message.message.split(" ");
|
1862
|
+
for (let i = 0; i < words.length; i++) {
|
1863
|
+
const token = i === 0 ? words[i] : " " + words[i];
|
1864
|
+
uiAdapter.handleEvent({ type: "token", token });
|
1865
|
+
}
|
1866
|
+
uiAdapter.handleEvent({ type: "message", message: message.message });
|
1867
|
+
}
|
1877
1868
|
}
|
1878
|
-
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
|
1898
|
-
|
1899
|
-
|
1900
|
-
|
1901
|
-
|
1869
|
+
/**
|
1870
|
+
* Stream with OpenAI client
|
1871
|
+
*/
|
1872
|
+
async streamWithOpenAI(specification, messages, tools, uiAdapter, onComplete) {
|
1873
|
+
if (!OpenAI) {
|
1874
|
+
throw new Error("OpenAI client not available");
|
1875
|
+
}
|
1876
|
+
// Use provided client or create a new one
|
1877
|
+
const openaiClient = this.openaiClient ||
|
1878
|
+
new OpenAI({
|
1879
|
+
apiKey: process.env.OPENAI_API_KEY || "",
|
1880
|
+
});
|
1881
|
+
await streamWithOpenAI(specification, messages, tools, openaiClient, (event) => uiAdapter.handleEvent(event), onComplete);
|
1882
|
+
}
|
1883
|
+
/**
|
1884
|
+
* Stream with Anthropic client
|
1885
|
+
*/
|
1886
|
+
async streamWithAnthropic(specification, messages, systemPrompt, tools, uiAdapter, onComplete) {
|
1887
|
+
if (!Anthropic) {
|
1888
|
+
throw new Error("Anthropic client not available");
|
1889
|
+
}
|
1890
|
+
// Use provided client or create a new one
|
1891
|
+
const anthropicClient = this.anthropicClient ||
|
1892
|
+
new Anthropic({
|
1893
|
+
apiKey: process.env.ANTHROPIC_API_KEY || "",
|
1894
|
+
});
|
1895
|
+
await streamWithAnthropic(specification, messages, systemPrompt, tools, anthropicClient, (event) => uiAdapter.handleEvent(event), onComplete);
|
1896
|
+
}
|
1897
|
+
/**
|
1898
|
+
* Stream with Google client
|
1899
|
+
*/
|
1900
|
+
async streamWithGoogle(specification, messages, systemPrompt, tools, uiAdapter, onComplete) {
|
1901
|
+
if (!GoogleGenerativeAI) {
|
1902
|
+
throw new Error("Google GenerativeAI client not available");
|
1903
|
+
}
|
1904
|
+
// Use provided client or create a new one
|
1905
|
+
const googleClient = this.googleClient ||
|
1906
|
+
new GoogleGenerativeAI(process.env.GOOGLE_API_KEY || "");
|
1907
|
+
await streamWithGoogle(specification, messages, systemPrompt, tools, googleClient, (event) => uiAdapter.handleEvent(event), onComplete);
|
1908
|
+
}
|
1909
|
+
// Helper method to execute tools for promptAgent
|
1910
|
+
async executeToolsForPromptAgent(toolCalls, toolHandlers, allToolCalls, signal) {
|
1911
|
+
const responses = [];
|
1912
|
+
// Execute tools in parallel for better performance
|
1913
|
+
const toolPromises = toolCalls.map(async (toolCall) => {
|
1914
|
+
if (!toolCall || signal.aborted)
|
1915
|
+
return null;
|
1916
|
+
const startTime = Date.now();
|
1917
|
+
const handler = toolHandlers[toolCall.name || ""];
|
1918
|
+
let result;
|
1919
|
+
let error;
|
1920
|
+
try {
|
1921
|
+
if (!handler) {
|
1922
|
+
throw new Error(`No handler found for tool: ${toolCall.name}`);
|
1923
|
+
}
|
1924
|
+
const args = toolCall.arguments ? JSON.parse(toolCall.arguments) : {};
|
1925
|
+
// Add timeout for individual tool calls (30 seconds)
|
1926
|
+
const toolTimeout = new Promise((_, reject) => setTimeout(() => reject(new Error("Tool execution timeout")), 30000));
|
1927
|
+
result = await Promise.race([handler(args), toolTimeout]);
|
1928
|
+
}
|
1929
|
+
catch (e) {
|
1930
|
+
error = e.message || "Tool execution failed";
|
1931
|
+
console.error(`Tool ${toolCall.name} failed:`, e);
|
1932
|
+
}
|
1933
|
+
// Record for result
|
1934
|
+
const toolResult = {
|
1935
|
+
id: toolCall.id,
|
1936
|
+
name: toolCall.name || "",
|
1937
|
+
arguments: toolCall.arguments ? JSON.parse(toolCall.arguments) : {},
|
1938
|
+
result,
|
1939
|
+
error,
|
1940
|
+
duration: Date.now() - startTime,
|
1941
|
+
};
|
1942
|
+
allToolCalls.push(toolResult);
|
1943
|
+
// Response for API
|
1944
|
+
return {
|
1945
|
+
id: toolCall.id,
|
1946
|
+
content: error ? error : result ? JSON.stringify(result) : "",
|
1947
|
+
};
|
1948
|
+
});
|
1949
|
+
const results = await Promise.all(toolPromises);
|
1950
|
+
return results.filter((r) => r !== null);
|
1902
1951
|
}
|
1903
1952
|
// helper functions
|
1904
1953
|
prettyPrintGraphQLError(err) {
|
@@ -1917,82 +1966,80 @@ class Graphlit {
|
|
1917
1966
|
}
|
1918
1967
|
return parts.join(" ");
|
1919
1968
|
}
|
1920
|
-
mutateAndCheckError(mutation, variables) {
|
1921
|
-
|
1922
|
-
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1933
|
-
throw new Error(errorMessage);
|
1934
|
-
}
|
1935
|
-
if (!result.data) {
|
1936
|
-
throw new Error("No data returned from mutation.");
|
1937
|
-
}
|
1938
|
-
return result.data;
|
1969
|
+
async mutateAndCheckError(mutation, variables) {
|
1970
|
+
if (this.client === undefined)
|
1971
|
+
throw new Error("Apollo Client not configured.");
|
1972
|
+
try {
|
1973
|
+
const result = await this.client.mutate({
|
1974
|
+
mutation,
|
1975
|
+
variables: variables || {},
|
1976
|
+
});
|
1977
|
+
if (result.errors) {
|
1978
|
+
const errorMessage = result.errors
|
1979
|
+
.map((err) => this.prettyPrintGraphQLError(err))
|
1980
|
+
.join("\n");
|
1981
|
+
throw new Error(errorMessage);
|
1939
1982
|
}
|
1940
|
-
|
1941
|
-
|
1942
|
-
const errorMessage = error.graphQLErrors
|
1943
|
-
.map((err) => this.prettyPrintGraphQLError(err))
|
1944
|
-
.join("\n");
|
1945
|
-
console.error(errorMessage);
|
1946
|
-
throw new Error(errorMessage);
|
1947
|
-
}
|
1948
|
-
if (error instanceof Error) {
|
1949
|
-
console.error(error.message);
|
1950
|
-
throw error;
|
1951
|
-
}
|
1952
|
-
else {
|
1953
|
-
throw error;
|
1954
|
-
}
|
1983
|
+
if (!result.data) {
|
1984
|
+
throw new Error("No data returned from mutation.");
|
1955
1985
|
}
|
1956
|
-
|
1986
|
+
return result.data;
|
1987
|
+
}
|
1988
|
+
catch (error) {
|
1989
|
+
if (error instanceof ApolloError && error.graphQLErrors.length > 0) {
|
1990
|
+
const errorMessage = error.graphQLErrors
|
1991
|
+
.map((err) => this.prettyPrintGraphQLError(err))
|
1992
|
+
.join("\n");
|
1993
|
+
console.error(errorMessage);
|
1994
|
+
throw new Error(errorMessage);
|
1995
|
+
}
|
1996
|
+
if (error instanceof Error) {
|
1997
|
+
console.error(error.message);
|
1998
|
+
throw error;
|
1999
|
+
}
|
2000
|
+
else {
|
2001
|
+
throw error;
|
2002
|
+
}
|
2003
|
+
}
|
1957
2004
|
}
|
1958
|
-
queryAndCheckError(query, variables) {
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
1966
|
-
|
1967
|
-
|
1968
|
-
|
1969
|
-
|
1970
|
-
|
1971
|
-
throw new Error(errorMessage);
|
1972
|
-
}
|
1973
|
-
if (!result.data) {
|
1974
|
-
throw new Error("No data returned from query.");
|
1975
|
-
}
|
1976
|
-
return result.data;
|
2005
|
+
async queryAndCheckError(query, variables) {
|
2006
|
+
if (this.client === undefined)
|
2007
|
+
throw new Error("Apollo Client not configured.");
|
2008
|
+
try {
|
2009
|
+
const result = await this.client.query({
|
2010
|
+
query,
|
2011
|
+
variables: variables || {},
|
2012
|
+
});
|
2013
|
+
if (result.errors) {
|
2014
|
+
const errorMessage = result.errors
|
2015
|
+
.map((err) => this.prettyPrintGraphQLError(err))
|
2016
|
+
.join("\n");
|
2017
|
+
throw new Error(errorMessage);
|
1977
2018
|
}
|
1978
|
-
|
1979
|
-
|
1980
|
-
const errorMessage = error.graphQLErrors
|
1981
|
-
.map((err) => this.prettyPrintGraphQLError(err))
|
1982
|
-
.join("\n");
|
1983
|
-
console.error(errorMessage);
|
1984
|
-
throw new Error(errorMessage);
|
1985
|
-
}
|
1986
|
-
if (error instanceof Error) {
|
1987
|
-
console.error(error.message);
|
1988
|
-
throw error;
|
1989
|
-
}
|
1990
|
-
else {
|
1991
|
-
throw error;
|
1992
|
-
}
|
2019
|
+
if (!result.data) {
|
2020
|
+
throw new Error("No data returned from query.");
|
1993
2021
|
}
|
1994
|
-
|
2022
|
+
return result.data;
|
2023
|
+
}
|
2024
|
+
catch (error) {
|
2025
|
+
if (error instanceof ApolloError && error.graphQLErrors.length > 0) {
|
2026
|
+
const errorMessage = error.graphQLErrors
|
2027
|
+
.map((err) => this.prettyPrintGraphQLError(err))
|
2028
|
+
.join("\n");
|
2029
|
+
console.error(errorMessage);
|
2030
|
+
throw new Error(errorMessage);
|
2031
|
+
}
|
2032
|
+
if (error instanceof Error) {
|
2033
|
+
console.error(error.message);
|
2034
|
+
throw error;
|
2035
|
+
}
|
2036
|
+
else {
|
2037
|
+
throw error;
|
2038
|
+
}
|
2039
|
+
}
|
1995
2040
|
}
|
1996
2041
|
}
|
1997
|
-
|
1998
|
-
|
2042
|
+
export { Graphlit };
|
2043
|
+
export * as Types from "./generated/graphql-types.js";
|
2044
|
+
// Export streaming helpers
|
2045
|
+
export { StreamEventAggregator, formatSSEEvent, createSSEStream, wrapToolHandlers, enhanceToolCalls, ConversationMetrics, } from "./stream-helpers.js";
|