@ubs-platform/superlama-webservice 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_monaembed/@ubs-platform/superlama-entity-mongo/chat-message-model.d.ts +28 -0
- package/_monaembed/@ubs-platform/superlama-entity-mongo/chat-message-model.js +77 -0
- package/_monaembed/@ubs-platform/superlama-entity-mongo/chat-message-model.js.map +1 -0
- package/_monaembed/@ubs-platform/superlama-entity-mongo/chat-session.model.d.ts +20 -0
- package/_monaembed/@ubs-platform/superlama-entity-mongo/chat-session.model.js +48 -0
- package/_monaembed/@ubs-platform/superlama-entity-mongo/chat-session.model.js.map +1 -0
- package/_monaembed/@ubs-platform/superlama-entity-mongo/index.d.ts +3 -0
- package/_monaembed/@ubs-platform/superlama-entity-mongo/index.js +20 -0
- package/_monaembed/@ubs-platform/superlama-entity-mongo/index.js.map +1 -0
- package/_monaembed/@ubs-platform/superlama-entity-mongo/package.json +1 -0
- package/_monaembed/@ubs-platform/superlama-entity-mongo/superlama-entity-mongo.module.d.ts +2 -0
- package/_monaembed/@ubs-platform/superlama-entity-mongo/superlama-entity-mongo.module.js +28 -0
- package/_monaembed/@ubs-platform/superlama-entity-mongo/superlama-entity-mongo.module.js.map +1 -0
- package/controller/llm-models.controller.d.ts +6 -0
- package/controller/llm-models.controller.js +34 -0
- package/controller/llm-models.controller.js.map +1 -0
- package/controller/realtime-chat.controller.d.ts +16 -0
- package/controller/realtime-chat.controller.js +82 -0
- package/controller/realtime-chat.controller.js.map +1 -0
- package/controller/user-sessions.controlller.d.ts +7 -0
- package/controller/user-sessions.controlller.js +42 -0
- package/controller/user-sessions.controlller.js.map +1 -0
- package/index.d.ts +9 -0
- package/index.js +26 -0
- package/index.js.map +1 -0
- package/mapper/chat-message.mapper.d.ts +5 -0
- package/mapper/chat-message.mapper.js +33 -0
- package/mapper/chat-message.mapper.js.map +1 -0
- package/package.json +1 -0
- package/service/llm-operation.service.d.ts +12 -0
- package/service/llm-operation.service.js +126 -0
- package/service/llm-operation.service.js.map +1 -0
- package/service/realtime-chat-feeder.service.d.ts +23 -0
- package/service/realtime-chat-feeder.service.js +217 -0
- package/service/realtime-chat-feeder.service.js.map +1 -0
- package/service/realtime-chat.service.d.ts +19 -0
- package/service/realtime-chat.service.js +95 -0
- package/service/realtime-chat.service.js.map +1 -0
- package/service/session.service.d.ts +11 -0
- package/service/session.service.js +52 -0
- package/service/session.service.js.map +1 -0
- package/superlama-webservice.module.d.ts +2 -0
- package/superlama-webservice.module.js +45 -0
- package/superlama-webservice.module.js.map +1 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ChatMessageSenderType, TextAssitantStage } from '@ubs-platform/superlama-common';
|
|
2
|
+
export declare class ChatMessage {
|
|
3
|
+
_id: String;
|
|
4
|
+
createdAt: Date;
|
|
5
|
+
updatedAt: Date;
|
|
6
|
+
assistantStartedAt: Date;
|
|
7
|
+
assistantFinishedAt: Date;
|
|
8
|
+
tokensPerSecond: number;
|
|
9
|
+
textContent: string;
|
|
10
|
+
requestedLlmModel: string;
|
|
11
|
+
thoughtTextContent: string;
|
|
12
|
+
textAssistantStage: TextAssitantStage;
|
|
13
|
+
systemTextContent: string;
|
|
14
|
+
senderType: ChatMessageSenderType;
|
|
15
|
+
senderId: string;
|
|
16
|
+
sessionId: string;
|
|
17
|
+
moderationNoteWarning: string;
|
|
18
|
+
}
|
|
19
|
+
export type ChatMessageDoc = ChatMessage & Document;
|
|
20
|
+
export declare const ChatMessageSchema: import("mongoose").Schema<ChatMessage, import("mongoose").Model<ChatMessage, any, any, any, import("mongoose").Document<unknown, any, ChatMessage, any, {}> & ChatMessage & Required<{
|
|
21
|
+
_id: String;
|
|
22
|
+
}> & {
|
|
23
|
+
__v: number;
|
|
24
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ChatMessage, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ChatMessage>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<ChatMessage> & Required<{
|
|
25
|
+
_id: String;
|
|
26
|
+
}> & {
|
|
27
|
+
__v: number;
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ChatMessageSchema = exports.ChatMessage = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
let ChatMessage = class ChatMessage {
|
|
15
|
+
};
|
|
16
|
+
exports.ChatMessage = ChatMessage;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, mongoose_1.Prop)({ type: Date }),
|
|
19
|
+
__metadata("design:type", Date)
|
|
20
|
+
], ChatMessage.prototype, "createdAt", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, mongoose_1.Prop)({ type: Date }),
|
|
23
|
+
__metadata("design:type", Date)
|
|
24
|
+
], ChatMessage.prototype, "updatedAt", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, mongoose_1.Prop)({ type: Date }),
|
|
27
|
+
__metadata("design:type", Date)
|
|
28
|
+
], ChatMessage.prototype, "assistantStartedAt", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, mongoose_1.Prop)({ type: Date }),
|
|
31
|
+
__metadata("design:type", Date)
|
|
32
|
+
], ChatMessage.prototype, "assistantFinishedAt", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, mongoose_1.Prop)({ type: Number }),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], ChatMessage.prototype, "tokensPerSecond", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], ChatMessage.prototype, "textContent", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], ChatMessage.prototype, "requestedLlmModel", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], ChatMessage.prototype, "thoughtTextContent", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], ChatMessage.prototype, "textAssistantStage", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], ChatMessage.prototype, "systemTextContent", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], ChatMessage.prototype, "senderType", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], ChatMessage.prototype, "senderId", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], ChatMessage.prototype, "sessionId", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], ChatMessage.prototype, "moderationNoteWarning", void 0);
|
|
73
|
+
exports.ChatMessage = ChatMessage = __decorate([
|
|
74
|
+
(0, mongoose_1.Schema)()
|
|
75
|
+
], ChatMessage);
|
|
76
|
+
exports.ChatMessageSchema = mongoose_1.SchemaFactory.createForClass(ChatMessage);
|
|
77
|
+
//# sourceMappingURL=chat-message-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-message-model.js","sourceRoot":"","sources":["../../../../../libs/superlama-entity-mongo/src/chat-message-model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAOxD,IAAM,WAAW,GAAjB,MAAM,WAAW;CAqBvB,CAAA;AArBY,kCAAW;AAEE;IAArB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BAAY,IAAI;8CAAC;AAChB;IAArB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BAAY,IAAI;8CAAC;AAChB;IAArB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BAAqB,IAAI;uDAAC;AACzB;IAArB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BAAsB,IAAI;wDAAC;AACxB;IAAvB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAyB;AACxB;IAAvB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDAAqB;AACpB;IAAvB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAA2B;AAC1B;IAAvB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAA4B;AAC3B;IAAvB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAAuC;AACtC;IAAvB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAA2B;AAC1B;IAAvB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CAAmC;AAClC;IAAvB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CAAkB;AACjB;IAAvB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAAmB;AAClB;IAAvB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0DAA+B;sBAf7C,WAAW;IADvB,IAAA,iBAAM,GAAE;GACI,WAAW,CAqBvB;AAEY,QAAA,iBAAiB,GAAG,wBAAa,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Document } from 'mongoose';
|
|
2
|
+
export declare class ChatSession {
|
|
3
|
+
_id: string;
|
|
4
|
+
userParticipantsIds: string[];
|
|
5
|
+
moderationNoteWarning: string;
|
|
6
|
+
subjectTitle: string;
|
|
7
|
+
creationDate: Date;
|
|
8
|
+
expirationDate: Date;
|
|
9
|
+
llmAnswerStatus: 'WAITING' | 'CONTINUING' | 'FINISHED';
|
|
10
|
+
}
|
|
11
|
+
export type ChatSessionDoc = ChatSession & Document;
|
|
12
|
+
export declare const ChatSessionSchema: import("mongoose").Schema<ChatSession, import("mongoose").Model<ChatSession, any, any, any, Document<unknown, any, ChatSession, any, {}> & ChatSession & Required<{
|
|
13
|
+
_id: string;
|
|
14
|
+
}> & {
|
|
15
|
+
__v: number;
|
|
16
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ChatSession, Document<unknown, {}, import("mongoose").FlatRecord<ChatSession>, {}, import("mongoose").DefaultSchemaOptions> & import("mongoose").FlatRecord<ChatSession> & Required<{
|
|
17
|
+
_id: string;
|
|
18
|
+
}> & {
|
|
19
|
+
__v: number;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ChatSessionSchema = exports.ChatSession = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
let ChatSession = class ChatSession {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.llmAnswerStatus = 'WAITING';
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.ChatSession = ChatSession;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, mongoose_1.Prop)({ type: [String] }),
|
|
22
|
+
__metadata("design:type", Array)
|
|
23
|
+
], ChatSession.prototype, "userParticipantsIds", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], ChatSession.prototype, "moderationNoteWarning", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], ChatSession.prototype, "subjectTitle", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, mongoose_1.Prop)({ type: Date, default: new Date(Date.now()) }),
|
|
34
|
+
__metadata("design:type", Date)
|
|
35
|
+
], ChatSession.prototype, "creationDate", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, mongoose_1.Prop)({ type: Date, default: new Date(Date.now() + 2629746000) }),
|
|
38
|
+
__metadata("design:type", Date)
|
|
39
|
+
], ChatSession.prototype, "expirationDate", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], ChatSession.prototype, "llmAnswerStatus", void 0);
|
|
44
|
+
exports.ChatSession = ChatSession = __decorate([
|
|
45
|
+
(0, mongoose_1.Schema)()
|
|
46
|
+
], ChatSession);
|
|
47
|
+
exports.ChatSessionSchema = mongoose_1.SchemaFactory.createForClass(ChatSession);
|
|
48
|
+
//# sourceMappingURL=chat-session.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-session.model.js","sourceRoot":"","sources":["../../../../../libs/superlama-entity-mongo/src/chat-session.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAGxD,IAAM,WAAW,GAAjB,MAAM,WAAW;IAAjB;QAWqB,oBAAe,GAGpB,SAAS,CAAC;IACjC,CAAC;CAAA,CAAA;AAfY,kCAAW;AAGpB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;;wDACK;AACN;IAAvB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0DAA+B;AAEtD;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDACF;AAErB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC;8BACtC,IAAI;iDAAC;AAEnB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;8BACjD,IAAI;mDAAC;AACG;IAAvB,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAGM;sBAdpB,WAAW;IADvB,IAAA,iBAAM,GAAE;GACI,WAAW,CAevB;AAEY,QAAA,iBAAiB,GAAG,wBAAa,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./chat-message-model"), exports);
|
|
18
|
+
__exportStar(require("./chat-session.model"), exports);
|
|
19
|
+
__exportStar(require("./superlama-entity-mongo.module"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/superlama-entity-mongo/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,uDAAqC;AACrC,kEAAgD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@ubs-platform/superlama-entity-mongo","version":"1.4.0","description":"","repository":{"type":"git","url":"git+https://github.com/ubs-platform/ubs-mona-mr.git"},"homepage":"https://github.com/ubs-platform/ubs-mona-mr","iksir":{"type":"LIBRARY","libraryMode":"EMBEDDED","buildSubFolder":""},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"ISC","peerDependencies":{"@nestjs/mongoose":"^11.0.1","@nestjs/common":"^11.1.19"}}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SuperlamaEntityMongoModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
12
|
+
const chat_message_model_1 = require("./chat-message-model");
|
|
13
|
+
const chat_session_model_1 = require("./chat-session.model");
|
|
14
|
+
let SuperlamaEntityMongoModule = class SuperlamaEntityMongoModule {
|
|
15
|
+
};
|
|
16
|
+
exports.SuperlamaEntityMongoModule = SuperlamaEntityMongoModule;
|
|
17
|
+
exports.SuperlamaEntityMongoModule = SuperlamaEntityMongoModule = __decorate([
|
|
18
|
+
(0, common_1.Module)({
|
|
19
|
+
imports: [
|
|
20
|
+
mongoose_1.MongooseModule.forFeature([
|
|
21
|
+
{ name: chat_message_model_1.ChatMessage.name, schema: chat_message_model_1.ChatMessageSchema },
|
|
22
|
+
{ name: chat_session_model_1.ChatSession.name, schema: chat_session_model_1.ChatSessionSchema },
|
|
23
|
+
]),
|
|
24
|
+
],
|
|
25
|
+
exports: [mongoose_1.MongooseModule],
|
|
26
|
+
})
|
|
27
|
+
], SuperlamaEntityMongoModule);
|
|
28
|
+
//# sourceMappingURL=superlama-entity-mongo.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superlama-entity-mongo.module.js","sourceRoot":"","sources":["../../../../../libs/superlama-entity-mongo/src/superlama-entity-mongo.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,6DAAsE;AACtE,6DAAsE;AAW/D,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;CAAG,CAAA;AAA7B,gEAA0B;qCAA1B,0BAA0B;IATtC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,yBAAc,CAAC,UAAU,CAAC;gBACxB,EAAE,IAAI,EAAE,gCAAW,CAAC,IAAI,EAAE,MAAM,EAAE,sCAAiB,EAAE;gBACrD,EAAE,IAAI,EAAE,gCAAW,CAAC,IAAI,EAAE,MAAM,EAAE,sCAAiB,EAAE;aACtD,CAAC;SACH;QACD,OAAO,EAAE,CAAC,yBAAc,CAAC;KAC1B,CAAC;GACW,0BAA0B,CAAG"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LlmOperationService } from '../service/llm-operation.service';
|
|
2
|
+
export declare class LlmModelsController {
|
|
3
|
+
private llmOpService;
|
|
4
|
+
constructor(llmOpService: LlmOperationService);
|
|
5
|
+
findMessagesBySessionIdPaged(): Promise<import("@ubs-platform/superlama-common").LlmModelDto[]>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LlmModelsController = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const llm_operation_service_1 = require("../service/llm-operation.service");
|
|
15
|
+
let LlmModelsController = class LlmModelsController {
|
|
16
|
+
constructor(llmOpService) {
|
|
17
|
+
this.llmOpService = llmOpService;
|
|
18
|
+
}
|
|
19
|
+
async findMessagesBySessionIdPaged() {
|
|
20
|
+
return await this.llmOpService.fetchAvailableModels();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.LlmModelsController = LlmModelsController;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, common_1.Get)(),
|
|
26
|
+
__metadata("design:type", Function),
|
|
27
|
+
__metadata("design:paramtypes", []),
|
|
28
|
+
__metadata("design:returntype", Promise)
|
|
29
|
+
], LlmModelsController.prototype, "findMessagesBySessionIdPaged", null);
|
|
30
|
+
exports.LlmModelsController = LlmModelsController = __decorate([
|
|
31
|
+
(0, common_1.Controller)('llm-models'),
|
|
32
|
+
__metadata("design:paramtypes", [llm_operation_service_1.LlmOperationService])
|
|
33
|
+
], LlmModelsController);
|
|
34
|
+
//# sourceMappingURL=llm-models.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-models.controller.js","sourceRoot":"","sources":["../../../../../../libs/superlama-webservice/src/controller/llm-models.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAmE;AAEnE,4EAAuE;AAGhE,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC5B,YAAoB,YAAiC;QAAjC,iBAAY,GAAZ,YAAY,CAAqB;IAAG,CAAC;IAGnD,AAAN,KAAK,CAAC,4BAA4B;QAC9B,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,oBAAoB,EAAE,CAAC;IAC1D,CAAC;CACJ,CAAA;AAPY,kDAAmB;AAItB;IADL,IAAA,YAAG,GAAE;;;;uEAGL;8BANQ,mBAAmB;IAD/B,IAAA,mBAAU,EAAC,YAAY,CAAC;qCAEa,2CAAmB;GAD5C,mBAAmB,CAO/B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MessageEvent } from '@nestjs/common';
|
|
2
|
+
import { RealtimeChatService } from '../service/realtime-chat.service';
|
|
3
|
+
import { UserDTO } from '@ubs-platform/users-common';
|
|
4
|
+
import { ChatMessageStreamDTO, UserSendingMessageDto } from '@ubs-platform/superlama-common';
|
|
5
|
+
import { Observable, Subject } from 'rxjs';
|
|
6
|
+
import { RealtimeChatFeederService } from '../service/realtime-chat-feeder.service';
|
|
7
|
+
export declare class RealtimeChatController {
|
|
8
|
+
private realtimeChatService;
|
|
9
|
+
private rcsFeeder;
|
|
10
|
+
sessionListenStreams: Subject<ChatMessageStreamDTO>;
|
|
11
|
+
constructor(realtimeChatService: RealtimeChatService, rcsFeeder: RealtimeChatFeederService);
|
|
12
|
+
insertUserMessage(message: UserSendingMessageDto, user: UserDTO): Promise<import("@ubs-platform/superlama-common").ChatMessageDTO>;
|
|
13
|
+
findMessagesBySessionIdPaged(sessionId: string, beforeDate?: string, lastChatMessageId?: string): Promise<import("@ubs-platform/superlama-common").ChatMessageDTO[]>;
|
|
14
|
+
llmResulting(a: ChatMessageStreamDTO): Promise<void>;
|
|
15
|
+
sse(sessionId: string): Observable<MessageEvent>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.RealtimeChatController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const realtime_chat_service_1 = require("../service/realtime-chat.service");
|
|
18
|
+
const users_microservice_helper_1 = require("@ubs-platform/users-microservice-helper");
|
|
19
|
+
const rxjs_1 = require("rxjs");
|
|
20
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
21
|
+
const realtime_chat_feeder_service_1 = require("../service/realtime-chat-feeder.service");
|
|
22
|
+
let RealtimeChatController = class RealtimeChatController {
|
|
23
|
+
constructor(realtimeChatService, rcsFeeder) {
|
|
24
|
+
this.realtimeChatService = realtimeChatService;
|
|
25
|
+
this.rcsFeeder = rcsFeeder;
|
|
26
|
+
this.sessionListenStreams = new rxjs_1.Subject();
|
|
27
|
+
}
|
|
28
|
+
async insertUserMessage(message, user) {
|
|
29
|
+
return await this.realtimeChatService.insertUserMessage(message, user);
|
|
30
|
+
}
|
|
31
|
+
async findMessagesBySessionIdPaged(sessionId, beforeDate, lastChatMessageId) {
|
|
32
|
+
return await this.realtimeChatService.findMessagesBySessionIdPaged(sessionId, beforeDate, lastChatMessageId);
|
|
33
|
+
}
|
|
34
|
+
async llmResulting(a) {
|
|
35
|
+
await this.rcsFeeder.saveGeneratedAnswer(a);
|
|
36
|
+
await this.sessionListenStreams.next(a);
|
|
37
|
+
}
|
|
38
|
+
sse(sessionId) {
|
|
39
|
+
return this.sessionListenStreams.pipe((0, rxjs_1.filter)((a) => a.sessionId == sessionId), (0, rxjs_1.map)((a) => ({
|
|
40
|
+
data: a,
|
|
41
|
+
})));
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.RealtimeChatController = RealtimeChatController;
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, common_1.UseGuards)(users_microservice_helper_1.JwtAuthGuard),
|
|
47
|
+
(0, common_1.Post)(),
|
|
48
|
+
__param(0, (0, common_1.Body)()),
|
|
49
|
+
__param(1, (0, users_microservice_helper_1.CurrentUser)()),
|
|
50
|
+
__metadata("design:type", Function),
|
|
51
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
52
|
+
__metadata("design:returntype", Promise)
|
|
53
|
+
], RealtimeChatController.prototype, "insertUserMessage", null);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, common_1.UseGuards)(users_microservice_helper_1.JwtAuthGuard),
|
|
56
|
+
(0, common_1.Get)(),
|
|
57
|
+
__param(0, (0, common_1.Query)('sessionId')),
|
|
58
|
+
__param(1, (0, common_1.Query)('beforeDate')),
|
|
59
|
+
__param(2, (0, common_1.Query)('lastChatMessageId')),
|
|
60
|
+
__metadata("design:type", Function),
|
|
61
|
+
__metadata("design:paramtypes", [String, String, String]),
|
|
62
|
+
__metadata("design:returntype", Promise)
|
|
63
|
+
], RealtimeChatController.prototype, "findMessagesBySessionIdPaged", null);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, microservices_1.EventPattern)('llm-result'),
|
|
66
|
+
__metadata("design:type", Function),
|
|
67
|
+
__metadata("design:paramtypes", [Object]),
|
|
68
|
+
__metadata("design:returntype", Promise)
|
|
69
|
+
], RealtimeChatController.prototype, "llmResulting", null);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, common_1.Sse)('session/:id/listen'),
|
|
72
|
+
__param(0, (0, common_1.Param)('id')),
|
|
73
|
+
__metadata("design:type", Function),
|
|
74
|
+
__metadata("design:paramtypes", [String]),
|
|
75
|
+
__metadata("design:returntype", rxjs_1.Observable)
|
|
76
|
+
], RealtimeChatController.prototype, "sse", null);
|
|
77
|
+
exports.RealtimeChatController = RealtimeChatController = __decorate([
|
|
78
|
+
(0, common_1.Controller)('realtime-chat'),
|
|
79
|
+
__metadata("design:paramtypes", [realtime_chat_service_1.RealtimeChatService,
|
|
80
|
+
realtime_chat_feeder_service_1.RealtimeChatFeederService])
|
|
81
|
+
], RealtimeChatController);
|
|
82
|
+
//# sourceMappingURL=realtime-chat.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"realtime-chat.controller.js","sourceRoot":"","sources":["../../../../../../libs/superlama-webservice/src/controller/realtime-chat.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,4EAAuE;AACvE,uFAGiD;AAMjD,+BAAkE;AAClE,yDAAqD;AACrD,0FAAoF;AAI7E,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAK/B,YACY,mBAAwC,EACxC,SAAoC;QADpC,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,cAAS,GAAT,SAAS,CAA2B;QANhD,yBAAoB,GAAG,IAAI,cAAO,EAAwB,CAAC;IAOxD,CAAC;IAIE,AAAN,KAAK,CAAC,iBAAiB,CACX,OAA8B,EACvB,IAAa;QAE5B,OAAO,MAAM,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC;IAIK,AAAN,KAAK,CAAC,4BAA4B,CACV,SAAiB,EAChB,UAAmB,EACZ,iBAA0B;QAEtD,OAAO,MAAM,IAAI,CAAC,mBAAmB,CAAC,4BAA4B,CAC9D,SAAS,EACT,UAAU,EACV,iBAAiB,CACpB,CAAC;IACN,CAAC;IAGK,AAAN,KAAK,CAAC,YAAY,CAAC,CAAuB;QACtC,MAAM,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;QAC5C,MAAM,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC;IAGD,GAAG,CAAc,SAAiB;QAC9B,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,CACjC,IAAA,aAAM,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,EACvC,IAAA,UAAG,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACR,IAAI,EAAE,CAAyB;SAClC,CAAC,CAAC,CACN,CAAC;IACN,CAAC;CAGJ,CAAA;AAlDY,wDAAsB;AAYzB;IAFL,IAAA,kBAAS,EAAC,wCAAY,CAAC;IACvB,IAAA,aAAI,GAAE;IAEF,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,uCAAW,GAAE,CAAA;;;;+DAGjB;AAIK;IAFL,IAAA,kBAAS,EAAC,wCAAY,CAAC;IACvB,IAAA,YAAG,GAAE;IAED,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,cAAK,EAAC,YAAY,CAAC,CAAA;IACnB,WAAA,IAAA,cAAK,EAAC,mBAAmB,CAAC,CAAA;;;;0EAO9B;AAGK;IADL,IAAA,4BAAY,EAAC,YAAY,CAAC;;;;0DAI1B;AAGD;IADC,IAAA,YAAG,EAAC,oBAAoB,CAAC;IACrB,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;oCAAqB,iBAAU;iDAO9C;iCA/CQ,sBAAsB;IADlC,IAAA,mBAAU,EAAC,eAAe,CAAC;qCAOS,2CAAmB;QAC7B,wDAAyB;GAPvC,sBAAsB,CAkDlC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SessionService } from '../service/session.service';
|
|
2
|
+
import { UserAuthBackendDTO } from '@ubs-platform/users-common';
|
|
3
|
+
export declare class SessionController {
|
|
4
|
+
private sessionService;
|
|
5
|
+
constructor(sessionService: SessionService);
|
|
6
|
+
searchUserSessions(currentUser: UserAuthBackendDTO, size?: number, page?: number): Promise<import("@ubs-platform/crud-base-common").SearchResult<import("@ubs-platform/superlama-common").ChatSessionDTO>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SessionController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const session_service_1 = require("../service/session.service");
|
|
18
|
+
const users_microservice_helper_1 = require("@ubs-platform/users-microservice-helper");
|
|
19
|
+
let SessionController = class SessionController {
|
|
20
|
+
constructor(sessionService) {
|
|
21
|
+
this.sessionService = sessionService;
|
|
22
|
+
}
|
|
23
|
+
async searchUserSessions(currentUser, size = 0, page = 1) {
|
|
24
|
+
return await this.sessionService.listSessions(currentUser, size, page);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.SessionController = SessionController;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, common_1.Get)('current-user'),
|
|
30
|
+
(0, common_1.UseGuards)(users_microservice_helper_1.JwtAuthGuard),
|
|
31
|
+
__param(0, (0, users_microservice_helper_1.CurrentUser)()),
|
|
32
|
+
__param(1, (0, common_1.Query)('size')),
|
|
33
|
+
__param(2, (0, common_1.Query)('page')),
|
|
34
|
+
__metadata("design:type", Function),
|
|
35
|
+
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
36
|
+
__metadata("design:returntype", Promise)
|
|
37
|
+
], SessionController.prototype, "searchUserSessions", null);
|
|
38
|
+
exports.SessionController = SessionController = __decorate([
|
|
39
|
+
(0, common_1.Controller)('session'),
|
|
40
|
+
__metadata("design:paramtypes", [session_service_1.SessionService])
|
|
41
|
+
], SessionController);
|
|
42
|
+
//# sourceMappingURL=user-sessions.controlller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-sessions.controlller.js","sourceRoot":"","sources":["../../../../../../libs/superlama-webservice/src/controller/user-sessions.controlller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmE;AAEnE,gEAA4D;AAC5D,uFAGiD;AAI1C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC1B,YAAoB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAIhD,AAAN,KAAK,CAAC,kBAAkB,CACL,WAA+B,EAC/B,OAAO,CAAC,EACR,OAAO,CAAC;QAEvB,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC;CACJ,CAAA;AAZY,8CAAiB;AAKpB;IAFL,IAAA,YAAG,EAAC,cAAc,CAAC;IACnB,IAAA,kBAAS,EAAC,wCAAY,CAAC;IAEnB,WAAA,IAAA,uCAAW,GAAE,CAAA;IACb,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;;;;2DAGjB;4BAXQ,iBAAiB;IAD7B,IAAA,mBAAU,EAAC,SAAS,CAAC;qCAEkB,gCAAc;GADzC,iBAAiB,CAY7B"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './service/realtime-chat.service';
|
|
2
|
+
export * from './service/realtime-chat-feeder.service';
|
|
3
|
+
export * from './service/session.service';
|
|
4
|
+
export * from './service/llm-operation.service';
|
|
5
|
+
export * from './controller/realtime-chat.controller';
|
|
6
|
+
export * from './controller/user-sessions.controlller';
|
|
7
|
+
export * from './controller/llm-models.controller';
|
|
8
|
+
export * from './mapper/chat-message.mapper';
|
|
9
|
+
export * from './superlama-webservice.module';
|
package/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./service/realtime-chat.service"), exports);
|
|
18
|
+
__exportStar(require("./service/realtime-chat-feeder.service"), exports);
|
|
19
|
+
__exportStar(require("./service/session.service"), exports);
|
|
20
|
+
__exportStar(require("./service/llm-operation.service"), exports);
|
|
21
|
+
__exportStar(require("./controller/realtime-chat.controller"), exports);
|
|
22
|
+
__exportStar(require("./controller/user-sessions.controlller"), exports);
|
|
23
|
+
__exportStar(require("./controller/llm-models.controller"), exports);
|
|
24
|
+
__exportStar(require("./mapper/chat-message.mapper"), exports);
|
|
25
|
+
__exportStar(require("./superlama-webservice.module"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/superlama-webservice/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,yEAAuD;AACvD,4DAA0C;AAC1C,kEAAgD;AAChD,wEAAsD;AACtD,yEAAuD;AACvD,qEAAmD;AACnD,+DAA6C;AAC7C,gEAA8C"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ChatMessageMapper = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
let ChatMessageMapper = class ChatMessageMapper {
|
|
12
|
+
messageToDto(msgSaved) {
|
|
13
|
+
return {
|
|
14
|
+
_id: msgSaved._id,
|
|
15
|
+
createdAt: msgSaved.createdAt.toISOString(),
|
|
16
|
+
updatedAt: msgSaved.updatedAt.toISOString(),
|
|
17
|
+
moderationNoteWarning: msgSaved.moderationNoteWarning,
|
|
18
|
+
requestedLlmModel: msgSaved.requestedLlmModel,
|
|
19
|
+
senderId: msgSaved.senderId,
|
|
20
|
+
senderType: msgSaved.senderType,
|
|
21
|
+
textContent: msgSaved.textContent,
|
|
22
|
+
sessionId: msgSaved.sessionId,
|
|
23
|
+
systemTextContent: msgSaved.systemTextContent,
|
|
24
|
+
thoughtTextContent: msgSaved.thoughtTextContent,
|
|
25
|
+
textAssistantStage: msgSaved.textAssistantStage,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.ChatMessageMapper = ChatMessageMapper;
|
|
30
|
+
exports.ChatMessageMapper = ChatMessageMapper = __decorate([
|
|
31
|
+
(0, common_1.Injectable)()
|
|
32
|
+
], ChatMessageMapper);
|
|
33
|
+
//# sourceMappingURL=chat-message.mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-message.mapper.js","sourceRoot":"","sources":["../../../../../../libs/superlama-webservice/src/mapper/chat-message.mapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAKrC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC1B,YAAY,CAAC,QAAqB;QAC9B,OAAO;YACH,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,WAAW,EAAE;YAC3C,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,WAAW,EAAE;YAC3C,qBAAqB,EAAE,QAAQ,CAAC,qBAAqB;YAErD,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;YAC7C,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;YAC7C,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;YAC/C,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB;SAGhC,CAAC;IACxB,CAAC;CACJ,CAAA;AApBY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAoB7B"}
|
package/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@ubs-platform/superlama-webservice","version":"1.4.0","description":"","repository":{"type":"git","url":"git+https://github.com/ubs-platform/ubs-mona-mr.git"},"homepage":"https://github.com/ubs-platform/ubs-mona-mr","iksir":{"type":"LIBRARY","libraryMode":"PEER","buildSubFolder":""},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"ISC","peerDependencies":{"@nestjs/common":"^11.1.19","@nestjs/schedule":"^5.0.1","ollama":"^0.5.14","rxjs":"^7.8.1","@nestjs/mongoose":"^11.0.1","mongoose":"^8.10.2","@nestjs/microservices":"^11.1.19","@ubs-platform/users-microservice-helper":"1.4.0","@ubs-platform/microservice-setup-util":"1.4.0","@ubs-platform/crud-base":"1.4.0"}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChatResponse } from 'ollama';
|
|
2
|
+
import { ChatMessageDTO, LlmModelDto } from '@ubs-platform/superlama-common';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
export declare class LlmOperationService {
|
|
5
|
+
private readonly ENV_KEY_U_SUPRLAMA_OLLAMA_URL;
|
|
6
|
+
private readonly OLLAMA_URL;
|
|
7
|
+
constructor();
|
|
8
|
+
fetchAvailableModels(): Promise<LlmModelDto[]>;
|
|
9
|
+
generateTestoResponse(msgs: ChatMessageDTO[]): Observable<ChatResponse>;
|
|
10
|
+
generateResponse(msgs: ChatMessageDTO[]): Observable<ChatResponse>;
|
|
11
|
+
generateTitleLast(assistantResponse: ChatMessageDTO): Promise<string>;
|
|
12
|
+
}
|