@breign/client 1.0.163 → 1.0.164

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.
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { AddModuleRequestUio, AdvancedFlowEditorUio, AdvancedFlowEditorUpdateRequestUio, AgentDuplicateRequestUio, AgentFlowCreateUio, AgentFlowUio, AgentImportRequestUio, AgentImportResponseUio, AgentMetricsEventUio, AgentMetricsOverviewUio, AgentModuleUio, AgentPatchUio, AgentRequestUio, AgentSubscriptionUio, AgentToolAllowedMethodsRequestUio, AgentUio, AgentUsageMetricsUio, BodyWithIdUio, ChatUio, ConversationAttachmentDownloadUrlUio, ConversationMessageImagesUio, DeleteMessageAudio200ResponseUio, EphemeralInstancesMetricsResponseUio, FileCreationRequestUio, FileCreationResponseUio, FlowEditorUio, FlowEditorUpdateRequestUio, MessageAudioDownloadUrlUio, OrgUsageMetricsResponseUio, S3UploadBodyUio, STTResponseUio } from '../models/index';
13
+ import type { AddModuleRequestUio, AdvancedFlowEditorUio, AdvancedFlowEditorUpdateRequestUio, AgentDuplicateRequestUio, AgentFlowCreateUio, AgentFlowUio, AgentImportRequestUio, AgentImportResponseUio, AgentMetricsEventUio, AgentMetricsOverviewUio, AgentModuleUio, AgentPatchUio, AgentPromptInitGenerationRequestUio, AgentPromptInitGenerationResponseUio, AgentRequestUio, AgentSubscriptionUio, AgentToolAllowedMethodsRequestUio, AgentUio, AgentUsageMetricsUio, BodyWithIdUio, ChatUio, ConversationAttachmentDownloadUrlUio, ConversationMessageImagesUio, DeleteMessageAudio200ResponseUio, EphemeralInstancesMetricsResponseUio, FileCreationRequestUio, FileCreationResponseUio, FlowEditorUio, FlowEditorUpdateRequestUio, MessageAudioDownloadUrlUio, OrgUsageMetricsResponseUio, S3UploadBodyUio, STTResponseUio } from '../models/index';
14
14
  export interface AddModuleRequest {
15
15
  agentId: string;
16
16
  addModuleRequestUio: AddModuleRequestUio;
@@ -52,6 +52,10 @@ export interface ExportAgentRequest {
52
52
  agentId: string;
53
53
  format?: ExportAgentFormatEnum;
54
54
  }
55
+ export interface GenerateAgentPromptInitRequest {
56
+ agentId: string;
57
+ agentPromptInitGenerationRequestUio: AgentPromptInitGenerationRequestUio;
58
+ }
55
59
  export interface GetAdvancedFlowEditorRequest {
56
60
  agentId: string;
57
61
  }
@@ -307,6 +311,16 @@ export declare class AgentApi extends runtime.BaseAPI {
307
311
  * Export an agent
308
312
  */
309
313
  exportAgent(agentId: string, format?: ExportAgentFormatEnum, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
314
+ /**
315
+ * Writes a ready-to-use initialization prompt from a short brief, using the AI model configured on the agent (or, failing that, on its organisation). The result is returned only — it is never persisted on the agent, which is updated through PATCH /agents/{agentId}.
316
+ * Generate initialization instructions for an agent
317
+ */
318
+ generateAgentPromptInitRaw(requestParameters: GenerateAgentPromptInitRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AgentPromptInitGenerationResponseUio>>;
319
+ /**
320
+ * Writes a ready-to-use initialization prompt from a short brief, using the AI model configured on the agent (or, failing that, on its organisation). The result is returned only — it is never persisted on the agent, which is updated through PATCH /agents/{agentId}.
321
+ * Generate initialization instructions for an agent
322
+ */
323
+ generateAgentPromptInit(agentId: string, agentPromptInitGenerationRequestUio: AgentPromptInitGenerationRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AgentPromptInitGenerationResponseUio>;
310
324
  /**
311
325
  * Get the advanced flow editor state for an agent
312
326
  * Get advanced flow editor state
@@ -388,6 +388,40 @@ class AgentApi extends runtime.BaseAPI {
388
388
  const response = await this.exportAgentRaw({ agentId: agentId, format: format }, initOverrides);
389
389
  return await response.value();
390
390
  }
391
+ /**
392
+ * Writes a ready-to-use initialization prompt from a short brief, using the AI model configured on the agent (or, failing that, on its organisation). The result is returned only — it is never persisted on the agent, which is updated through PATCH /agents/{agentId}.
393
+ * Generate initialization instructions for an agent
394
+ */
395
+ async generateAgentPromptInitRaw(requestParameters, initOverrides) {
396
+ if (requestParameters['agentId'] == null) {
397
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling generateAgentPromptInit().');
398
+ }
399
+ if (requestParameters['agentPromptInitGenerationRequestUio'] == null) {
400
+ throw new runtime.RequiredError('agentPromptInitGenerationRequestUio', 'Required parameter "agentPromptInitGenerationRequestUio" was null or undefined when calling generateAgentPromptInit().');
401
+ }
402
+ const queryParameters = {};
403
+ const headerParameters = {};
404
+ headerParameters['Content-Type'] = 'application/json';
405
+ if (this.configuration && this.configuration.apiKey) {
406
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
407
+ }
408
+ const response = await this.request({
409
+ path: `/agents/{agentId}/prompt-init/generate`.replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
410
+ method: 'POST',
411
+ headers: headerParameters,
412
+ query: queryParameters,
413
+ body: (0, index_1.AgentPromptInitGenerationRequestUioToJSON)(requestParameters['agentPromptInitGenerationRequestUio']),
414
+ }, initOverrides);
415
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AgentPromptInitGenerationResponseUioFromJSON)(jsonValue));
416
+ }
417
+ /**
418
+ * Writes a ready-to-use initialization prompt from a short brief, using the AI model configured on the agent (or, failing that, on its organisation). The result is returned only — it is never persisted on the agent, which is updated through PATCH /agents/{agentId}.
419
+ * Generate initialization instructions for an agent
420
+ */
421
+ async generateAgentPromptInit(agentId, agentPromptInitGenerationRequestUio, initOverrides) {
422
+ const response = await this.generateAgentPromptInitRaw({ agentId: agentId, agentPromptInitGenerationRequestUio: agentPromptInitGenerationRequestUio }, initOverrides);
423
+ return await response.value();
424
+ }
391
425
  /**
392
426
  * Get the advanced flow editor state for an agent
393
427
  * Get advanced flow editor state
@@ -0,0 +1,45 @@
1
+ /**
2
+ * brain-client
3
+ * Api ands models for brain-app and brain-app
4
+ *
5
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * What the user wrote themselves when no preset fitted, per question. A note REPLACES the presets of its own question rather than adding to them.
14
+ *
15
+ * @export
16
+ * @interface AgentPromptInitGenerationRequestNotesUio
17
+ */
18
+ export interface AgentPromptInitGenerationRequestNotesUio {
19
+ /**
20
+ *
21
+ * @type {string}
22
+ * @memberof AgentPromptInitGenerationRequestNotesUio
23
+ */
24
+ audience?: string;
25
+ /**
26
+ *
27
+ * @type {string}
28
+ * @memberof AgentPromptInitGenerationRequestNotesUio
29
+ */
30
+ answerStyle?: string;
31
+ /**
32
+ *
33
+ * @type {string}
34
+ * @memberof AgentPromptInitGenerationRequestNotesUio
35
+ */
36
+ sourcePolicy?: string;
37
+ }
38
+ /**
39
+ * Check if a given object implements the AgentPromptInitGenerationRequestNotesUio interface.
40
+ */
41
+ export declare function instanceOfAgentPromptInitGenerationRequestNotesUio(value: object): value is AgentPromptInitGenerationRequestNotesUio;
42
+ export declare function AgentPromptInitGenerationRequestNotesUioFromJSON(json: any): AgentPromptInitGenerationRequestNotesUio;
43
+ export declare function AgentPromptInitGenerationRequestNotesUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentPromptInitGenerationRequestNotesUio;
44
+ export declare function AgentPromptInitGenerationRequestNotesUioToJSON(json: any): AgentPromptInitGenerationRequestNotesUio;
45
+ export declare function AgentPromptInitGenerationRequestNotesUioToJSONTyped(value?: AgentPromptInitGenerationRequestNotesUio | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * brain-client
6
+ * Api ands models for brain-app and brain-app
7
+ *
8
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfAgentPromptInitGenerationRequestNotesUio = instanceOfAgentPromptInitGenerationRequestNotesUio;
17
+ exports.AgentPromptInitGenerationRequestNotesUioFromJSON = AgentPromptInitGenerationRequestNotesUioFromJSON;
18
+ exports.AgentPromptInitGenerationRequestNotesUioFromJSONTyped = AgentPromptInitGenerationRequestNotesUioFromJSONTyped;
19
+ exports.AgentPromptInitGenerationRequestNotesUioToJSON = AgentPromptInitGenerationRequestNotesUioToJSON;
20
+ exports.AgentPromptInitGenerationRequestNotesUioToJSONTyped = AgentPromptInitGenerationRequestNotesUioToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the AgentPromptInitGenerationRequestNotesUio interface.
23
+ */
24
+ function instanceOfAgentPromptInitGenerationRequestNotesUio(value) {
25
+ return true;
26
+ }
27
+ function AgentPromptInitGenerationRequestNotesUioFromJSON(json) {
28
+ return AgentPromptInitGenerationRequestNotesUioFromJSONTyped(json, false);
29
+ }
30
+ function AgentPromptInitGenerationRequestNotesUioFromJSONTyped(json, ignoreDiscriminator) {
31
+ if (json == null) {
32
+ return json;
33
+ }
34
+ return {
35
+ 'audience': json['audience'] == null ? undefined : json['audience'],
36
+ 'answerStyle': json['answerStyle'] == null ? undefined : json['answerStyle'],
37
+ 'sourcePolicy': json['sourcePolicy'] == null ? undefined : json['sourcePolicy'],
38
+ };
39
+ }
40
+ function AgentPromptInitGenerationRequestNotesUioToJSON(json) {
41
+ return AgentPromptInitGenerationRequestNotesUioToJSONTyped(json, false);
42
+ }
43
+ function AgentPromptInitGenerationRequestNotesUioToJSONTyped(value, ignoreDiscriminator = false) {
44
+ if (value == null) {
45
+ return value;
46
+ }
47
+ return {
48
+ 'audience': value['audience'],
49
+ 'answerStyle': value['answerStyle'],
50
+ 'sourcePolicy': value['sourcePolicy'],
51
+ };
52
+ }
@@ -0,0 +1,110 @@
1
+ /**
2
+ * brain-client
3
+ * Api ands models for brain-app and brain-app
4
+ *
5
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { AgentPromptInitGenerationRequestNotesUio } from './AgentPromptInitGenerationRequestNotesUio';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface AgentPromptInitGenerationRequestUio
17
+ */
18
+ export interface AgentPromptInitGenerationRequestUio {
19
+ /**
20
+ * What the agent is for, in the user's own words.
21
+ * @type {string}
22
+ * @memberof AgentPromptInitGenerationRequestUio
23
+ */
24
+ mission: string;
25
+ /**
26
+ * Who the agent talks to. Several may apply at once; duplicates are rejected. Omit it when `notes.audience` is given — a free-text note replaces the presets. Defaults to `employees` when neither is given. Not declared as `uniqueItems` because the TypeScript generator would turn the field into a `Set`, which does not survive a server-action boundary — the server-side schema enforces uniqueness.
27
+ *
28
+ * @type {Array<string>}
29
+ * @memberof AgentPromptInitGenerationRequestUio
30
+ */
31
+ audiences?: Array<AgentPromptInitGenerationRequestUioAudiencesEnum>;
32
+ /**
33
+ * Omit it when `notes.answerStyle` is given. Defaults to `concise`.
34
+ * @type {string}
35
+ * @memberof AgentPromptInitGenerationRequestUio
36
+ */
37
+ answerStyle?: AgentPromptInitGenerationRequestUioAnswerStyleEnum;
38
+ /**
39
+ * Omit it when `notes.sourcePolicy` is given. Defaults to `provided_only`.
40
+ * @type {string}
41
+ * @memberof AgentPromptInitGenerationRequestUio
42
+ */
43
+ sourcePolicy?: AgentPromptInitGenerationRequestUioSourcePolicyEnum;
44
+ /**
45
+ *
46
+ * @type {AgentPromptInitGenerationRequestNotesUio}
47
+ * @memberof AgentPromptInitGenerationRequestUio
48
+ */
49
+ notes?: AgentPromptInitGenerationRequestNotesUio;
50
+ /**
51
+ * What the agent must never do.
52
+ * @type {string}
53
+ * @memberof AgentPromptInitGenerationRequestUio
54
+ */
55
+ constraints?: string;
56
+ /**
57
+ * Language the instructions are written in. Defaults to the agent's.
58
+ * @type {string}
59
+ * @memberof AgentPromptInitGenerationRequestUio
60
+ */
61
+ lang?: string;
62
+ /**
63
+ * Engine to write with, instead of the agent's. Must belong to the agent's organisation. Only honoured together with `model`.
64
+ *
65
+ * @type {string}
66
+ * @memberof AgentPromptInitGenerationRequestUio
67
+ */
68
+ providerId?: string;
69
+ /**
70
+ * Model id within `providerId`.
71
+ * @type {string}
72
+ * @memberof AgentPromptInitGenerationRequestUio
73
+ */
74
+ model?: string;
75
+ }
76
+ /**
77
+ * @export
78
+ */
79
+ export declare const AgentPromptInitGenerationRequestUioAudiencesEnum: {
80
+ readonly GeneralPublic: "general_public";
81
+ readonly Customers: "customers";
82
+ readonly Employees: "employees";
83
+ readonly Experts: "experts";
84
+ };
85
+ export type AgentPromptInitGenerationRequestUioAudiencesEnum = typeof AgentPromptInitGenerationRequestUioAudiencesEnum[keyof typeof AgentPromptInitGenerationRequestUioAudiencesEnum];
86
+ /**
87
+ * @export
88
+ */
89
+ export declare const AgentPromptInitGenerationRequestUioAnswerStyleEnum: {
90
+ readonly Concise: "concise";
91
+ readonly Detailed: "detailed";
92
+ readonly StepByStep: "step_by_step";
93
+ };
94
+ export type AgentPromptInitGenerationRequestUioAnswerStyleEnum = typeof AgentPromptInitGenerationRequestUioAnswerStyleEnum[keyof typeof AgentPromptInitGenerationRequestUioAnswerStyleEnum];
95
+ /**
96
+ * @export
97
+ */
98
+ export declare const AgentPromptInitGenerationRequestUioSourcePolicyEnum: {
99
+ readonly ProvidedOnly: "provided_only";
100
+ readonly ProvidedAndGeneral: "provided_and_general";
101
+ };
102
+ export type AgentPromptInitGenerationRequestUioSourcePolicyEnum = typeof AgentPromptInitGenerationRequestUioSourcePolicyEnum[keyof typeof AgentPromptInitGenerationRequestUioSourcePolicyEnum];
103
+ /**
104
+ * Check if a given object implements the AgentPromptInitGenerationRequestUio interface.
105
+ */
106
+ export declare function instanceOfAgentPromptInitGenerationRequestUio(value: object): value is AgentPromptInitGenerationRequestUio;
107
+ export declare function AgentPromptInitGenerationRequestUioFromJSON(json: any): AgentPromptInitGenerationRequestUio;
108
+ export declare function AgentPromptInitGenerationRequestUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentPromptInitGenerationRequestUio;
109
+ export declare function AgentPromptInitGenerationRequestUioToJSON(json: any): AgentPromptInitGenerationRequestUio;
110
+ export declare function AgentPromptInitGenerationRequestUioToJSONTyped(value?: AgentPromptInitGenerationRequestUio | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * brain-client
6
+ * Api ands models for brain-app and brain-app
7
+ *
8
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.AgentPromptInitGenerationRequestUioSourcePolicyEnum = exports.AgentPromptInitGenerationRequestUioAnswerStyleEnum = exports.AgentPromptInitGenerationRequestUioAudiencesEnum = void 0;
17
+ exports.instanceOfAgentPromptInitGenerationRequestUio = instanceOfAgentPromptInitGenerationRequestUio;
18
+ exports.AgentPromptInitGenerationRequestUioFromJSON = AgentPromptInitGenerationRequestUioFromJSON;
19
+ exports.AgentPromptInitGenerationRequestUioFromJSONTyped = AgentPromptInitGenerationRequestUioFromJSONTyped;
20
+ exports.AgentPromptInitGenerationRequestUioToJSON = AgentPromptInitGenerationRequestUioToJSON;
21
+ exports.AgentPromptInitGenerationRequestUioToJSONTyped = AgentPromptInitGenerationRequestUioToJSONTyped;
22
+ const AgentPromptInitGenerationRequestNotesUio_1 = require("./AgentPromptInitGenerationRequestNotesUio");
23
+ /**
24
+ * @export
25
+ */
26
+ exports.AgentPromptInitGenerationRequestUioAudiencesEnum = {
27
+ GeneralPublic: 'general_public',
28
+ Customers: 'customers',
29
+ Employees: 'employees',
30
+ Experts: 'experts'
31
+ };
32
+ /**
33
+ * @export
34
+ */
35
+ exports.AgentPromptInitGenerationRequestUioAnswerStyleEnum = {
36
+ Concise: 'concise',
37
+ Detailed: 'detailed',
38
+ StepByStep: 'step_by_step'
39
+ };
40
+ /**
41
+ * @export
42
+ */
43
+ exports.AgentPromptInitGenerationRequestUioSourcePolicyEnum = {
44
+ ProvidedOnly: 'provided_only',
45
+ ProvidedAndGeneral: 'provided_and_general'
46
+ };
47
+ /**
48
+ * Check if a given object implements the AgentPromptInitGenerationRequestUio interface.
49
+ */
50
+ function instanceOfAgentPromptInitGenerationRequestUio(value) {
51
+ if (!('mission' in value) || value['mission'] === undefined)
52
+ return false;
53
+ return true;
54
+ }
55
+ function AgentPromptInitGenerationRequestUioFromJSON(json) {
56
+ return AgentPromptInitGenerationRequestUioFromJSONTyped(json, false);
57
+ }
58
+ function AgentPromptInitGenerationRequestUioFromJSONTyped(json, ignoreDiscriminator) {
59
+ if (json == null) {
60
+ return json;
61
+ }
62
+ return {
63
+ 'mission': json['mission'],
64
+ 'audiences': json['audiences'] == null ? undefined : json['audiences'],
65
+ 'answerStyle': json['answerStyle'] == null ? undefined : json['answerStyle'],
66
+ 'sourcePolicy': json['sourcePolicy'] == null ? undefined : json['sourcePolicy'],
67
+ 'notes': json['notes'] == null ? undefined : (0, AgentPromptInitGenerationRequestNotesUio_1.AgentPromptInitGenerationRequestNotesUioFromJSON)(json['notes']),
68
+ 'constraints': json['constraints'] == null ? undefined : json['constraints'],
69
+ 'lang': json['lang'] == null ? undefined : json['lang'],
70
+ 'providerId': json['providerId'] == null ? undefined : json['providerId'],
71
+ 'model': json['model'] == null ? undefined : json['model'],
72
+ };
73
+ }
74
+ function AgentPromptInitGenerationRequestUioToJSON(json) {
75
+ return AgentPromptInitGenerationRequestUioToJSONTyped(json, false);
76
+ }
77
+ function AgentPromptInitGenerationRequestUioToJSONTyped(value, ignoreDiscriminator = false) {
78
+ if (value == null) {
79
+ return value;
80
+ }
81
+ return {
82
+ 'mission': value['mission'],
83
+ 'audiences': value['audiences'],
84
+ 'answerStyle': value['answerStyle'],
85
+ 'sourcePolicy': value['sourcePolicy'],
86
+ 'notes': (0, AgentPromptInitGenerationRequestNotesUio_1.AgentPromptInitGenerationRequestNotesUioToJSON)(value['notes']),
87
+ 'constraints': value['constraints'],
88
+ 'lang': value['lang'],
89
+ 'providerId': value['providerId'],
90
+ 'model': value['model'],
91
+ };
92
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * brain-client
3
+ * Api ands models for brain-app and brain-app
4
+ *
5
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface AgentPromptInitGenerationResponseUio
16
+ */
17
+ export interface AgentPromptInitGenerationResponseUio {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof AgentPromptInitGenerationResponseUio
22
+ */
23
+ promptInit: string;
24
+ /**
25
+ * Adjustments applied to the model's output, for information only.
26
+ * @type {Array<string>}
27
+ * @memberof AgentPromptInitGenerationResponseUio
28
+ */
29
+ warnings?: Array<string>;
30
+ }
31
+ /**
32
+ * Check if a given object implements the AgentPromptInitGenerationResponseUio interface.
33
+ */
34
+ export declare function instanceOfAgentPromptInitGenerationResponseUio(value: object): value is AgentPromptInitGenerationResponseUio;
35
+ export declare function AgentPromptInitGenerationResponseUioFromJSON(json: any): AgentPromptInitGenerationResponseUio;
36
+ export declare function AgentPromptInitGenerationResponseUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentPromptInitGenerationResponseUio;
37
+ export declare function AgentPromptInitGenerationResponseUioToJSON(json: any): AgentPromptInitGenerationResponseUio;
38
+ export declare function AgentPromptInitGenerationResponseUioToJSONTyped(value?: AgentPromptInitGenerationResponseUio | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * brain-client
6
+ * Api ands models for brain-app and brain-app
7
+ *
8
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfAgentPromptInitGenerationResponseUio = instanceOfAgentPromptInitGenerationResponseUio;
17
+ exports.AgentPromptInitGenerationResponseUioFromJSON = AgentPromptInitGenerationResponseUioFromJSON;
18
+ exports.AgentPromptInitGenerationResponseUioFromJSONTyped = AgentPromptInitGenerationResponseUioFromJSONTyped;
19
+ exports.AgentPromptInitGenerationResponseUioToJSON = AgentPromptInitGenerationResponseUioToJSON;
20
+ exports.AgentPromptInitGenerationResponseUioToJSONTyped = AgentPromptInitGenerationResponseUioToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the AgentPromptInitGenerationResponseUio interface.
23
+ */
24
+ function instanceOfAgentPromptInitGenerationResponseUio(value) {
25
+ if (!('promptInit' in value) || value['promptInit'] === undefined)
26
+ return false;
27
+ return true;
28
+ }
29
+ function AgentPromptInitGenerationResponseUioFromJSON(json) {
30
+ return AgentPromptInitGenerationResponseUioFromJSONTyped(json, false);
31
+ }
32
+ function AgentPromptInitGenerationResponseUioFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'promptInit': json['promptInit'],
38
+ 'warnings': json['warnings'] == null ? undefined : json['warnings'],
39
+ };
40
+ }
41
+ function AgentPromptInitGenerationResponseUioToJSON(json) {
42
+ return AgentPromptInitGenerationResponseUioToJSONTyped(json, false);
43
+ }
44
+ function AgentPromptInitGenerationResponseUioToJSONTyped(value, ignoreDiscriminator = false) {
45
+ if (value == null) {
46
+ return value;
47
+ }
48
+ return {
49
+ 'promptInit': value['promptInit'],
50
+ 'warnings': value['warnings'],
51
+ };
52
+ }
@@ -54,6 +54,9 @@ export * from './AgentModuleTypeUio';
54
54
  export * from './AgentModuleUio';
55
55
  export * from './AgentPatchEngineUio';
56
56
  export * from './AgentPatchUio';
57
+ export * from './AgentPromptInitGenerationRequestNotesUio';
58
+ export * from './AgentPromptInitGenerationRequestUio';
59
+ export * from './AgentPromptInitGenerationResponseUio';
57
60
  export * from './AgentRateLimitSettingsUio';
58
61
  export * from './AgentRateLimitSettingsUpdateRequestUio';
59
62
  export * from './AgentRefUio';
@@ -72,6 +72,9 @@ __exportStar(require("./AgentModuleTypeUio"), exports);
72
72
  __exportStar(require("./AgentModuleUio"), exports);
73
73
  __exportStar(require("./AgentPatchEngineUio"), exports);
74
74
  __exportStar(require("./AgentPatchUio"), exports);
75
+ __exportStar(require("./AgentPromptInitGenerationRequestNotesUio"), exports);
76
+ __exportStar(require("./AgentPromptInitGenerationRequestUio"), exports);
77
+ __exportStar(require("./AgentPromptInitGenerationResponseUio"), exports);
75
78
  __exportStar(require("./AgentRateLimitSettingsUio"), exports);
76
79
  __exportStar(require("./AgentRateLimitSettingsUpdateRequestUio"), exports);
77
80
  __exportStar(require("./AgentRefUio"), exports);
package/dist/openapi.json CHANGED
@@ -1781,6 +1781,64 @@
1781
1781
  "tags" : [ "agent" ]
1782
1782
  }
1783
1783
  },
1784
+ "/agents/{agentId}/prompt-init/generate" : {
1785
+ "post" : {
1786
+ "description" : "Writes a ready-to-use initialization prompt from a short brief, using the AI model configured on the agent (or, failing that, on its organisation). The result is returned only — it is never persisted on the agent, which is updated through PATCH /agents/{agentId}.\n",
1787
+ "operationId" : "generateAgentPromptInit",
1788
+ "parameters" : [ {
1789
+ "description" : "ID of the agent",
1790
+ "in" : "path",
1791
+ "name" : "agentId",
1792
+ "required" : true,
1793
+ "schema" : {
1794
+ "format" : "uuid",
1795
+ "type" : "string"
1796
+ }
1797
+ } ],
1798
+ "requestBody" : {
1799
+ "content" : {
1800
+ "application/json" : {
1801
+ "schema" : {
1802
+ "$ref" : "#/components/schemas/AgentPromptInitGenerationRequest"
1803
+ }
1804
+ }
1805
+ },
1806
+ "required" : true
1807
+ },
1808
+ "responses" : {
1809
+ "201" : {
1810
+ "content" : {
1811
+ "application/json" : {
1812
+ "schema" : {
1813
+ "$ref" : "#/components/schemas/AgentPromptInitGenerationResponse"
1814
+ }
1815
+ }
1816
+ },
1817
+ "description" : "Instructions generated successfully"
1818
+ },
1819
+ "400" : {
1820
+ "description" : "Invalid request body"
1821
+ },
1822
+ "401" : {
1823
+ "description" : "Unauthorized"
1824
+ },
1825
+ "403" : {
1826
+ "description" : "Forbidden - User doesn't have access to this agent"
1827
+ },
1828
+ "404" : {
1829
+ "description" : "Agent not found"
1830
+ },
1831
+ "409" : {
1832
+ "description" : "No AI model is configured for this agent or its organisation"
1833
+ },
1834
+ "502" : {
1835
+ "description" : "The model failed to produce usable instructions"
1836
+ }
1837
+ },
1838
+ "summary" : "Generate initialization instructions for an agent",
1839
+ "tags" : [ "agent" ]
1840
+ }
1841
+ },
1784
1842
  "/agents/{agentId}/tools/{toolId}" : {
1785
1843
  "delete" : {
1786
1844
  "description" : "Unlinks an organization tool from the specified agent",
@@ -18664,6 +18722,80 @@
18664
18722
  "required" : [ "transcription" ],
18665
18723
  "type" : "object"
18666
18724
  },
18725
+ "AgentPromptInitGenerationRequest" : {
18726
+ "additionalProperties" : false,
18727
+ "properties" : {
18728
+ "mission" : {
18729
+ "description" : "What the agent is for, in the user's own words.",
18730
+ "maxLength" : 600,
18731
+ "minLength" : 10,
18732
+ "type" : "string"
18733
+ },
18734
+ "audiences" : {
18735
+ "description" : "Who the agent talks to. Several may apply at once; duplicates are rejected. Omit it when `notes.audience` is given — a free-text note replaces the presets. Defaults to `employees` when neither is given. Not declared as `uniqueItems` because the TypeScript generator would turn the field into a `Set`, which does not survive a server-action boundary — the server-side schema enforces uniqueness.\n",
18736
+ "items" : {
18737
+ "enum" : [ "general_public", "customers", "employees", "experts" ],
18738
+ "type" : "string"
18739
+ },
18740
+ "maxItems" : 4,
18741
+ "minItems" : 1,
18742
+ "type" : "array"
18743
+ },
18744
+ "answerStyle" : {
18745
+ "default" : "concise",
18746
+ "description" : "Omit it when `notes.answerStyle` is given. Defaults to `concise`.",
18747
+ "enum" : [ "concise", "detailed", "step_by_step" ],
18748
+ "type" : "string"
18749
+ },
18750
+ "sourcePolicy" : {
18751
+ "default" : "provided_only",
18752
+ "description" : "Omit it when `notes.sourcePolicy` is given. Defaults to `provided_only`.",
18753
+ "enum" : [ "provided_only", "provided_and_general" ],
18754
+ "type" : "string"
18755
+ },
18756
+ "notes" : {
18757
+ "$ref" : "#/components/schemas/AgentPromptInitGenerationRequest_notes"
18758
+ },
18759
+ "constraints" : {
18760
+ "description" : "What the agent must never do.",
18761
+ "maxLength" : 600,
18762
+ "type" : "string"
18763
+ },
18764
+ "lang" : {
18765
+ "description" : "Language the instructions are written in. Defaults to the agent's.",
18766
+ "pattern" : "^[a-z]{2}$",
18767
+ "type" : "string"
18768
+ },
18769
+ "providerId" : {
18770
+ "description" : "Engine to write with, instead of the agent's. Must belong to the agent's organisation. Only honoured together with `model`.\n",
18771
+ "type" : "string"
18772
+ },
18773
+ "model" : {
18774
+ "description" : "Model id within `providerId`.",
18775
+ "type" : "string"
18776
+ }
18777
+ },
18778
+ "required" : [ "mission" ],
18779
+ "type" : "object"
18780
+ },
18781
+ "AgentPromptInitGenerationResponse" : {
18782
+ "properties" : {
18783
+ "promptInit" : {
18784
+ "maxLength" : 50000,
18785
+ "minLength" : 50,
18786
+ "type" : "string"
18787
+ },
18788
+ "warnings" : {
18789
+ "description" : "Adjustments applied to the model's output, for information only.",
18790
+ "items" : {
18791
+ "type" : "string"
18792
+ },
18793
+ "type" : "array"
18794
+ }
18795
+ },
18796
+ "required" : [ "promptInit" ],
18797
+ "type" : "object"
18798
+ },
18667
18799
  "AgentToolAllowedMethodsRequest" : {
18668
18800
  "properties" : {
18669
18801
  "allowedMethods" : {
@@ -26915,6 +27047,25 @@
26915
27047
  "required" : [ "x", "y" ],
26916
27048
  "type" : "object"
26917
27049
  },
27050
+ "AgentPromptInitGenerationRequest_notes" : {
27051
+ "additionalProperties" : false,
27052
+ "description" : "What the user wrote themselves when no preset fitted, per question. A note REPLACES the presets of its own question rather than adding to them.\n",
27053
+ "properties" : {
27054
+ "audience" : {
27055
+ "maxLength" : 300,
27056
+ "type" : "string"
27057
+ },
27058
+ "answerStyle" : {
27059
+ "maxLength" : 300,
27060
+ "type" : "string"
27061
+ },
27062
+ "sourcePolicy" : {
27063
+ "maxLength" : 300,
27064
+ "type" : "string"
27065
+ }
27066
+ },
27067
+ "type" : "object"
27068
+ },
26918
27069
  "ChatMessage_audio_inner" : {
26919
27070
  "properties" : {
26920
27071
  "sequence" : {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breign/client",
3
- "version": "1.0.163",
3
+ "version": "1.0.164",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",