@epam/ai-dial-chat-api-client 1.3.0-dev.252 → 1.3.0-dev.256
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/generated/src/apis/AuthApi.d.ts +10 -0
- package/generated/src/apis/AuthApi.d.ts.map +1 -1
- package/generated/src/apis/AuthApi.js +24 -0
- package/generated/src/apis/ProjectsApi.d.ts +128 -5
- package/generated/src/apis/ProjectsApi.d.ts.map +1 -1
- package/generated/src/apis/ProjectsApi.js +373 -4
- package/generated/src/models/index.d.ts +76 -1
- package/generated/src/models/index.d.ts.map +1 -1
- package/generated/src/models/index.js +1 -0
- package/package.json +1 -1
- package/tsconfig.lib.tsbuildinfo +1 -1
|
@@ -19,6 +19,51 @@ const runtime = require("../runtime");
|
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
class ProjectsApi extends runtime.BaseAPI {
|
|
22
|
+
/**
|
|
23
|
+
* Replays the active generation of a project conversation as SSE, exactly as `POST /api/v1/conversations/completions/attach` does.
|
|
24
|
+
* Attach to a generation of a project conversation
|
|
25
|
+
*/
|
|
26
|
+
async attachToProjectGenerationRaw(requestParameters, initOverrides) {
|
|
27
|
+
if (requestParameters['id'] == null) {
|
|
28
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling attachToProjectGeneration().');
|
|
29
|
+
}
|
|
30
|
+
if (requestParameters['attachGenerationDto'] == null) {
|
|
31
|
+
throw new runtime.RequiredError('attachGenerationDto', 'Required parameter "attachGenerationDto" was null or undefined when calling attachToProjectGeneration().');
|
|
32
|
+
}
|
|
33
|
+
const queryParameters = {};
|
|
34
|
+
const headerParameters = {};
|
|
35
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
36
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
37
|
+
const token = this.configuration.accessToken;
|
|
38
|
+
const tokenString = await token('bearer', []);
|
|
39
|
+
if (tokenString) {
|
|
40
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
let urlPath = `/api/v1/projects/{id}/conversations/completions/attach`;
|
|
44
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
45
|
+
const response = await this.request({
|
|
46
|
+
path: urlPath,
|
|
47
|
+
method: 'POST',
|
|
48
|
+
headers: headerParameters,
|
|
49
|
+
query: queryParameters,
|
|
50
|
+
body: requestParameters['attachGenerationDto'],
|
|
51
|
+
}, initOverrides);
|
|
52
|
+
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
53
|
+
return new runtime.JSONApiResponse(response);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return new runtime.TextApiResponse(response);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Replays the active generation of a project conversation as SSE, exactly as `POST /api/v1/conversations/completions/attach` does.
|
|
61
|
+
* Attach to a generation of a project conversation
|
|
62
|
+
*/
|
|
63
|
+
async attachToProjectGeneration(requestParameters, initOverrides) {
|
|
64
|
+
const response = await this.attachToProjectGenerationRaw(requestParameters, initOverrides);
|
|
65
|
+
return await response.value();
|
|
66
|
+
}
|
|
22
67
|
/**
|
|
23
68
|
* Creates a project at the root of the session user\'s bucket in one atomic, create-only DIAL Core call. The BFF writes PROJECT.md (YAML frontmatter with name and description, instructions as the body) and each context file under context/. Name, file names, types, per-file size, total size and file count are validated first; every domain rejection carries a ProjectCreateErrorCode.
|
|
24
69
|
* Create a project
|
|
@@ -87,7 +132,47 @@ class ProjectsApi extends runtime.BaseAPI {
|
|
|
87
132
|
return await response.value();
|
|
88
133
|
}
|
|
89
134
|
/**
|
|
90
|
-
*
|
|
135
|
+
* Creates a conversation inside the project from its first message, as `POST /api/v1/conversations` does at the top level.
|
|
136
|
+
* Create a project conversation
|
|
137
|
+
*/
|
|
138
|
+
async createProjectConversationRaw(requestParameters, initOverrides) {
|
|
139
|
+
if (requestParameters['id'] == null) {
|
|
140
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling createProjectConversation().');
|
|
141
|
+
}
|
|
142
|
+
if (requestParameters['createConversationDto'] == null) {
|
|
143
|
+
throw new runtime.RequiredError('createConversationDto', 'Required parameter "createConversationDto" was null or undefined when calling createProjectConversation().');
|
|
144
|
+
}
|
|
145
|
+
const queryParameters = {};
|
|
146
|
+
const headerParameters = {};
|
|
147
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
148
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
149
|
+
const token = this.configuration.accessToken;
|
|
150
|
+
const tokenString = await token('bearer', []);
|
|
151
|
+
if (tokenString) {
|
|
152
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
let urlPath = `/api/v1/projects/{id}/conversations`;
|
|
156
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
157
|
+
const response = await this.request({
|
|
158
|
+
path: urlPath,
|
|
159
|
+
method: 'POST',
|
|
160
|
+
headers: headerParameters,
|
|
161
|
+
query: queryParameters,
|
|
162
|
+
body: requestParameters['createConversationDto'],
|
|
163
|
+
}, initOverrides);
|
|
164
|
+
return new runtime.JSONApiResponse(response);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Creates a conversation inside the project from its first message, as `POST /api/v1/conversations` does at the top level.
|
|
168
|
+
* Create a project conversation
|
|
169
|
+
*/
|
|
170
|
+
async createProjectConversation(requestParameters, initOverrides) {
|
|
171
|
+
const response = await this.createProjectConversationRaw(requestParameters, initOverrides);
|
|
172
|
+
return await response.value();
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Deletes the project, its conversations included, only if its content is still the `contentVersion` named by `If-Match`, then removes it from the caller\'s pins. Only a project in the caller\'s own bucket can be deleted.
|
|
91
176
|
* Delete a project
|
|
92
177
|
*/
|
|
93
178
|
async deleteProjectRaw(requestParameters, initOverrides) {
|
|
@@ -120,12 +205,48 @@ class ProjectsApi extends runtime.BaseAPI {
|
|
|
120
205
|
return new runtime.VoidApiResponse(response);
|
|
121
206
|
}
|
|
122
207
|
/**
|
|
123
|
-
* Deletes the project only if
|
|
208
|
+
* Deletes the project, its conversations included, only if its content is still the `contentVersion` named by `If-Match`, then removes it from the caller\'s pins. Only a project in the caller\'s own bucket can be deleted.
|
|
124
209
|
* Delete a project
|
|
125
210
|
*/
|
|
126
211
|
async deleteProject(requestParameters, initOverrides) {
|
|
127
212
|
await this.deleteProjectRaw(requestParameters, initOverrides);
|
|
128
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* Delete a project conversation
|
|
216
|
+
*/
|
|
217
|
+
async deleteProjectConversationRaw(requestParameters, initOverrides) {
|
|
218
|
+
if (requestParameters['id'] == null) {
|
|
219
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteProjectConversation().');
|
|
220
|
+
}
|
|
221
|
+
if (requestParameters['conversationName'] == null) {
|
|
222
|
+
throw new runtime.RequiredError('conversationName', 'Required parameter "conversationName" was null or undefined when calling deleteProjectConversation().');
|
|
223
|
+
}
|
|
224
|
+
const queryParameters = {};
|
|
225
|
+
const headerParameters = {};
|
|
226
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
227
|
+
const token = this.configuration.accessToken;
|
|
228
|
+
const tokenString = await token('bearer', []);
|
|
229
|
+
if (tokenString) {
|
|
230
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
let urlPath = `/api/v1/projects/{id}/conversations/{conversationName}`;
|
|
234
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
235
|
+
urlPath = urlPath.replace(`{${'conversationName'}}`, encodeURIComponent(String(requestParameters['conversationName'])));
|
|
236
|
+
const response = await this.request({
|
|
237
|
+
path: urlPath,
|
|
238
|
+
method: 'DELETE',
|
|
239
|
+
headers: headerParameters,
|
|
240
|
+
query: queryParameters,
|
|
241
|
+
}, initOverrides);
|
|
242
|
+
return new runtime.VoidApiResponse(response);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Delete a project conversation
|
|
246
|
+
*/
|
|
247
|
+
async deleteProjectConversation(requestParameters, initOverrides) {
|
|
248
|
+
await this.deleteProjectConversationRaw(requestParameters, initOverrides);
|
|
249
|
+
}
|
|
129
250
|
/**
|
|
130
251
|
* Streams DIAL Core\'s archive of the whole project (`PROJECT.md` and `context/`) as an attachment.
|
|
131
252
|
* Download a project as a ZIP archive
|
|
@@ -235,6 +356,84 @@ class ProjectsApi extends runtime.BaseAPI {
|
|
|
235
356
|
const response = await this.getProjectRaw(requestParameters, initOverrides);
|
|
236
357
|
return await response.value();
|
|
237
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* Get a project conversation
|
|
361
|
+
*/
|
|
362
|
+
async getProjectConversationRaw(requestParameters, initOverrides) {
|
|
363
|
+
if (requestParameters['id'] == null) {
|
|
364
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getProjectConversation().');
|
|
365
|
+
}
|
|
366
|
+
if (requestParameters['conversationName'] == null) {
|
|
367
|
+
throw new runtime.RequiredError('conversationName', 'Required parameter "conversationName" was null or undefined when calling getProjectConversation().');
|
|
368
|
+
}
|
|
369
|
+
const queryParameters = {};
|
|
370
|
+
const headerParameters = {};
|
|
371
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
372
|
+
const token = this.configuration.accessToken;
|
|
373
|
+
const tokenString = await token('bearer', []);
|
|
374
|
+
if (tokenString) {
|
|
375
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
let urlPath = `/api/v1/projects/{id}/conversations/{conversationName}`;
|
|
379
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
380
|
+
urlPath = urlPath.replace(`{${'conversationName'}}`, encodeURIComponent(String(requestParameters['conversationName'])));
|
|
381
|
+
const response = await this.request({
|
|
382
|
+
path: urlPath,
|
|
383
|
+
method: 'GET',
|
|
384
|
+
headers: headerParameters,
|
|
385
|
+
query: queryParameters,
|
|
386
|
+
}, initOverrides);
|
|
387
|
+
return new runtime.JSONApiResponse(response);
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Get a project conversation
|
|
391
|
+
*/
|
|
392
|
+
async getProjectConversation(requestParameters, initOverrides) {
|
|
393
|
+
const response = await this.getProjectConversationRaw(requestParameters, initOverrides);
|
|
394
|
+
return await response.value();
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Lists the conversations stored in the project\'s `conversations/` folder, newest first, with their titles and authors.
|
|
398
|
+
* List a project\'s conversations
|
|
399
|
+
*/
|
|
400
|
+
async listProjectConversationsRaw(requestParameters, initOverrides) {
|
|
401
|
+
if (requestParameters['id'] == null) {
|
|
402
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling listProjectConversations().');
|
|
403
|
+
}
|
|
404
|
+
const queryParameters = {};
|
|
405
|
+
if (requestParameters['limit'] != null) {
|
|
406
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
407
|
+
}
|
|
408
|
+
if (requestParameters['offset'] != null) {
|
|
409
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
410
|
+
}
|
|
411
|
+
const headerParameters = {};
|
|
412
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
413
|
+
const token = this.configuration.accessToken;
|
|
414
|
+
const tokenString = await token('bearer', []);
|
|
415
|
+
if (tokenString) {
|
|
416
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
let urlPath = `/api/v1/projects/{id}/conversations`;
|
|
420
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
421
|
+
const response = await this.request({
|
|
422
|
+
path: urlPath,
|
|
423
|
+
method: 'GET',
|
|
424
|
+
headers: headerParameters,
|
|
425
|
+
query: queryParameters,
|
|
426
|
+
}, initOverrides);
|
|
427
|
+
return new runtime.JSONApiResponse(response);
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Lists the conversations stored in the project\'s `conversations/` folder, newest first, with their titles and authors.
|
|
431
|
+
* List a project\'s conversations
|
|
432
|
+
*/
|
|
433
|
+
async listProjectConversations(requestParameters, initOverrides) {
|
|
434
|
+
const response = await this.listProjectConversationsRaw(requestParameters, initOverrides);
|
|
435
|
+
return await response.value();
|
|
436
|
+
}
|
|
238
437
|
/**
|
|
239
438
|
* Returns every DIAL project visible to the session user: the user\'s own bucket, the public (organization) bucket, and projects shared with the user, merged and de-duplicated by id. The BFF follows DIAL Core paging itself, so the list is complete up to a per-source page cap. A failing source is omitted; the request fails only when both bucket listings fail.
|
|
240
439
|
* List projects
|
|
@@ -267,7 +466,177 @@ class ProjectsApi extends runtime.BaseAPI {
|
|
|
267
466
|
return await response.value();
|
|
268
467
|
}
|
|
269
468
|
/**
|
|
270
|
-
*
|
|
469
|
+
* Rewrites the conversation\'s display name; its file name does not change.
|
|
470
|
+
* Rename a project conversation
|
|
471
|
+
*/
|
|
472
|
+
async renameProjectConversationRaw(requestParameters, initOverrides) {
|
|
473
|
+
if (requestParameters['id'] == null) {
|
|
474
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling renameProjectConversation().');
|
|
475
|
+
}
|
|
476
|
+
if (requestParameters['conversationName'] == null) {
|
|
477
|
+
throw new runtime.RequiredError('conversationName', 'Required parameter "conversationName" was null or undefined when calling renameProjectConversation().');
|
|
478
|
+
}
|
|
479
|
+
if (requestParameters['renameConversationBodyDto'] == null) {
|
|
480
|
+
throw new runtime.RequiredError('renameConversationBodyDto', 'Required parameter "renameConversationBodyDto" was null or undefined when calling renameProjectConversation().');
|
|
481
|
+
}
|
|
482
|
+
const queryParameters = {};
|
|
483
|
+
const headerParameters = {};
|
|
484
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
485
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
486
|
+
const token = this.configuration.accessToken;
|
|
487
|
+
const tokenString = await token('bearer', []);
|
|
488
|
+
if (tokenString) {
|
|
489
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
let urlPath = `/api/v1/projects/{id}/conversations/{conversationName}`;
|
|
493
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
494
|
+
urlPath = urlPath.replace(`{${'conversationName'}}`, encodeURIComponent(String(requestParameters['conversationName'])));
|
|
495
|
+
const response = await this.request({
|
|
496
|
+
path: urlPath,
|
|
497
|
+
method: 'PATCH',
|
|
498
|
+
headers: headerParameters,
|
|
499
|
+
query: queryParameters,
|
|
500
|
+
body: requestParameters['renameConversationBodyDto'],
|
|
501
|
+
}, initOverrides);
|
|
502
|
+
return new runtime.JSONApiResponse(response);
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Rewrites the conversation\'s display name; its file name does not change.
|
|
506
|
+
* Rename a project conversation
|
|
507
|
+
*/
|
|
508
|
+
async renameProjectConversation(requestParameters, initOverrides) {
|
|
509
|
+
const response = await this.renameProjectConversationRaw(requestParameters, initOverrides);
|
|
510
|
+
return await response.value();
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Overwrites the conversation body, never over a pending background answer, as `PUT /api/v1/conversations` does.
|
|
514
|
+
* Save a project conversation
|
|
515
|
+
*/
|
|
516
|
+
async saveProjectConversationRaw(requestParameters, initOverrides) {
|
|
517
|
+
if (requestParameters['id'] == null) {
|
|
518
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling saveProjectConversation().');
|
|
519
|
+
}
|
|
520
|
+
if (requestParameters['conversationName'] == null) {
|
|
521
|
+
throw new runtime.RequiredError('conversationName', 'Required parameter "conversationName" was null or undefined when calling saveProjectConversation().');
|
|
522
|
+
}
|
|
523
|
+
if (requestParameters['saveConversationBodyDto'] == null) {
|
|
524
|
+
throw new runtime.RequiredError('saveConversationBodyDto', 'Required parameter "saveConversationBodyDto" was null or undefined when calling saveProjectConversation().');
|
|
525
|
+
}
|
|
526
|
+
const queryParameters = {};
|
|
527
|
+
const headerParameters = {};
|
|
528
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
529
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
530
|
+
const token = this.configuration.accessToken;
|
|
531
|
+
const tokenString = await token('bearer', []);
|
|
532
|
+
if (tokenString) {
|
|
533
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
let urlPath = `/api/v1/projects/{id}/conversations/{conversationName}`;
|
|
537
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
538
|
+
urlPath = urlPath.replace(`{${'conversationName'}}`, encodeURIComponent(String(requestParameters['conversationName'])));
|
|
539
|
+
const response = await this.request({
|
|
540
|
+
path: urlPath,
|
|
541
|
+
method: 'PUT',
|
|
542
|
+
headers: headerParameters,
|
|
543
|
+
query: queryParameters,
|
|
544
|
+
body: requestParameters['saveConversationBodyDto'],
|
|
545
|
+
}, initOverrides);
|
|
546
|
+
return new runtime.JSONApiResponse(response);
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Overwrites the conversation body, never over a pending background answer, as `PUT /api/v1/conversations` does.
|
|
550
|
+
* Save a project conversation
|
|
551
|
+
*/
|
|
552
|
+
async saveProjectConversation(requestParameters, initOverrides) {
|
|
553
|
+
const response = await this.saveProjectConversationRaw(requestParameters, initOverrides);
|
|
554
|
+
return await response.value();
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Stop a generation of a project conversation
|
|
558
|
+
*/
|
|
559
|
+
async stopProjectCompletionRaw(requestParameters, initOverrides) {
|
|
560
|
+
if (requestParameters['id'] == null) {
|
|
561
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling stopProjectCompletion().');
|
|
562
|
+
}
|
|
563
|
+
if (requestParameters['stopCompletionDto'] == null) {
|
|
564
|
+
throw new runtime.RequiredError('stopCompletionDto', 'Required parameter "stopCompletionDto" was null or undefined when calling stopProjectCompletion().');
|
|
565
|
+
}
|
|
566
|
+
const queryParameters = {};
|
|
567
|
+
const headerParameters = {};
|
|
568
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
569
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
570
|
+
const token = this.configuration.accessToken;
|
|
571
|
+
const tokenString = await token('bearer', []);
|
|
572
|
+
if (tokenString) {
|
|
573
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
let urlPath = `/api/v1/projects/{id}/conversations/completions/stop`;
|
|
577
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
578
|
+
const response = await this.request({
|
|
579
|
+
path: urlPath,
|
|
580
|
+
method: 'POST',
|
|
581
|
+
headers: headerParameters,
|
|
582
|
+
query: queryParameters,
|
|
583
|
+
body: requestParameters['stopCompletionDto'],
|
|
584
|
+
}, initOverrides);
|
|
585
|
+
return new runtime.VoidApiResponse(response);
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Stop a generation of a project conversation
|
|
589
|
+
*/
|
|
590
|
+
async stopProjectCompletion(requestParameters, initOverrides) {
|
|
591
|
+
await this.stopProjectCompletionRaw(requestParameters, initOverrides);
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Streams a completion as SSE exactly as `POST /api/v1/conversations/completions` does, with the `x-project-id` header on the model call and nothing else added to the request.
|
|
595
|
+
* Stream a completion of a project conversation
|
|
596
|
+
*/
|
|
597
|
+
async streamProjectCompletionRaw(requestParameters, initOverrides) {
|
|
598
|
+
if (requestParameters['id'] == null) {
|
|
599
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling streamProjectCompletion().');
|
|
600
|
+
}
|
|
601
|
+
if (requestParameters['sendCompletionDto'] == null) {
|
|
602
|
+
throw new runtime.RequiredError('sendCompletionDto', 'Required parameter "sendCompletionDto" was null or undefined when calling streamProjectCompletion().');
|
|
603
|
+
}
|
|
604
|
+
const queryParameters = {};
|
|
605
|
+
const headerParameters = {};
|
|
606
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
607
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
608
|
+
const token = this.configuration.accessToken;
|
|
609
|
+
const tokenString = await token('bearer', []);
|
|
610
|
+
if (tokenString) {
|
|
611
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
let urlPath = `/api/v1/projects/{id}/conversations/completions`;
|
|
615
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
616
|
+
const response = await this.request({
|
|
617
|
+
path: urlPath,
|
|
618
|
+
method: 'POST',
|
|
619
|
+
headers: headerParameters,
|
|
620
|
+
query: queryParameters,
|
|
621
|
+
body: requestParameters['sendCompletionDto'],
|
|
622
|
+
}, initOverrides);
|
|
623
|
+
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
624
|
+
return new runtime.JSONApiResponse(response);
|
|
625
|
+
}
|
|
626
|
+
else {
|
|
627
|
+
return new runtime.TextApiResponse(response);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Streams a completion as SSE exactly as `POST /api/v1/conversations/completions` does, with the `x-project-id` header on the model call and nothing else added to the request.
|
|
632
|
+
* Stream a completion of a project conversation
|
|
633
|
+
*/
|
|
634
|
+
async streamProjectCompletion(requestParameters, initOverrides) {
|
|
635
|
+
const response = await this.streamProjectCompletionRaw(requestParameters, initOverrides);
|
|
636
|
+
return await response.value();
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Saves the name, description, instructions and context of a project in one conditional DIAL Core write: the BFF rebuilds PROJECT.md, keeps every stored context file not listed in `removedFileNames`, adds the `files` parts, carries the stored conversations over, and writes the whole project conditioned on the fresh snapshot\'s ETag, retrying a concurrent conversation write while `If-Match` still names the `contentVersion`. A different name then moves the project in its folder and keeps the caller\'s pin. Only a project in the caller\'s own bucket can be saved. Every domain rejection carries a ProjectCreateErrorCode.
|
|
271
640
|
* Save a project edit
|
|
272
641
|
*/
|
|
273
642
|
async updateProjectRaw(requestParameters, initOverrides) {
|
|
@@ -339,7 +708,7 @@ class ProjectsApi extends runtime.BaseAPI {
|
|
|
339
708
|
return new runtime.JSONApiResponse(response);
|
|
340
709
|
}
|
|
341
710
|
/**
|
|
342
|
-
* Saves the name, description, instructions and context of a project in one conditional DIAL Core write: the BFF rebuilds PROJECT.md, keeps every stored context file not listed in `removedFileNames`, adds the `files` parts and writes the whole project
|
|
711
|
+
* Saves the name, description, instructions and context of a project in one conditional DIAL Core write: the BFF rebuilds PROJECT.md, keeps every stored context file not listed in `removedFileNames`, adds the `files` parts, carries the stored conversations over, and writes the whole project conditioned on the fresh snapshot\'s ETag, retrying a concurrent conversation write while `If-Match` still names the `contentVersion`. A different name then moves the project in its folder and keeps the caller\'s pin. Only a project in the caller\'s own bucket can be saved. Every domain rejection carries a ProjectCreateErrorCode.
|
|
343
712
|
* Save a project edit
|
|
344
713
|
*/
|
|
345
714
|
async updateProject(requestParameters, initOverrides) {
|
|
@@ -5930,6 +5930,62 @@ export interface ProjectContextFileDto {
|
|
|
5930
5930
|
*/
|
|
5931
5931
|
size: number;
|
|
5932
5932
|
}
|
|
5933
|
+
/**
|
|
5934
|
+
*
|
|
5935
|
+
* @export
|
|
5936
|
+
* @interface ProjectConversationItemDto
|
|
5937
|
+
*/
|
|
5938
|
+
export interface ProjectConversationItemDto {
|
|
5939
|
+
/**
|
|
5940
|
+
* Locator of the conversation, `projects/{bucket}/{projectPath}/conversations/{name}`; it is the conversation id.
|
|
5941
|
+
* @type {string}
|
|
5942
|
+
* @memberof ProjectConversationItemDto
|
|
5943
|
+
*/
|
|
5944
|
+
id: string;
|
|
5945
|
+
/**
|
|
5946
|
+
* File name under the project `conversations/` folder.
|
|
5947
|
+
* @type {string}
|
|
5948
|
+
* @memberof ProjectConversationItemDto
|
|
5949
|
+
*/
|
|
5950
|
+
name: string;
|
|
5951
|
+
/**
|
|
5952
|
+
* Display title: the stored body's `name`, or the title derived from the file name when the body cannot be read.
|
|
5953
|
+
* @type {string}
|
|
5954
|
+
* @memberof ProjectConversationItemDto
|
|
5955
|
+
*/
|
|
5956
|
+
title: string;
|
|
5957
|
+
/**
|
|
5958
|
+
* Display name of the conversation's last writer, from DIAL Core.
|
|
5959
|
+
* @type {string}
|
|
5960
|
+
* @memberof ProjectConversationItemDto
|
|
5961
|
+
*/
|
|
5962
|
+
author?: string;
|
|
5963
|
+
/**
|
|
5964
|
+
* Last update time, in epoch milliseconds.
|
|
5965
|
+
* @type {number}
|
|
5966
|
+
* @memberof ProjectConversationItemDto
|
|
5967
|
+
*/
|
|
5968
|
+
updatedAt?: number;
|
|
5969
|
+
}
|
|
5970
|
+
/**
|
|
5971
|
+
*
|
|
5972
|
+
* @export
|
|
5973
|
+
* @interface ProjectConversationListResponseDto
|
|
5974
|
+
*/
|
|
5975
|
+
export interface ProjectConversationListResponseDto {
|
|
5976
|
+
/**
|
|
5977
|
+
* Conversations, newest first.
|
|
5978
|
+
* @type {Array<ProjectConversationItemDto>}
|
|
5979
|
+
* @memberof ProjectConversationListResponseDto
|
|
5980
|
+
*/
|
|
5981
|
+
items: Array<ProjectConversationItemDto>;
|
|
5982
|
+
/**
|
|
5983
|
+
* Whether the project holds more conversations than `items`.
|
|
5984
|
+
* @type {boolean}
|
|
5985
|
+
* @memberof ProjectConversationListResponseDto
|
|
5986
|
+
*/
|
|
5987
|
+
hasMore: boolean;
|
|
5988
|
+
}
|
|
5933
5989
|
/**
|
|
5934
5990
|
*
|
|
5935
5991
|
* @export
|
|
@@ -5947,6 +6003,7 @@ export declare const ProjectCreateErrorCode: {
|
|
|
5947
6003
|
readonly IfMatchRequired: "if-match-required";
|
|
5948
6004
|
readonly ProjectTooLarge: "project-too-large";
|
|
5949
6005
|
readonly UnknownFile: "unknown-file";
|
|
6006
|
+
readonly ProjectStorageFull: "project-storage-full";
|
|
5950
6007
|
};
|
|
5951
6008
|
export type ProjectCreateErrorCode = (typeof ProjectCreateErrorCode)[keyof typeof ProjectCreateErrorCode];
|
|
5952
6009
|
/**
|
|
@@ -6065,11 +6122,23 @@ export interface ProjectDetailsDto {
|
|
|
6065
6122
|
*/
|
|
6066
6123
|
contextFiles: Array<ProjectContextFileDto>;
|
|
6067
6124
|
/**
|
|
6068
|
-
* Aggregate ETag of the version these details were read from
|
|
6125
|
+
* Aggregate ETag of the version these details were read from. It changes on every write, project conversation writes included.
|
|
6069
6126
|
* @type {string}
|
|
6070
6127
|
* @memberof ProjectDetailsDto
|
|
6071
6128
|
*/
|
|
6072
6129
|
etag: string;
|
|
6130
|
+
/**
|
|
6131
|
+
* Version of the project content (`PROJECT.md`, `context/` and every other non-conversation file). A conversation write leaves it unchanged. Send it as `If-Match` on update and delete.
|
|
6132
|
+
* @type {string}
|
|
6133
|
+
* @memberof ProjectDetailsDto
|
|
6134
|
+
*/
|
|
6135
|
+
contentVersion: string;
|
|
6136
|
+
/**
|
|
6137
|
+
* Number of conversations stored in the project.
|
|
6138
|
+
* @type {number}
|
|
6139
|
+
* @memberof ProjectDetailsDto
|
|
6140
|
+
*/
|
|
6141
|
+
conversationCount: number;
|
|
6073
6142
|
/**
|
|
6074
6143
|
* Whether the caller may edit, delete, share and publish the project — `true` only in the caller's own bucket.
|
|
6075
6144
|
* @type {boolean}
|
|
@@ -9134,6 +9203,12 @@ export interface UserProfileDto {
|
|
|
9134
9203
|
* @memberof UserProfileDto
|
|
9135
9204
|
*/
|
|
9136
9205
|
isAdmin: boolean;
|
|
9206
|
+
/**
|
|
9207
|
+
* URL of the user's profile picture: the IdP's absolute http(s) `picture` claim, or the same-origin `GET /auth/me/picture` path when the IdP supplied the image inline. Omitted when there is no picture.
|
|
9208
|
+
* @type {string}
|
|
9209
|
+
* @memberof UserProfileDto
|
|
9210
|
+
*/
|
|
9211
|
+
pictureUrl?: string;
|
|
9137
9212
|
}
|
|
9138
9213
|
/**
|
|
9139
9214
|
*
|