@breign/client 1.0.162 → 1.0.163

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 { AgentChatOverviewEntryUio, AttachmentCreateRequestUio, AttachmentCreateResponseUio, AttachmentDetailsResponseUio, AttachmentProcessedRequestUio, BodyWithMessageUio, ContextLocationRequestUio, ContextUio, ConversationSummaryUio, CreateCustomVariable200ResponseUio, HumanRequestAnswerResultUio, HumanRequestAnswerUio, HumanRequestSummaryUio, MarkConversationReadRequestUio, MessageAnonymizationUio, SetUserAgentConversationRequestUio, ToolCallResultRequestUio, ToolCallResultResponseUio, ToolCallsResponseUio, UpdateConversationTitleRequestUio, UpdateUserChatPreferencesRequestUio, UserChatPreferencesUio, WorkspaceFileContentUio, WorkspaceFileEntryUio, WorkspaceFileWriteRequestUio } from '../models/index';
13
+ import type { AgentChatOverviewEntryUio, AttachmentCreateRequestUio, AttachmentCreateResponseUio, AttachmentDetailsResponseUio, AttachmentProcessedRequestUio, BodyWithMessageUio, ChatSessionSummaryUio, ContextLocationRequestUio, ContextUio, ConversationSummaryUio, CreateCustomVariable200ResponseUio, HumanRequestAnswerResultUio, HumanRequestAnswerUio, HumanRequestSummaryUio, MarkConversationReadRequestUio, MessageAnonymizationUio, SetUserAgentConversationRequestUio, ToolCallResultRequestUio, ToolCallResultResponseUio, ToolCallsResponseUio, UpdateConversationTitleRequestUio, UpdateUserChatPreferencesRequestUio, UserChatPreferencesUio, WorkspaceFileContentUio, WorkspaceFileEntryUio, WorkspaceFileWriteRequestUio } from '../models/index';
14
14
  export interface AnswerHumanRequestRequest {
15
15
  callId: string;
16
16
  humanRequestAnswerUio: HumanRequestAnswerUio;
@@ -49,6 +49,7 @@ export interface EditConversationWorkspaceFileContentRequest {
49
49
  }
50
50
  export interface GetAgentChatOverviewRequest {
51
51
  organizationId: string;
52
+ recent?: number;
52
53
  }
53
54
  export interface GetAnonymizedMessagesRequest {
54
55
  conversationId: string;
@@ -89,6 +90,13 @@ export interface ListMessageToolCallsRequest {
89
90
  export interface ListPendingHumanRequestsRequest {
90
91
  organizationId: string;
91
92
  }
93
+ export interface ListUserAgentConversationsRequest {
94
+ organizationId: string;
95
+ agentId: string;
96
+ page?: number;
97
+ limit?: number;
98
+ unreadOnly?: boolean;
99
+ }
92
100
  export interface MarkAttachmentProcessedRequest {
93
101
  conversationId: string;
94
102
  attachmentId: string;
@@ -226,15 +234,15 @@ export declare class ConversationsApi extends runtime.BaseAPI {
226
234
  */
227
235
  editConversationWorkspaceFileContent(conversationId: string, workspaceFileWriteRequestUio: WorkspaceFileWriteRequestUio, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkspaceFileContentUio>;
228
236
  /**
229
- * Pour chaque agent de l\'organisation avec lequel l\'utilisateur a une conversation, renvoie sa conversation la plus récente, le nombre de messages non lus et l\'indication d\'une réponse en cours de génération.
237
+ * Pour chaque agent de l\'organisation avec lequel l\'utilisateur a une conversation, renvoie sa conversation la plus récente, le nombre de messages non lus et l\'indication d\'une réponse en cours de génération, ainsi que les totaux sur l\'ensemble de ses sessions et ses sessions les plus récentes.
230
238
  * Get the multi-agent chat overview
231
239
  */
232
240
  getAgentChatOverviewRaw(requestParameters: GetAgentChatOverviewRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<AgentChatOverviewEntryUio>>>;
233
241
  /**
234
- * Pour chaque agent de l\'organisation avec lequel l\'utilisateur a une conversation, renvoie sa conversation la plus récente, le nombre de messages non lus et l\'indication d\'une réponse en cours de génération.
242
+ * Pour chaque agent de l\'organisation avec lequel l\'utilisateur a une conversation, renvoie sa conversation la plus récente, le nombre de messages non lus et l\'indication d\'une réponse en cours de génération, ainsi que les totaux sur l\'ensemble de ses sessions et ses sessions les plus récentes.
235
243
  * Get the multi-agent chat overview
236
244
  */
237
- getAgentChatOverview(organizationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AgentChatOverviewEntryUio>>;
245
+ getAgentChatOverview(organizationId: string, recent?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AgentChatOverviewEntryUio>>;
238
246
  /**
239
247
  * Retrieve the list of anonymized messages for a given conversation.
240
248
  * Get the anonymized messages of a conversation
@@ -339,6 +347,16 @@ export declare class ConversationsApi extends runtime.BaseAPI {
339
347
  * List the questions waiting for the current user
340
348
  */
341
349
  listPendingHumanRequests(organizationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<HumanRequestSummaryUio>>;
350
+ /**
351
+ * Sessions de chat de l\'utilisateur courant avec cet agent, de la plus récemment active à la plus ancienne. Chaque session porte son nombre de non-lus, un aperçu du dernier message et l\'indication qu\'elle est la conversation principale (celle mémorisée par setUserAgentConversation).
352
+ * List the current user\'s sessions with an agent
353
+ */
354
+ listUserAgentConversationsRaw(requestParameters: ListUserAgentConversationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ChatSessionSummaryUio>>>;
355
+ /**
356
+ * Sessions de chat de l\'utilisateur courant avec cet agent, de la plus récemment active à la plus ancienne. Chaque session porte son nombre de non-lus, un aperçu du dernier message et l\'indication qu\'elle est la conversation principale (celle mémorisée par setUserAgentConversation).
357
+ * List the current user\'s sessions with an agent
358
+ */
359
+ listUserAgentConversations(organizationId: string, agentId: string, page?: number, limit?: number, unreadOnly?: boolean, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ChatSessionSummaryUio>>;
342
360
  /**
343
361
  * Internal callback endpoint called when attachment processing is complete. Réservé au service de documents : tout autre appelant reçoit un 403. L\'attachment doit être en état `PROCESSING`.
344
362
  * Mark a conversation attachment as processed
@@ -342,7 +342,7 @@ class ConversationsApi extends runtime.BaseAPI {
342
342
  return await response.value();
343
343
  }
344
344
  /**
345
- * Pour chaque agent de l\'organisation avec lequel l\'utilisateur a une conversation, renvoie sa conversation la plus récente, le nombre de messages non lus et l\'indication d\'une réponse en cours de génération.
345
+ * Pour chaque agent de l\'organisation avec lequel l\'utilisateur a une conversation, renvoie sa conversation la plus récente, le nombre de messages non lus et l\'indication d\'une réponse en cours de génération, ainsi que les totaux sur l\'ensemble de ses sessions et ses sessions les plus récentes.
346
346
  * Get the multi-agent chat overview
347
347
  */
348
348
  async getAgentChatOverviewRaw(requestParameters, initOverrides) {
@@ -350,6 +350,9 @@ class ConversationsApi extends runtime.BaseAPI {
350
350
  throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling getAgentChatOverview().');
351
351
  }
352
352
  const queryParameters = {};
353
+ if (requestParameters['recent'] != null) {
354
+ queryParameters['recent'] = requestParameters['recent'];
355
+ }
353
356
  const headerParameters = {};
354
357
  if (this.configuration && this.configuration.apiKey) {
355
358
  headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
@@ -363,11 +366,11 @@ class ConversationsApi extends runtime.BaseAPI {
363
366
  return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.AgentChatOverviewEntryUioFromJSON));
364
367
  }
365
368
  /**
366
- * Pour chaque agent de l\'organisation avec lequel l\'utilisateur a une conversation, renvoie sa conversation la plus récente, le nombre de messages non lus et l\'indication d\'une réponse en cours de génération.
369
+ * Pour chaque agent de l\'organisation avec lequel l\'utilisateur a une conversation, renvoie sa conversation la plus récente, le nombre de messages non lus et l\'indication d\'une réponse en cours de génération, ainsi que les totaux sur l\'ensemble de ses sessions et ses sessions les plus récentes.
367
370
  * Get the multi-agent chat overview
368
371
  */
369
- async getAgentChatOverview(organizationId, initOverrides) {
370
- const response = await this.getAgentChatOverviewRaw({ organizationId: organizationId }, initOverrides);
372
+ async getAgentChatOverview(organizationId, recent, initOverrides) {
373
+ const response = await this.getAgentChatOverviewRaw({ organizationId: organizationId, recent: recent }, initOverrides);
371
374
  return await response.value();
372
375
  }
373
376
  /**
@@ -693,6 +696,47 @@ class ConversationsApi extends runtime.BaseAPI {
693
696
  const response = await this.listPendingHumanRequestsRaw({ organizationId: organizationId }, initOverrides);
694
697
  return await response.value();
695
698
  }
699
+ /**
700
+ * Sessions de chat de l\'utilisateur courant avec cet agent, de la plus récemment active à la plus ancienne. Chaque session porte son nombre de non-lus, un aperçu du dernier message et l\'indication qu\'elle est la conversation principale (celle mémorisée par setUserAgentConversation).
701
+ * List the current user\'s sessions with an agent
702
+ */
703
+ async listUserAgentConversationsRaw(requestParameters, initOverrides) {
704
+ if (requestParameters['organizationId'] == null) {
705
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling listUserAgentConversations().');
706
+ }
707
+ if (requestParameters['agentId'] == null) {
708
+ throw new runtime.RequiredError('agentId', 'Required parameter "agentId" was null or undefined when calling listUserAgentConversations().');
709
+ }
710
+ const queryParameters = {};
711
+ if (requestParameters['page'] != null) {
712
+ queryParameters['page'] = requestParameters['page'];
713
+ }
714
+ if (requestParameters['limit'] != null) {
715
+ queryParameters['limit'] = requestParameters['limit'];
716
+ }
717
+ if (requestParameters['unreadOnly'] != null) {
718
+ queryParameters['unreadOnly'] = requestParameters['unreadOnly'];
719
+ }
720
+ const headerParameters = {};
721
+ if (this.configuration && this.configuration.apiKey) {
722
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
723
+ }
724
+ const response = await this.request({
725
+ path: `/organizations/{organizationId}/chat/agents/{agentId}/conversations`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))).replace(`{${"agentId"}}`, encodeURIComponent(String(requestParameters['agentId']))),
726
+ method: 'GET',
727
+ headers: headerParameters,
728
+ query: queryParameters,
729
+ }, initOverrides);
730
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.ChatSessionSummaryUioFromJSON));
731
+ }
732
+ /**
733
+ * Sessions de chat de l\'utilisateur courant avec cet agent, de la plus récemment active à la plus ancienne. Chaque session porte son nombre de non-lus, un aperçu du dernier message et l\'indication qu\'elle est la conversation principale (celle mémorisée par setUserAgentConversation).
734
+ * List the current user\'s sessions with an agent
735
+ */
736
+ async listUserAgentConversations(organizationId, agentId, page, limit, unreadOnly, initOverrides) {
737
+ const response = await this.listUserAgentConversationsRaw({ organizationId: organizationId, agentId: agentId, page: page, limit: limit, unreadOnly: unreadOnly }, initOverrides);
738
+ return await response.value();
739
+ }
696
740
  /**
697
741
  * Internal callback endpoint called when attachment processing is complete. Réservé au service de documents : tout autre appelant reçoit un 403. L\'attachment doit être en état `PROCESSING`.
698
742
  * Mark a conversation attachment as processed
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { ChatSessionSummaryUio } from './ChatSessionSummaryUio';
12
13
  /**
13
14
  * État de la conversation d'un agent pour l'utilisateur courant. Le nombre de non-lus est dérivé des messages postérieurs à sa marque de lecture.
14
15
  * @export
@@ -34,7 +35,7 @@ export interface AgentChatOverviewEntryUio {
34
35
  */
35
36
  lastMessageAt?: string | null;
36
37
  /**
37
- * Messages non lus, hors messages de l'utilisateur lui-même
38
+ * Non-lus de cette conversation : messages de l'agent postérieurs à la marque de lecture, et interactions qui attendent l'utilisateur (question Human_ask, validation d'outil) tant qu'elles ne sont pas traitées.
38
39
  * @type {number}
39
40
  * @memberof AgentChatOverviewEntryUio
40
41
  */
@@ -51,6 +52,24 @@ export interface AgentChatOverviewEntryUio {
51
52
  * @memberof AgentChatOverviewEntryUio
52
53
  */
53
54
  pendingHumanRequests?: number;
55
+ /**
56
+ * Somme des non-lus sur toutes les sessions de l'utilisateur avec cet agent
57
+ * @type {number}
58
+ * @memberof AgentChatOverviewEntryUio
59
+ */
60
+ totalUnreadCount?: number;
61
+ /**
62
+ * Nombre de sessions de l'utilisateur avec cet agent
63
+ * @type {number}
64
+ * @memberof AgentChatOverviewEntryUio
65
+ */
66
+ sessionCount?: number;
67
+ /**
68
+ * Sessions les plus récemment actives, conversation principale comprise
69
+ * @type {Array<ChatSessionSummaryUio>}
70
+ * @memberof AgentChatOverviewEntryUio
71
+ */
72
+ recentSessions?: Array<ChatSessionSummaryUio>;
54
73
  }
55
74
  /**
56
75
  * Check if a given object implements the AgentChatOverviewEntryUio interface.
@@ -18,6 +18,7 @@ exports.AgentChatOverviewEntryUioFromJSON = AgentChatOverviewEntryUioFromJSON;
18
18
  exports.AgentChatOverviewEntryUioFromJSONTyped = AgentChatOverviewEntryUioFromJSONTyped;
19
19
  exports.AgentChatOverviewEntryUioToJSON = AgentChatOverviewEntryUioToJSON;
20
20
  exports.AgentChatOverviewEntryUioToJSONTyped = AgentChatOverviewEntryUioToJSONTyped;
21
+ const ChatSessionSummaryUio_1 = require("./ChatSessionSummaryUio");
21
22
  /**
22
23
  * Check if a given object implements the AgentChatOverviewEntryUio interface.
23
24
  */
@@ -46,6 +47,9 @@ function AgentChatOverviewEntryUioFromJSONTyped(json, ignoreDiscriminator) {
46
47
  'unreadCount': json['unreadCount'],
47
48
  'isGenerating': json['isGenerating'],
48
49
  'pendingHumanRequests': json['pendingHumanRequests'] == null ? undefined : json['pendingHumanRequests'],
50
+ 'totalUnreadCount': json['totalUnreadCount'] == null ? undefined : json['totalUnreadCount'],
51
+ 'sessionCount': json['sessionCount'] == null ? undefined : json['sessionCount'],
52
+ 'recentSessions': json['recentSessions'] == null ? undefined : (json['recentSessions'].map(ChatSessionSummaryUio_1.ChatSessionSummaryUioFromJSON)),
49
53
  };
50
54
  }
51
55
  function AgentChatOverviewEntryUioToJSON(json) {
@@ -62,5 +66,8 @@ function AgentChatOverviewEntryUioToJSONTyped(value, ignoreDiscriminator = false
62
66
  'unreadCount': value['unreadCount'],
63
67
  'isGenerating': value['isGenerating'],
64
68
  'pendingHumanRequests': value['pendingHumanRequests'],
69
+ 'totalUnreadCount': value['totalUnreadCount'],
70
+ 'sessionCount': value['sessionCount'],
71
+ 'recentSessions': value['recentSessions'] == null ? undefined : (value['recentSessions'].map(ChatSessionSummaryUio_1.ChatSessionSummaryUioToJSON)),
65
72
  };
66
73
  }
@@ -0,0 +1,46 @@
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 ChatSessionSummaryLastMessagePreviewUio
16
+ */
17
+ export interface ChatSessionSummaryLastMessagePreviewUio {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof ChatSessionSummaryLastMessagePreviewUio
22
+ */
23
+ role: ChatSessionSummaryLastMessagePreviewUioRoleEnum;
24
+ /**
25
+ * Début du dernier message, tronqué
26
+ * @type {string}
27
+ * @memberof ChatSessionSummaryLastMessagePreviewUio
28
+ */
29
+ content: string;
30
+ }
31
+ /**
32
+ * @export
33
+ */
34
+ export declare const ChatSessionSummaryLastMessagePreviewUioRoleEnum: {
35
+ readonly User: "USER";
36
+ readonly Assistant: "ASSISTANT";
37
+ };
38
+ export type ChatSessionSummaryLastMessagePreviewUioRoleEnum = typeof ChatSessionSummaryLastMessagePreviewUioRoleEnum[keyof typeof ChatSessionSummaryLastMessagePreviewUioRoleEnum];
39
+ /**
40
+ * Check if a given object implements the ChatSessionSummaryLastMessagePreviewUio interface.
41
+ */
42
+ export declare function instanceOfChatSessionSummaryLastMessagePreviewUio(value: object): value is ChatSessionSummaryLastMessagePreviewUio;
43
+ export declare function ChatSessionSummaryLastMessagePreviewUioFromJSON(json: any): ChatSessionSummaryLastMessagePreviewUio;
44
+ export declare function ChatSessionSummaryLastMessagePreviewUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatSessionSummaryLastMessagePreviewUio;
45
+ export declare function ChatSessionSummaryLastMessagePreviewUioToJSON(json: any): ChatSessionSummaryLastMessagePreviewUio;
46
+ export declare function ChatSessionSummaryLastMessagePreviewUioToJSONTyped(value?: ChatSessionSummaryLastMessagePreviewUio | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,62 @@
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.ChatSessionSummaryLastMessagePreviewUioRoleEnum = void 0;
17
+ exports.instanceOfChatSessionSummaryLastMessagePreviewUio = instanceOfChatSessionSummaryLastMessagePreviewUio;
18
+ exports.ChatSessionSummaryLastMessagePreviewUioFromJSON = ChatSessionSummaryLastMessagePreviewUioFromJSON;
19
+ exports.ChatSessionSummaryLastMessagePreviewUioFromJSONTyped = ChatSessionSummaryLastMessagePreviewUioFromJSONTyped;
20
+ exports.ChatSessionSummaryLastMessagePreviewUioToJSON = ChatSessionSummaryLastMessagePreviewUioToJSON;
21
+ exports.ChatSessionSummaryLastMessagePreviewUioToJSONTyped = ChatSessionSummaryLastMessagePreviewUioToJSONTyped;
22
+ /**
23
+ * @export
24
+ */
25
+ exports.ChatSessionSummaryLastMessagePreviewUioRoleEnum = {
26
+ User: 'USER',
27
+ Assistant: 'ASSISTANT'
28
+ };
29
+ /**
30
+ * Check if a given object implements the ChatSessionSummaryLastMessagePreviewUio interface.
31
+ */
32
+ function instanceOfChatSessionSummaryLastMessagePreviewUio(value) {
33
+ if (!('role' in value) || value['role'] === undefined)
34
+ return false;
35
+ if (!('content' in value) || value['content'] === undefined)
36
+ return false;
37
+ return true;
38
+ }
39
+ function ChatSessionSummaryLastMessagePreviewUioFromJSON(json) {
40
+ return ChatSessionSummaryLastMessagePreviewUioFromJSONTyped(json, false);
41
+ }
42
+ function ChatSessionSummaryLastMessagePreviewUioFromJSONTyped(json, ignoreDiscriminator) {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+ 'role': json['role'],
48
+ 'content': json['content'],
49
+ };
50
+ }
51
+ function ChatSessionSummaryLastMessagePreviewUioToJSON(json) {
52
+ return ChatSessionSummaryLastMessagePreviewUioToJSONTyped(json, false);
53
+ }
54
+ function ChatSessionSummaryLastMessagePreviewUioToJSONTyped(value, ignoreDiscriminator = false) {
55
+ if (value == null) {
56
+ return value;
57
+ }
58
+ return {
59
+ 'role': value['role'],
60
+ 'content': value['content'],
61
+ };
62
+ }
@@ -0,0 +1,87 @@
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 { ChatSessionSummaryLastMessagePreviewUio } from './ChatSessionSummaryLastMessagePreviewUio';
13
+ /**
14
+ * Une session de chat de l'utilisateur courant avec un agent.
15
+ * @export
16
+ * @interface ChatSessionSummaryUio
17
+ */
18
+ export interface ChatSessionSummaryUio {
19
+ /**
20
+ *
21
+ * @type {string}
22
+ * @memberof ChatSessionSummaryUio
23
+ */
24
+ id: string;
25
+ /**
26
+ *
27
+ * @type {string}
28
+ * @memberof ChatSessionSummaryUio
29
+ */
30
+ agentId: string;
31
+ /**
32
+ * Titre de la session ; à défaut, le premier message tronqué
33
+ * @type {string}
34
+ * @memberof ChatSessionSummaryUio
35
+ */
36
+ title: string | null;
37
+ /**
38
+ *
39
+ * @type {string}
40
+ * @memberof ChatSessionSummaryUio
41
+ */
42
+ createdAt: string;
43
+ /**
44
+ * Horodatage du dernier message, null si la session est vide
45
+ * @type {string}
46
+ * @memberof ChatSessionSummaryUio
47
+ */
48
+ lastMessageAt: string | null;
49
+ /**
50
+ *
51
+ * @type {ChatSessionSummaryLastMessagePreviewUio}
52
+ * @memberof ChatSessionSummaryUio
53
+ */
54
+ lastMessagePreview?: ChatSessionSummaryLastMessagePreviewUio | null;
55
+ /**
56
+ * Même définition que AgentChatOverviewEntry.unreadCount
57
+ * @type {number}
58
+ * @memberof ChatSessionSummaryUio
59
+ */
60
+ unreadCount: number;
61
+ /**
62
+ *
63
+ * @type {boolean}
64
+ * @memberof ChatSessionSummaryUio
65
+ */
66
+ isGenerating: boolean;
67
+ /**
68
+ * Vrai si c'est la conversation principale de l'utilisateur avec cet agent
69
+ * @type {boolean}
70
+ * @memberof ChatSessionSummaryUio
71
+ */
72
+ isMain: boolean;
73
+ /**
74
+ * Questions Human_ask en attente dans cette session
75
+ * @type {number}
76
+ * @memberof ChatSessionSummaryUio
77
+ */
78
+ pendingHumanRequests: number;
79
+ }
80
+ /**
81
+ * Check if a given object implements the ChatSessionSummaryUio interface.
82
+ */
83
+ export declare function instanceOfChatSessionSummaryUio(value: object): value is ChatSessionSummaryUio;
84
+ export declare function ChatSessionSummaryUioFromJSON(json: any): ChatSessionSummaryUio;
85
+ export declare function ChatSessionSummaryUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatSessionSummaryUio;
86
+ export declare function ChatSessionSummaryUioToJSON(json: any): ChatSessionSummaryUio;
87
+ export declare function ChatSessionSummaryUioToJSONTyped(value?: ChatSessionSummaryUio | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,85 @@
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.instanceOfChatSessionSummaryUio = instanceOfChatSessionSummaryUio;
17
+ exports.ChatSessionSummaryUioFromJSON = ChatSessionSummaryUioFromJSON;
18
+ exports.ChatSessionSummaryUioFromJSONTyped = ChatSessionSummaryUioFromJSONTyped;
19
+ exports.ChatSessionSummaryUioToJSON = ChatSessionSummaryUioToJSON;
20
+ exports.ChatSessionSummaryUioToJSONTyped = ChatSessionSummaryUioToJSONTyped;
21
+ const ChatSessionSummaryLastMessagePreviewUio_1 = require("./ChatSessionSummaryLastMessagePreviewUio");
22
+ /**
23
+ * Check if a given object implements the ChatSessionSummaryUio interface.
24
+ */
25
+ function instanceOfChatSessionSummaryUio(value) {
26
+ if (!('id' in value) || value['id'] === undefined)
27
+ return false;
28
+ if (!('agentId' in value) || value['agentId'] === undefined)
29
+ return false;
30
+ if (!('title' in value) || value['title'] === undefined)
31
+ return false;
32
+ if (!('createdAt' in value) || value['createdAt'] === undefined)
33
+ return false;
34
+ if (!('lastMessageAt' in value) || value['lastMessageAt'] === undefined)
35
+ return false;
36
+ if (!('unreadCount' in value) || value['unreadCount'] === undefined)
37
+ return false;
38
+ if (!('isGenerating' in value) || value['isGenerating'] === undefined)
39
+ return false;
40
+ if (!('isMain' in value) || value['isMain'] === undefined)
41
+ return false;
42
+ if (!('pendingHumanRequests' in value) || value['pendingHumanRequests'] === undefined)
43
+ return false;
44
+ return true;
45
+ }
46
+ function ChatSessionSummaryUioFromJSON(json) {
47
+ return ChatSessionSummaryUioFromJSONTyped(json, false);
48
+ }
49
+ function ChatSessionSummaryUioFromJSONTyped(json, ignoreDiscriminator) {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+ 'id': json['id'],
55
+ 'agentId': json['agentId'],
56
+ 'title': json['title'],
57
+ 'createdAt': json['createdAt'],
58
+ 'lastMessageAt': json['lastMessageAt'],
59
+ 'lastMessagePreview': json['lastMessagePreview'] == null ? undefined : (0, ChatSessionSummaryLastMessagePreviewUio_1.ChatSessionSummaryLastMessagePreviewUioFromJSON)(json['lastMessagePreview']),
60
+ 'unreadCount': json['unreadCount'],
61
+ 'isGenerating': json['isGenerating'],
62
+ 'isMain': json['isMain'],
63
+ 'pendingHumanRequests': json['pendingHumanRequests'],
64
+ };
65
+ }
66
+ function ChatSessionSummaryUioToJSON(json) {
67
+ return ChatSessionSummaryUioToJSONTyped(json, false);
68
+ }
69
+ function ChatSessionSummaryUioToJSONTyped(value, ignoreDiscriminator = false) {
70
+ if (value == null) {
71
+ return value;
72
+ }
73
+ return {
74
+ 'id': value['id'],
75
+ 'agentId': value['agentId'],
76
+ 'title': value['title'],
77
+ 'createdAt': value['createdAt'],
78
+ 'lastMessageAt': value['lastMessageAt'],
79
+ 'lastMessagePreview': (0, ChatSessionSummaryLastMessagePreviewUio_1.ChatSessionSummaryLastMessagePreviewUioToJSON)(value['lastMessagePreview']),
80
+ 'unreadCount': value['unreadCount'],
81
+ 'isGenerating': value['isGenerating'],
82
+ 'isMain': value['isMain'],
83
+ 'pendingHumanRequests': value['pendingHumanRequests'],
84
+ };
85
+ }
@@ -167,6 +167,8 @@ export * from './ChatMessageAudioInnerUio';
167
167
  export * from './ChatMessageRoleUio';
168
168
  export * from './ChatMessageStreamUio';
169
169
  export * from './ChatMessageUio';
170
+ export * from './ChatSessionSummaryLastMessagePreviewUio';
171
+ export * from './ChatSessionSummaryUio';
170
172
  export * from './ChatUio';
171
173
  export * from './ChunkContentCreateUio';
172
174
  export * from './ChunkContentUio';
@@ -185,6 +185,8 @@ __exportStar(require("./ChatMessageAudioInnerUio"), exports);
185
185
  __exportStar(require("./ChatMessageRoleUio"), exports);
186
186
  __exportStar(require("./ChatMessageStreamUio"), exports);
187
187
  __exportStar(require("./ChatMessageUio"), exports);
188
+ __exportStar(require("./ChatSessionSummaryLastMessagePreviewUio"), exports);
189
+ __exportStar(require("./ChatSessionSummaryUio"), exports);
188
190
  __exportStar(require("./ChatUio"), exports);
189
191
  __exportStar(require("./ChunkContentCreateUio"), exports);
190
192
  __exportStar(require("./ChunkContentUio"), exports);
package/dist/openapi.json CHANGED
@@ -5449,9 +5449,109 @@
5449
5449
  "tags" : [ "conversations" ]
5450
5450
  }
5451
5451
  },
5452
+ "/organizations/{organizationId}/chat/agents/{agentId}/conversations" : {
5453
+ "get" : {
5454
+ "description" : "Sessions de chat de l'utilisateur courant avec cet agent, de la plus récemment active à la plus ancienne. Chaque session porte son nombre de non-lus, un aperçu du dernier message et l'indication qu'elle est la conversation principale (celle mémorisée par setUserAgentConversation).",
5455
+ "operationId" : "listUserAgentConversations",
5456
+ "parameters" : [ {
5457
+ "description" : "ID of the organization",
5458
+ "in" : "path",
5459
+ "name" : "organizationId",
5460
+ "required" : true,
5461
+ "schema" : {
5462
+ "type" : "string"
5463
+ }
5464
+ }, {
5465
+ "description" : "ID of the agent",
5466
+ "in" : "path",
5467
+ "name" : "agentId",
5468
+ "required" : true,
5469
+ "schema" : {
5470
+ "format" : "uuid",
5471
+ "type" : "string"
5472
+ }
5473
+ }, {
5474
+ "description" : "Page number (1-based). Must be used together with limit.",
5475
+ "in" : "query",
5476
+ "name" : "page",
5477
+ "required" : false,
5478
+ "schema" : {
5479
+ "minimum" : 1,
5480
+ "type" : "integer"
5481
+ }
5482
+ }, {
5483
+ "description" : "Number of sessions per page. Must be used together with page.",
5484
+ "in" : "query",
5485
+ "name" : "limit",
5486
+ "required" : false,
5487
+ "schema" : {
5488
+ "maximum" : 100,
5489
+ "minimum" : 1,
5490
+ "type" : "integer"
5491
+ }
5492
+ }, {
5493
+ "description" : "Ne renvoie que les sessions ayant des non-lus",
5494
+ "in" : "query",
5495
+ "name" : "unreadOnly",
5496
+ "required" : false,
5497
+ "schema" : {
5498
+ "type" : "boolean"
5499
+ }
5500
+ } ],
5501
+ "responses" : {
5502
+ "200" : {
5503
+ "content" : {
5504
+ "application/json" : {
5505
+ "schema" : {
5506
+ "items" : {
5507
+ "$ref" : "#/components/schemas/ChatSessionSummary"
5508
+ },
5509
+ "type" : "array"
5510
+ }
5511
+ }
5512
+ },
5513
+ "description" : "Sessions retrieved successfully",
5514
+ "headers" : {
5515
+ "X-Total-Count" : {
5516
+ "description" : "Total number of sessions matching the filters",
5517
+ "schema" : {
5518
+ "type" : "integer"
5519
+ }
5520
+ },
5521
+ "X-Page" : {
5522
+ "description" : "Current page number",
5523
+ "schema" : {
5524
+ "type" : "integer"
5525
+ }
5526
+ },
5527
+ "X-Limit" : {
5528
+ "description" : "Number of items per page",
5529
+ "schema" : {
5530
+ "type" : "integer"
5531
+ }
5532
+ },
5533
+ "X-Total-Pages" : {
5534
+ "description" : "Total number of pages",
5535
+ "schema" : {
5536
+ "type" : "integer"
5537
+ }
5538
+ }
5539
+ }
5540
+ },
5541
+ "401" : {
5542
+ "description" : "Unauthenticated"
5543
+ },
5544
+ "403" : {
5545
+ "description" : "Forbidden — the caller is not part of the organization or cannot use this agent"
5546
+ }
5547
+ },
5548
+ "summary" : "List the current user's sessions with an agent",
5549
+ "tags" : [ "conversations" ]
5550
+ }
5551
+ },
5452
5552
  "/organizations/{organizationId}/chat/overview" : {
5453
5553
  "get" : {
5454
- "description" : "Pour chaque agent de l'organisation avec lequel l'utilisateur a une conversation, renvoie sa conversation la plus récente, le nombre de messages non lus et l'indication d'une réponse en cours de génération.",
5554
+ "description" : "Pour chaque agent de l'organisation avec lequel l'utilisateur a une conversation, renvoie sa conversation la plus récente, le nombre de messages non lus et l'indication d'une réponse en cours de génération, ainsi que les totaux sur l'ensemble de ses sessions et ses sessions les plus récentes.",
5455
5555
  "operationId" : "getAgentChatOverview",
5456
5556
  "parameters" : [ {
5457
5557
  "description" : "ID of the organization",
@@ -5461,6 +5561,16 @@
5461
5561
  "schema" : {
5462
5562
  "type" : "string"
5463
5563
  }
5564
+ }, {
5565
+ "description" : "Nombre de sessions récentes renvoyées par agent (recentSessions), 5 par défaut",
5566
+ "in" : "query",
5567
+ "name" : "recent",
5568
+ "required" : false,
5569
+ "schema" : {
5570
+ "maximum" : 20,
5571
+ "minimum" : 0,
5572
+ "type" : "integer"
5573
+ }
5464
5574
  } ],
5465
5575
  "responses" : {
5466
5576
  "200" : {
@@ -20598,6 +20708,52 @@
20598
20708
  "required" : [ "conversationId" ],
20599
20709
  "type" : "object"
20600
20710
  },
20711
+ "ChatSessionSummary" : {
20712
+ "description" : "Une session de chat de l'utilisateur courant avec un agent.",
20713
+ "properties" : {
20714
+ "id" : {
20715
+ "format" : "uuid",
20716
+ "type" : "string"
20717
+ },
20718
+ "agentId" : {
20719
+ "format" : "uuid",
20720
+ "type" : "string"
20721
+ },
20722
+ "title" : {
20723
+ "description" : "Titre de la session ; à défaut, le premier message tronqué",
20724
+ "nullable" : true,
20725
+ "type" : "string"
20726
+ },
20727
+ "createdAt" : {
20728
+ "type" : "string"
20729
+ },
20730
+ "lastMessageAt" : {
20731
+ "description" : "Horodatage du dernier message, null si la session est vide",
20732
+ "nullable" : true,
20733
+ "type" : "string"
20734
+ },
20735
+ "lastMessagePreview" : {
20736
+ "$ref" : "#/components/schemas/ChatSessionSummary_lastMessagePreview"
20737
+ },
20738
+ "unreadCount" : {
20739
+ "description" : "Même définition que AgentChatOverviewEntry.unreadCount",
20740
+ "type" : "integer"
20741
+ },
20742
+ "isGenerating" : {
20743
+ "type" : "boolean"
20744
+ },
20745
+ "isMain" : {
20746
+ "description" : "Vrai si c'est la conversation principale de l'utilisateur avec cet agent",
20747
+ "type" : "boolean"
20748
+ },
20749
+ "pendingHumanRequests" : {
20750
+ "description" : "Questions Human_ask en attente dans cette session",
20751
+ "type" : "integer"
20752
+ }
20753
+ },
20754
+ "required" : [ "agentId", "createdAt", "id", "isGenerating", "isMain", "lastMessageAt", "pendingHumanRequests", "title", "unreadCount" ],
20755
+ "type" : "object"
20756
+ },
20601
20757
  "AgentChatOverviewEntry" : {
20602
20758
  "description" : "État de la conversation d'un agent pour l'utilisateur courant. Le nombre de non-lus est dérivé des messages postérieurs à sa marque de lecture.",
20603
20759
  "properties" : {
@@ -20615,7 +20771,7 @@
20615
20771
  "type" : "string"
20616
20772
  },
20617
20773
  "unreadCount" : {
20618
- "description" : "Messages non lus, hors messages de l'utilisateur lui-même",
20774
+ "description" : "Non-lus de cette conversation : messages de l'agent postérieurs à la marque de lecture, et interactions qui attendent l'utilisateur (question Human_ask, validation d'outil) tant qu'elles ne sont pas traitées.",
20619
20775
  "type" : "integer"
20620
20776
  },
20621
20777
  "isGenerating" : {
@@ -20625,6 +20781,21 @@
20625
20781
  "pendingHumanRequests" : {
20626
20782
  "description" : "Questions de cet agent qui attendent une réponse de l'utilisateur courant (outil Human_ask), toutes tâches confondues.",
20627
20783
  "type" : "integer"
20784
+ },
20785
+ "totalUnreadCount" : {
20786
+ "description" : "Somme des non-lus sur toutes les sessions de l'utilisateur avec cet agent",
20787
+ "type" : "integer"
20788
+ },
20789
+ "sessionCount" : {
20790
+ "description" : "Nombre de sessions de l'utilisateur avec cet agent",
20791
+ "type" : "integer"
20792
+ },
20793
+ "recentSessions" : {
20794
+ "description" : "Sessions les plus récemment actives, conversation principale comprise",
20795
+ "items" : {
20796
+ "$ref" : "#/components/schemas/ChatSessionSummary"
20797
+ },
20798
+ "type" : "array"
20628
20799
  }
20629
20800
  },
20630
20801
  "required" : [ "agentId", "conversationId", "isGenerating", "unreadCount" ],
@@ -27313,6 +27484,21 @@
27313
27484
  "required" : [ "contentType", "ext", "size" ],
27314
27485
  "type" : "object"
27315
27486
  },
27487
+ "ChatSessionSummary_lastMessagePreview" : {
27488
+ "nullable" : true,
27489
+ "properties" : {
27490
+ "role" : {
27491
+ "enum" : [ "USER", "ASSISTANT" ],
27492
+ "type" : "string"
27493
+ },
27494
+ "content" : {
27495
+ "description" : "Début du dernier message, tronqué",
27496
+ "type" : "string"
27497
+ }
27498
+ },
27499
+ "required" : [ "content", "role" ],
27500
+ "type" : "object"
27501
+ },
27316
27502
  "HumanRequestSummary_requestedBy" : {
27317
27503
  "properties" : {
27318
27504
  "kind" : {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@breign/client",
3
- "version": "1.0.162",
3
+ "version": "1.0.163",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",