@breign/client 1.0.181 → 1.0.183

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/apis/AdminApi.d.ts +46 -10
  2. package/dist/apis/AdminApi.js +101 -15
  3. package/dist/apis/EngineApi.d.ts +43 -1
  4. package/dist/apis/EngineApi.js +100 -0
  5. package/dist/models/AiGatewayInternalSettingsSummaryUio.d.ts +7 -0
  6. package/dist/models/AiGatewayInternalSettingsSummaryUio.js +3 -0
  7. package/dist/models/AiGatewayModelTokenQuotaUio.d.ts +1 -1
  8. package/dist/models/AiGatewaySettingsUio.d.ts +7 -0
  9. package/dist/models/AiGatewaySettingsUio.js +3 -0
  10. package/dist/models/AiGatewaySettingsUpdateRequestUio.d.ts +7 -0
  11. package/dist/models/AiGatewaySettingsUpdateRequestUio.js +3 -0
  12. package/dist/models/AiGatewayUserBudgetUio.d.ts +58 -0
  13. package/dist/models/AiGatewayUserBudgetUio.js +67 -0
  14. package/dist/models/ModelDefinitionUio.d.ts +1 -1
  15. package/dist/models/ModelUserAccessUio.d.ts +50 -0
  16. package/dist/models/ModelUserAccessUio.js +62 -0
  17. package/dist/models/OrganisationPlatformEngineUsageModelsInnerUio.d.ts +56 -0
  18. package/dist/models/OrganisationPlatformEngineUsageModelsInnerUio.js +66 -0
  19. package/dist/models/OrganisationPlatformEngineUsageUio.d.ts +7 -0
  20. package/dist/models/OrganisationPlatformEngineUsageUio.js +5 -0
  21. package/dist/models/OrganizationModelAccessUio.d.ts +33 -0
  22. package/dist/models/OrganizationModelAccessUio.js +51 -0
  23. package/dist/models/OrganizationUio.d.ts +0 -6
  24. package/dist/models/OrganizationUio.js +0 -2
  25. package/dist/models/PlatformEngineAccessModelsInnerUio.d.ts +38 -0
  26. package/dist/models/PlatformEngineAccessModelsInnerUio.js +54 -0
  27. package/dist/models/PlatformEngineAccessUio.d.ts +33 -0
  28. package/dist/models/PlatformEngineAccessUio.js +51 -0
  29. package/dist/models/SetModelUserAccessUio.d.ts +44 -0
  30. package/dist/models/SetModelUserAccessUio.js +58 -0
  31. package/dist/models/TokenPriceSuggestionRequestUio.d.ts +39 -0
  32. package/dist/models/TokenPriceSuggestionRequestUio.js +55 -0
  33. package/dist/models/TokenPriceSuggestionUio.d.ts +70 -0
  34. package/dist/models/TokenPriceSuggestionUio.js +72 -0
  35. package/dist/models/index.d.ts +9 -1
  36. package/dist/models/index.js +9 -1
  37. package/dist/openapi.json +482 -59
  38. package/package.json +1 -1
  39. package/dist/models/AllowPlatformEnginesUio.d.ts +0 -32
  40. package/dist/models/AllowPlatformEnginesUio.js +0 -50
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { AiGatewayInternalSettingsSummaryUio, AllowPlatformEnginesUio, BodyWithMessageUio, DeletePlatformEngineResponseUio, ModelUio, OrganisationPlatformEngineUsageUio, PlatformEngineUsageUio, ProviderCreateRequestUio, ProviderUio, ToolPresetCreateRequestUio, ToolPresetDeleteAllResponseUio, ToolPresetImportRequestUio, ToolPresetImportResponseUio, ToolPresetPageUio, ToolPresetUio, ToolPresetUpdateRequestUio } from '../models/index';
13
+ import type { AiGatewayInternalSettingsSummaryUio, BodyWithMessageUio, DeletePlatformEngineResponseUio, ModelUio, OrganisationPlatformEngineUsageUio, OrganizationUio, PlatformEngineAccessUio, PlatformEngineUsageUio, ProviderCreateRequestUio, ProviderUio, TokenPriceSuggestionRequestUio, TokenPriceSuggestionUio, ToolPresetCreateRequestUio, ToolPresetDeleteAllResponseUio, ToolPresetImportRequestUio, ToolPresetImportResponseUio, ToolPresetPageUio, ToolPresetUio, ToolPresetUpdateRequestUio } from '../models/index';
14
14
  export interface CreateAdminToolPresetRequest {
15
15
  toolPresetCreateRequestUio: ToolPresetCreateRequestUio;
16
16
  }
@@ -32,6 +32,9 @@ export interface GetAdminToolPresetsRequest {
32
32
  export interface GetOrganisationPlatformEngineUsageRequest {
33
33
  orgId: string;
34
34
  }
35
+ export interface GetPlatformEngineAccessRequest {
36
+ id: string;
37
+ }
35
38
  export interface GetPlatformEngineUsageRequest {
36
39
  id: string;
37
40
  }
@@ -41,9 +44,12 @@ export interface ImportAdminToolPresetsRequest {
41
44
  export interface ListPlatformEngineAvailableModelsRequest {
42
45
  id: string;
43
46
  }
44
- export interface SetOrganisationAllowPlatformEnginesRequest {
45
- orgId: string;
46
- allowPlatformEnginesUio: AllowPlatformEnginesUio;
47
+ export interface SetPlatformEngineAccessRequest {
48
+ id: string;
49
+ platformEngineAccessUio: PlatformEngineAccessUio;
50
+ }
51
+ export interface SuggestPlatformTokenPricesRequest {
52
+ tokenPriceSuggestionRequestUio: TokenPriceSuggestionRequestUio;
47
53
  }
48
54
  export interface UpdateAdminToolPresetRequest {
49
55
  toolPresetId: string;
@@ -131,6 +137,16 @@ export declare class AdminApi extends runtime.BaseAPI {
131
137
  * Get organisation platform engine usage
132
138
  */
133
139
  getOrganisationPlatformEngineUsage(orgId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrganisationPlatformEngineUsageUio>;
140
+ /**
141
+ * Superadmin. Organisations qui ont accès à chaque modèle du moteur plateforme.
142
+ * Get platform engine access
143
+ */
144
+ getPlatformEngineAccessRaw(requestParameters: GetPlatformEngineAccessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PlatformEngineAccessUio>>;
145
+ /**
146
+ * Superadmin. Organisations qui ont accès à chaque modèle du moteur plateforme.
147
+ * Get platform engine access
148
+ */
149
+ getPlatformEngineAccess(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PlatformEngineAccessUio>;
134
150
  /**
135
151
  * Superadmin. Ce qui casse si l\'on supprime ce moteur ou l\'un de ses modèles.
136
152
  * Get platform engine usage
@@ -151,6 +167,16 @@ export declare class AdminApi extends runtime.BaseAPI {
151
167
  * Import tool presets
152
168
  */
153
169
  importAdminToolPresets(toolPresetImportRequestUio: ToolPresetImportRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ToolPresetImportResponseUio>;
170
+ /**
171
+ * Superadmin. Toutes les organisations de la plateforme, avec leurs membres.
172
+ * List all organisations
173
+ */
174
+ listAdminOrganisationsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<OrganizationUio>>>;
175
+ /**
176
+ * Superadmin. Toutes les organisations de la plateforme, avec leurs membres.
177
+ * List all organisations
178
+ */
179
+ listAdminOrganisations(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<OrganizationUio>>;
154
180
  /**
155
181
  * Superadmin. Plafonds des modèles Breign de toutes les organisations, en une requête ; une organisation absente n\'en a aucun. `maxQuotaRatio` est l\'usage du quota le plus entamé sur sa période en cours (null sans quota).
156
182
  * List Breign model limit settings of every organisation
@@ -182,15 +208,25 @@ export declare class AdminApi extends runtime.BaseAPI {
182
208
  */
183
209
  listPlatformEngines(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProviderUio>>;
184
210
  /**
185
- * Superadmin. Ouvre ou retire à l\'organisation l\'accès aux moteurs plateforme.
186
- * Allow or forbid platform engines for an organisation
211
+ * Superadmin. Remplace, pour chaque modèle listé, les organisations qui y ont accès. Les modèles absents du corps gardent leurs organisations.
212
+ * Set platform engine access
213
+ */
214
+ setPlatformEngineAccessRaw(requestParameters: SetPlatformEngineAccessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PlatformEngineAccessUio>>;
215
+ /**
216
+ * Superadmin. Remplace, pour chaque modèle listé, les organisations qui y ont accès. Les modèles absents du corps gardent leurs organisations.
217
+ * Set platform engine access
218
+ */
219
+ setPlatformEngineAccess(id: string, platformEngineAccessUio: PlatformEngineAccessUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PlatformEngineAccessUio>;
220
+ /**
221
+ * Superadmin. Prix au million de tokens proposés pour des modèles : tarifs Breign déjà enregistrés, sinon catalogue public (models.dev), dans leur devise d\'origine.
222
+ * Suggest token prices for platform engine models
187
223
  */
188
- setOrganisationAllowPlatformEnginesRaw(requestParameters: SetOrganisationAllowPlatformEnginesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AllowPlatformEnginesUio>>;
224
+ suggestPlatformTokenPricesRaw(requestParameters: SuggestPlatformTokenPricesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TokenPriceSuggestionUio>>>;
189
225
  /**
190
- * Superadmin. Ouvre ou retire à l\'organisation l\'accès aux moteurs plateforme.
191
- * Allow or forbid platform engines for an organisation
226
+ * Superadmin. Prix au million de tokens proposés pour des modèles : tarifs Breign déjà enregistrés, sinon catalogue public (models.dev), dans leur devise d\'origine.
227
+ * Suggest token prices for platform engine models
192
228
  */
193
- setOrganisationAllowPlatformEngines(orgId: string, allowPlatformEnginesUio: AllowPlatformEnginesUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AllowPlatformEnginesUio>;
229
+ suggestPlatformTokenPrices(tokenPriceSuggestionRequestUio: TokenPriceSuggestionRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<TokenPriceSuggestionUio>>;
194
230
  /**
195
231
  * Partial update — only the provided properties are modified
196
232
  * Update a tool preset
@@ -285,6 +285,35 @@ class AdminApi extends runtime.BaseAPI {
285
285
  const response = await this.getOrganisationPlatformEngineUsageRaw({ orgId: orgId }, initOverrides);
286
286
  return await response.value();
287
287
  }
288
+ /**
289
+ * Superadmin. Organisations qui ont accès à chaque modèle du moteur plateforme.
290
+ * Get platform engine access
291
+ */
292
+ async getPlatformEngineAccessRaw(requestParameters, initOverrides) {
293
+ if (requestParameters['id'] == null) {
294
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getPlatformEngineAccess().');
295
+ }
296
+ const queryParameters = {};
297
+ const headerParameters = {};
298
+ if (this.configuration && this.configuration.apiKey) {
299
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
300
+ }
301
+ const response = await this.request({
302
+ path: `/admin/platform-engines/{id}/access`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
303
+ method: 'GET',
304
+ headers: headerParameters,
305
+ query: queryParameters,
306
+ }, initOverrides);
307
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PlatformEngineAccessUioFromJSON)(jsonValue));
308
+ }
309
+ /**
310
+ * Superadmin. Organisations qui ont accès à chaque modèle du moteur plateforme.
311
+ * Get platform engine access
312
+ */
313
+ async getPlatformEngineAccess(id, initOverrides) {
314
+ const response = await this.getPlatformEngineAccessRaw({ id: id }, initOverrides);
315
+ return await response.value();
316
+ }
288
317
  /**
289
318
  * Superadmin. Ce qui casse si l\'on supprime ce moteur ou l\'un de ses modèles.
290
319
  * Get platform engine usage
@@ -345,6 +374,32 @@ class AdminApi extends runtime.BaseAPI {
345
374
  const response = await this.importAdminToolPresetsRaw({ toolPresetImportRequestUio: toolPresetImportRequestUio }, initOverrides);
346
375
  return await response.value();
347
376
  }
377
+ /**
378
+ * Superadmin. Toutes les organisations de la plateforme, avec leurs membres.
379
+ * List all organisations
380
+ */
381
+ async listAdminOrganisationsRaw(initOverrides) {
382
+ const queryParameters = {};
383
+ const headerParameters = {};
384
+ if (this.configuration && this.configuration.apiKey) {
385
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
386
+ }
387
+ const response = await this.request({
388
+ path: `/admin/organisations`,
389
+ method: 'GET',
390
+ headers: headerParameters,
391
+ query: queryParameters,
392
+ }, initOverrides);
393
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.OrganizationUioFromJSON));
394
+ }
395
+ /**
396
+ * Superadmin. Toutes les organisations de la plateforme, avec leurs membres.
397
+ * List all organisations
398
+ */
399
+ async listAdminOrganisations(initOverrides) {
400
+ const response = await this.listAdminOrganisationsRaw(initOverrides);
401
+ return await response.value();
402
+ }
348
403
  /**
349
404
  * Superadmin. Plafonds des modèles Breign de toutes les organisations, en une requête ; une organisation absente n\'en a aucun. `maxQuotaRatio` est l\'usage du quota le plus entamé sur sa période en cours (null sans quota).
350
405
  * List Breign model limit settings of every organisation
@@ -427,15 +482,15 @@ class AdminApi extends runtime.BaseAPI {
427
482
  return await response.value();
428
483
  }
429
484
  /**
430
- * Superadmin. Ouvre ou retire à l\'organisation l\'accès aux moteurs plateforme.
431
- * Allow or forbid platform engines for an organisation
485
+ * Superadmin. Remplace, pour chaque modèle listé, les organisations qui y ont accès. Les modèles absents du corps gardent leurs organisations.
486
+ * Set platform engine access
432
487
  */
433
- async setOrganisationAllowPlatformEnginesRaw(requestParameters, initOverrides) {
434
- if (requestParameters['orgId'] == null) {
435
- throw new runtime.RequiredError('orgId', 'Required parameter "orgId" was null or undefined when calling setOrganisationAllowPlatformEngines().');
488
+ async setPlatformEngineAccessRaw(requestParameters, initOverrides) {
489
+ if (requestParameters['id'] == null) {
490
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling setPlatformEngineAccess().');
436
491
  }
437
- if (requestParameters['allowPlatformEnginesUio'] == null) {
438
- throw new runtime.RequiredError('allowPlatformEnginesUio', 'Required parameter "allowPlatformEnginesUio" was null or undefined when calling setOrganisationAllowPlatformEngines().');
492
+ if (requestParameters['platformEngineAccessUio'] == null) {
493
+ throw new runtime.RequiredError('platformEngineAccessUio', 'Required parameter "platformEngineAccessUio" was null or undefined when calling setPlatformEngineAccess().');
439
494
  }
440
495
  const queryParameters = {};
441
496
  const headerParameters = {};
@@ -444,20 +499,51 @@ class AdminApi extends runtime.BaseAPI {
444
499
  headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
445
500
  }
446
501
  const response = await this.request({
447
- path: `/admin/organisations/{orgId}/platform-engines`.replace(`{${"orgId"}}`, encodeURIComponent(String(requestParameters['orgId']))),
448
- method: 'PATCH',
502
+ path: `/admin/platform-engines/{id}/access`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
503
+ method: 'PUT',
504
+ headers: headerParameters,
505
+ query: queryParameters,
506
+ body: (0, index_1.PlatformEngineAccessUioToJSON)(requestParameters['platformEngineAccessUio']),
507
+ }, initOverrides);
508
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PlatformEngineAccessUioFromJSON)(jsonValue));
509
+ }
510
+ /**
511
+ * Superadmin. Remplace, pour chaque modèle listé, les organisations qui y ont accès. Les modèles absents du corps gardent leurs organisations.
512
+ * Set platform engine access
513
+ */
514
+ async setPlatformEngineAccess(id, platformEngineAccessUio, initOverrides) {
515
+ const response = await this.setPlatformEngineAccessRaw({ id: id, platformEngineAccessUio: platformEngineAccessUio }, initOverrides);
516
+ return await response.value();
517
+ }
518
+ /**
519
+ * Superadmin. Prix au million de tokens proposés pour des modèles : tarifs Breign déjà enregistrés, sinon catalogue public (models.dev), dans leur devise d\'origine.
520
+ * Suggest token prices for platform engine models
521
+ */
522
+ async suggestPlatformTokenPricesRaw(requestParameters, initOverrides) {
523
+ if (requestParameters['tokenPriceSuggestionRequestUio'] == null) {
524
+ throw new runtime.RequiredError('tokenPriceSuggestionRequestUio', 'Required parameter "tokenPriceSuggestionRequestUio" was null or undefined when calling suggestPlatformTokenPrices().');
525
+ }
526
+ const queryParameters = {};
527
+ const headerParameters = {};
528
+ headerParameters['Content-Type'] = 'application/json';
529
+ if (this.configuration && this.configuration.apiKey) {
530
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
531
+ }
532
+ const response = await this.request({
533
+ path: `/admin/platform-engines/token-price-suggestions`,
534
+ method: 'POST',
449
535
  headers: headerParameters,
450
536
  query: queryParameters,
451
- body: (0, index_1.AllowPlatformEnginesUioToJSON)(requestParameters['allowPlatformEnginesUio']),
537
+ body: (0, index_1.TokenPriceSuggestionRequestUioToJSON)(requestParameters['tokenPriceSuggestionRequestUio']),
452
538
  }, initOverrides);
453
- return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AllowPlatformEnginesUioFromJSON)(jsonValue));
539
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.TokenPriceSuggestionUioFromJSON));
454
540
  }
455
541
  /**
456
- * Superadmin. Ouvre ou retire à l\'organisation l\'accès aux moteurs plateforme.
457
- * Allow or forbid platform engines for an organisation
542
+ * Superadmin. Prix au million de tokens proposés pour des modèles : tarifs Breign déjà enregistrés, sinon catalogue public (models.dev), dans leur devise d\'origine.
543
+ * Suggest token prices for platform engine models
458
544
  */
459
- async setOrganisationAllowPlatformEngines(orgId, allowPlatformEnginesUio, initOverrides) {
460
- const response = await this.setOrganisationAllowPlatformEnginesRaw({ orgId: orgId, allowPlatformEnginesUio: allowPlatformEnginesUio }, initOverrides);
545
+ async suggestPlatformTokenPrices(tokenPriceSuggestionRequestUio, initOverrides) {
546
+ const response = await this.suggestPlatformTokenPricesRaw({ tokenPriceSuggestionRequestUio: tokenPriceSuggestionRequestUio }, initOverrides);
461
547
  return await response.value();
462
548
  }
463
549
  /**
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { BodyWithMessageUio, DefaultEngineRequestUio, DeleteProvider200ResponseUio, EmbeddingProviderUio, ModelUio, ProviderCreateRequestUio, ProviderUio, ProviderValiationRequestUio } from '../models/index';
13
+ import type { BodyWithMessageUio, DefaultEngineRequestUio, DeleteProvider200ResponseUio, EmbeddingProviderUio, ModelUio, ModelUserAccessUio, OrganizationModelAccessUio, ProviderCreateRequestUio, ProviderUio, ProviderValiationRequestUio, SetModelUserAccessUio, TokenPriceSuggestionRequestUio, TokenPriceSuggestionUio } from '../models/index';
14
14
  export interface CreateProviderRequest {
15
15
  organizationId: string;
16
16
  providerCreateRequestUio: ProviderCreateRequestUio;
@@ -23,12 +23,24 @@ export interface GetEngineProvidersWithEmbeddingRequest {
23
23
  organizationId: string;
24
24
  requiredModelId?: string;
25
25
  }
26
+ export interface GetOrganizationModelAccessRequest {
27
+ organizationId: string;
28
+ }
26
29
  export interface GetProviderRequest {
27
30
  providerId: string;
28
31
  }
29
32
  export interface GetProvidersRequest {
30
33
  organizationId: string;
31
34
  }
35
+ export interface SetModelUserAccessRequest {
36
+ organizationId: string;
37
+ providerId: string;
38
+ setModelUserAccessUio: SetModelUserAccessUio;
39
+ }
40
+ export interface SuggestOrganizationTokenPricesRequest {
41
+ organizationId: string;
42
+ tokenPriceSuggestionRequestUio: TokenPriceSuggestionRequestUio;
43
+ }
32
44
  export interface UpdateDefaultEngineRequest {
33
45
  defaultEngineRequestUio: DefaultEngineRequestUio;
34
46
  }
@@ -76,6 +88,16 @@ export declare class EngineApi extends runtime.BaseAPI {
76
88
  * Get engine providers with embedding support
77
89
  */
78
90
  getEngineProvidersWithEmbedding(organizationId: string, requiredModelId?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<EmbeddingProviderUio>>;
91
+ /**
92
+ * Admin de l\'organisation. Modèles réservés à certains membres.
93
+ * List model user restrictions of an organization
94
+ */
95
+ getOrganizationModelAccessRaw(requestParameters: GetOrganizationModelAccessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OrganizationModelAccessUio>>;
96
+ /**
97
+ * Admin de l\'organisation. Modèles réservés à certains membres.
98
+ * List model user restrictions of an organization
99
+ */
100
+ getOrganizationModelAccess(organizationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrganizationModelAccessUio>;
79
101
  /**
80
102
  * Get a provider by id
81
103
  * Get a provider
@@ -96,6 +118,26 @@ export declare class EngineApi extends runtime.BaseAPI {
96
118
  * Get providers for an organization
97
119
  */
98
120
  getProviders(organizationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProviderUio>>;
121
+ /**
122
+ * Admin de l\'organisation. Réserve un modèle (de l\'organisation ou plateforme ouvert à l\'organisation) à certains membres, ou le rouvre à tous avec `restrictToUsers: false`.
123
+ * Restrict a model to some members
124
+ */
125
+ setModelUserAccessRaw(requestParameters: SetModelUserAccessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelUserAccessUio>>;
126
+ /**
127
+ * Admin de l\'organisation. Réserve un modèle (de l\'organisation ou plateforme ouvert à l\'organisation) à certains membres, ou le rouvre à tous avec `restrictToUsers: false`.
128
+ * Restrict a model to some members
129
+ */
130
+ setModelUserAccess(organizationId: string, providerId: string, setModelUserAccessUio: SetModelUserAccessUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelUserAccessUio>;
131
+ /**
132
+ * Admin d\'organisation. Prix au million de tokens proposés pour des modèles, en euros : tarifs Breign, sinon catalogue public (models.dev) converti au taux BCE du jour. C\'est en euros que se comptent les budgets des utilisateurs. Un prix dont la devise ne se convertit pas est omis.
133
+ * Suggest token prices for organization engine models
134
+ */
135
+ suggestOrganizationTokenPricesRaw(requestParameters: SuggestOrganizationTokenPricesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TokenPriceSuggestionUio>>>;
136
+ /**
137
+ * Admin d\'organisation. Prix au million de tokens proposés pour des modèles, en euros : tarifs Breign, sinon catalogue public (models.dev) converti au taux BCE du jour. C\'est en euros que se comptent les budgets des utilisateurs. Un prix dont la devise ne se convertit pas est omis.
138
+ * Suggest token prices for organization engine models
139
+ */
140
+ suggestOrganizationTokenPrices(organizationId: string, tokenPriceSuggestionRequestUio: TokenPriceSuggestionRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<TokenPriceSuggestionUio>>;
99
141
  /**
100
142
  * Update the default engine for an organization
101
143
  * Update the default engine for an organization
@@ -154,6 +154,35 @@ class EngineApi extends runtime.BaseAPI {
154
154
  const response = await this.getEngineProvidersWithEmbeddingRaw({ organizationId: organizationId, requiredModelId: requiredModelId }, initOverrides);
155
155
  return await response.value();
156
156
  }
157
+ /**
158
+ * Admin de l\'organisation. Modèles réservés à certains membres.
159
+ * List model user restrictions of an organization
160
+ */
161
+ async getOrganizationModelAccessRaw(requestParameters, initOverrides) {
162
+ if (requestParameters['organizationId'] == null) {
163
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling getOrganizationModelAccess().');
164
+ }
165
+ const queryParameters = {};
166
+ const headerParameters = {};
167
+ if (this.configuration && this.configuration.apiKey) {
168
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
169
+ }
170
+ const response = await this.request({
171
+ path: `/organizations/{organizationId}/engines/access`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
172
+ method: 'GET',
173
+ headers: headerParameters,
174
+ query: queryParameters,
175
+ }, initOverrides);
176
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.OrganizationModelAccessUioFromJSON)(jsonValue));
177
+ }
178
+ /**
179
+ * Admin de l\'organisation. Modèles réservés à certains membres.
180
+ * List model user restrictions of an organization
181
+ */
182
+ async getOrganizationModelAccess(organizationId, initOverrides) {
183
+ const response = await this.getOrganizationModelAccessRaw({ organizationId: organizationId }, initOverrides);
184
+ return await response.value();
185
+ }
157
186
  /**
158
187
  * Get a provider by id
159
188
  * Get a provider
@@ -212,6 +241,77 @@ class EngineApi extends runtime.BaseAPI {
212
241
  const response = await this.getProvidersRaw({ organizationId: organizationId }, initOverrides);
213
242
  return await response.value();
214
243
  }
244
+ /**
245
+ * Admin de l\'organisation. Réserve un modèle (de l\'organisation ou plateforme ouvert à l\'organisation) à certains membres, ou le rouvre à tous avec `restrictToUsers: false`.
246
+ * Restrict a model to some members
247
+ */
248
+ async setModelUserAccessRaw(requestParameters, initOverrides) {
249
+ if (requestParameters['organizationId'] == null) {
250
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling setModelUserAccess().');
251
+ }
252
+ if (requestParameters['providerId'] == null) {
253
+ throw new runtime.RequiredError('providerId', 'Required parameter "providerId" was null or undefined when calling setModelUserAccess().');
254
+ }
255
+ if (requestParameters['setModelUserAccessUio'] == null) {
256
+ throw new runtime.RequiredError('setModelUserAccessUio', 'Required parameter "setModelUserAccessUio" was null or undefined when calling setModelUserAccess().');
257
+ }
258
+ const queryParameters = {};
259
+ const headerParameters = {};
260
+ headerParameters['Content-Type'] = 'application/json';
261
+ if (this.configuration && this.configuration.apiKey) {
262
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
263
+ }
264
+ const response = await this.request({
265
+ path: `/organizations/{organizationId}/engines/providers/{providerId}/access`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))).replace(`{${"providerId"}}`, encodeURIComponent(String(requestParameters['providerId']))),
266
+ method: 'PUT',
267
+ headers: headerParameters,
268
+ query: queryParameters,
269
+ body: (0, index_1.SetModelUserAccessUioToJSON)(requestParameters['setModelUserAccessUio']),
270
+ }, initOverrides);
271
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ModelUserAccessUioFromJSON)(jsonValue));
272
+ }
273
+ /**
274
+ * Admin de l\'organisation. Réserve un modèle (de l\'organisation ou plateforme ouvert à l\'organisation) à certains membres, ou le rouvre à tous avec `restrictToUsers: false`.
275
+ * Restrict a model to some members
276
+ */
277
+ async setModelUserAccess(organizationId, providerId, setModelUserAccessUio, initOverrides) {
278
+ const response = await this.setModelUserAccessRaw({ organizationId: organizationId, providerId: providerId, setModelUserAccessUio: setModelUserAccessUio }, initOverrides);
279
+ return await response.value();
280
+ }
281
+ /**
282
+ * Admin d\'organisation. Prix au million de tokens proposés pour des modèles, en euros : tarifs Breign, sinon catalogue public (models.dev) converti au taux BCE du jour. C\'est en euros que se comptent les budgets des utilisateurs. Un prix dont la devise ne se convertit pas est omis.
283
+ * Suggest token prices for organization engine models
284
+ */
285
+ async suggestOrganizationTokenPricesRaw(requestParameters, initOverrides) {
286
+ if (requestParameters['organizationId'] == null) {
287
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling suggestOrganizationTokenPrices().');
288
+ }
289
+ if (requestParameters['tokenPriceSuggestionRequestUio'] == null) {
290
+ throw new runtime.RequiredError('tokenPriceSuggestionRequestUio', 'Required parameter "tokenPriceSuggestionRequestUio" was null or undefined when calling suggestOrganizationTokenPrices().');
291
+ }
292
+ const queryParameters = {};
293
+ const headerParameters = {};
294
+ headerParameters['Content-Type'] = 'application/json';
295
+ if (this.configuration && this.configuration.apiKey) {
296
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
297
+ }
298
+ const response = await this.request({
299
+ path: `/organizations/{organizationId}/engines/token-price-suggestions`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
300
+ method: 'POST',
301
+ headers: headerParameters,
302
+ query: queryParameters,
303
+ body: (0, index_1.TokenPriceSuggestionRequestUioToJSON)(requestParameters['tokenPriceSuggestionRequestUio']),
304
+ }, initOverrides);
305
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.TokenPriceSuggestionUioFromJSON));
306
+ }
307
+ /**
308
+ * Admin d\'organisation. Prix au million de tokens proposés pour des modèles, en euros : tarifs Breign, sinon catalogue public (models.dev) converti au taux BCE du jour. C\'est en euros que se comptent les budgets des utilisateurs. Un prix dont la devise ne se convertit pas est omis.
309
+ * Suggest token prices for organization engine models
310
+ */
311
+ async suggestOrganizationTokenPrices(organizationId, tokenPriceSuggestionRequestUio, initOverrides) {
312
+ const response = await this.suggestOrganizationTokenPricesRaw({ organizationId: organizationId, tokenPriceSuggestionRequestUio: tokenPriceSuggestionRequestUio }, initOverrides);
313
+ return await response.value();
314
+ }
215
315
  /**
216
316
  * Update the default engine for an organization
217
317
  * Update the default engine for an organization
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { AiGatewayUserBudgetUio } from './AiGatewayUserBudgetUio';
12
13
  import type { AiGatewayModelTokenQuotaUio } from './AiGatewayModelTokenQuotaUio';
13
14
  /**
14
15
  *
@@ -34,6 +35,12 @@ export interface AiGatewayInternalSettingsSummaryUio {
34
35
  * @memberof AiGatewayInternalSettingsSummaryUio
35
36
  */
36
37
  modelTokenQuotas: Array<AiGatewayModelTokenQuotaUio>;
38
+ /**
39
+ * Budgets en euros par utilisateur (moteurs à clé propre seulement ; vide côté plateforme).
40
+ * @type {Array<AiGatewayUserBudgetUio>}
41
+ * @memberof AiGatewayInternalSettingsSummaryUio
42
+ */
43
+ userBudgets?: Array<AiGatewayUserBudgetUio>;
37
44
  /**
38
45
  *
39
46
  * @type {Date}
@@ -18,6 +18,7 @@ exports.AiGatewayInternalSettingsSummaryUioFromJSON = AiGatewayInternalSettingsS
18
18
  exports.AiGatewayInternalSettingsSummaryUioFromJSONTyped = AiGatewayInternalSettingsSummaryUioFromJSONTyped;
19
19
  exports.AiGatewayInternalSettingsSummaryUioToJSON = AiGatewayInternalSettingsSummaryUioToJSON;
20
20
  exports.AiGatewayInternalSettingsSummaryUioToJSONTyped = AiGatewayInternalSettingsSummaryUioToJSONTyped;
21
+ const AiGatewayUserBudgetUio_1 = require("./AiGatewayUserBudgetUio");
21
22
  const AiGatewayModelTokenQuotaUio_1 = require("./AiGatewayModelTokenQuotaUio");
22
23
  /**
23
24
  * Check if a given object implements the AiGatewayInternalSettingsSummaryUio interface.
@@ -46,6 +47,7 @@ function AiGatewayInternalSettingsSummaryUioFromJSONTyped(json, ignoreDiscrimina
46
47
  'organizationId': json['organizationId'],
47
48
  'gatewayRpm': json['gatewayRpm'],
48
49
  'modelTokenQuotas': (json['modelTokenQuotas'].map(AiGatewayModelTokenQuotaUio_1.AiGatewayModelTokenQuotaUioFromJSON)),
50
+ 'userBudgets': json['userBudgets'] == null ? undefined : (json['userBudgets'].map(AiGatewayUserBudgetUio_1.AiGatewayUserBudgetUioFromJSON)),
49
51
  'updatedAt': (new Date(json['updatedAt'])),
50
52
  'updatedBy': json['updatedBy'] == null ? undefined : json['updatedBy'],
51
53
  'maxQuotaRatio': json['maxQuotaRatio'],
@@ -62,6 +64,7 @@ function AiGatewayInternalSettingsSummaryUioToJSONTyped(value, ignoreDiscriminat
62
64
  'organizationId': value['organizationId'],
63
65
  'gatewayRpm': value['gatewayRpm'],
64
66
  'modelTokenQuotas': (value['modelTokenQuotas'].map(AiGatewayModelTokenQuotaUio_1.AiGatewayModelTokenQuotaUioToJSON)),
67
+ 'userBudgets': value['userBudgets'] == null ? undefined : (value['userBudgets'].map(AiGatewayUserBudgetUio_1.AiGatewayUserBudgetUioToJSON)),
65
68
  'updatedAt': ((value['updatedAt']).toISOString()),
66
69
  'updatedBy': value['updatedBy'],
67
70
  'maxQuotaRatio': value['maxQuotaRatio'],
@@ -16,7 +16,7 @@
16
16
  */
17
17
  export interface AiGatewayModelTokenQuotaUio {
18
18
  /**
19
- * Breign user id this quota applies to
19
+ * Breign user id this quota applies to, or `*` for every user (each one separately). A quota on a specific user overrides the `*` one for that user.
20
20
  * @type {string}
21
21
  * @memberof AiGatewayModelTokenQuotaUio
22
22
  */
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { AiGatewayUserBudgetUio } from './AiGatewayUserBudgetUio';
12
13
  import type { AiGatewayModelTokenQuotaUio } from './AiGatewayModelTokenQuotaUio';
13
14
  /**
14
15
  *
@@ -34,6 +35,12 @@ export interface AiGatewaySettingsUio {
34
35
  * @memberof AiGatewaySettingsUio
35
36
  */
36
37
  modelTokenQuotas: Array<AiGatewayModelTokenQuotaUio>;
38
+ /**
39
+ * Budgets en euros par utilisateur (moteurs à clé propre seulement ; vide côté plateforme).
40
+ * @type {Array<AiGatewayUserBudgetUio>}
41
+ * @memberof AiGatewaySettingsUio
42
+ */
43
+ userBudgets?: Array<AiGatewayUserBudgetUio>;
37
44
  /**
38
45
  *
39
46
  * @type {Date}
@@ -18,6 +18,7 @@ exports.AiGatewaySettingsUioFromJSON = AiGatewaySettingsUioFromJSON;
18
18
  exports.AiGatewaySettingsUioFromJSONTyped = AiGatewaySettingsUioFromJSONTyped;
19
19
  exports.AiGatewaySettingsUioToJSON = AiGatewaySettingsUioToJSON;
20
20
  exports.AiGatewaySettingsUioToJSONTyped = AiGatewaySettingsUioToJSONTyped;
21
+ const AiGatewayUserBudgetUio_1 = require("./AiGatewayUserBudgetUio");
21
22
  const AiGatewayModelTokenQuotaUio_1 = require("./AiGatewayModelTokenQuotaUio");
22
23
  /**
23
24
  * Check if a given object implements the AiGatewaySettingsUio interface.
@@ -44,6 +45,7 @@ function AiGatewaySettingsUioFromJSONTyped(json, ignoreDiscriminator) {
44
45
  'organizationId': json['organizationId'],
45
46
  'gatewayRpm': json['gatewayRpm'],
46
47
  'modelTokenQuotas': (json['modelTokenQuotas'].map(AiGatewayModelTokenQuotaUio_1.AiGatewayModelTokenQuotaUioFromJSON)),
48
+ 'userBudgets': json['userBudgets'] == null ? undefined : (json['userBudgets'].map(AiGatewayUserBudgetUio_1.AiGatewayUserBudgetUioFromJSON)),
47
49
  'updatedAt': (new Date(json['updatedAt'])),
48
50
  'updatedBy': json['updatedBy'] == null ? undefined : json['updatedBy'],
49
51
  };
@@ -59,6 +61,7 @@ function AiGatewaySettingsUioToJSONTyped(value, ignoreDiscriminator = false) {
59
61
  'organizationId': value['organizationId'],
60
62
  'gatewayRpm': value['gatewayRpm'],
61
63
  'modelTokenQuotas': (value['modelTokenQuotas'].map(AiGatewayModelTokenQuotaUio_1.AiGatewayModelTokenQuotaUioToJSON)),
64
+ 'userBudgets': value['userBudgets'] == null ? undefined : (value['userBudgets'].map(AiGatewayUserBudgetUio_1.AiGatewayUserBudgetUioToJSON)),
62
65
  'updatedAt': ((value['updatedAt']).toISOString()),
63
66
  'updatedBy': value['updatedBy'],
64
67
  };
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { AiGatewayUserBudgetUio } from './AiGatewayUserBudgetUio';
12
13
  import type { AiGatewayModelTokenQuotaUio } from './AiGatewayModelTokenQuotaUio';
13
14
  /**
14
15
  *
@@ -28,6 +29,12 @@ export interface AiGatewaySettingsUpdateRequestUio {
28
29
  * @memberof AiGatewaySettingsUpdateRequestUio
29
30
  */
30
31
  modelTokenQuotas?: Array<AiGatewayModelTokenQuotaUio>;
32
+ /**
33
+ * Remplace tous les budgets. Refusé sur les réglages plateforme.
34
+ * @type {Array<AiGatewayUserBudgetUio>}
35
+ * @memberof AiGatewaySettingsUpdateRequestUio
36
+ */
37
+ userBudgets?: Array<AiGatewayUserBudgetUio>;
31
38
  }
32
39
  /**
33
40
  * Check if a given object implements the AiGatewaySettingsUpdateRequestUio interface.
@@ -18,6 +18,7 @@ exports.AiGatewaySettingsUpdateRequestUioFromJSON = AiGatewaySettingsUpdateReque
18
18
  exports.AiGatewaySettingsUpdateRequestUioFromJSONTyped = AiGatewaySettingsUpdateRequestUioFromJSONTyped;
19
19
  exports.AiGatewaySettingsUpdateRequestUioToJSON = AiGatewaySettingsUpdateRequestUioToJSON;
20
20
  exports.AiGatewaySettingsUpdateRequestUioToJSONTyped = AiGatewaySettingsUpdateRequestUioToJSONTyped;
21
+ const AiGatewayUserBudgetUio_1 = require("./AiGatewayUserBudgetUio");
21
22
  const AiGatewayModelTokenQuotaUio_1 = require("./AiGatewayModelTokenQuotaUio");
22
23
  /**
23
24
  * Check if a given object implements the AiGatewaySettingsUpdateRequestUio interface.
@@ -35,6 +36,7 @@ function AiGatewaySettingsUpdateRequestUioFromJSONTyped(json, ignoreDiscriminato
35
36
  return {
36
37
  'gatewayRpm': json['gatewayRpm'] == null ? undefined : json['gatewayRpm'],
37
38
  'modelTokenQuotas': json['modelTokenQuotas'] == null ? undefined : (json['modelTokenQuotas'].map(AiGatewayModelTokenQuotaUio_1.AiGatewayModelTokenQuotaUioFromJSON)),
39
+ 'userBudgets': json['userBudgets'] == null ? undefined : (json['userBudgets'].map(AiGatewayUserBudgetUio_1.AiGatewayUserBudgetUioFromJSON)),
38
40
  };
39
41
  }
40
42
  function AiGatewaySettingsUpdateRequestUioToJSON(json) {
@@ -47,5 +49,6 @@ function AiGatewaySettingsUpdateRequestUioToJSONTyped(value, ignoreDiscriminator
47
49
  return {
48
50
  'gatewayRpm': value['gatewayRpm'],
49
51
  'modelTokenQuotas': value['modelTokenQuotas'] == null ? undefined : (value['modelTokenQuotas'].map(AiGatewayModelTokenQuotaUio_1.AiGatewayModelTokenQuotaUioToJSON)),
52
+ 'userBudgets': value['userBudgets'] == null ? undefined : (value['userBudgets'].map(AiGatewayUserBudgetUio_1.AiGatewayUserBudgetUioToJSON)),
50
53
  };
51
54
  }