@dataclouder/conversation-card-nestjs 0.0.22 → 0.0.24
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/dist/ai-models.service.d.ts +0 -13
- package/dist/ai-models.service.d.ts.map +0 -1
- package/dist/ai-models.service.js +0 -82
- package/dist/ai-models.service.js.map +0 -1
- package/dist/clases/conversation.interface.d.ts +0 -161
- package/dist/clases/conversation.interface.d.ts.map +0 -1
- package/dist/clases/conversation.interface.js +0 -40
- package/dist/clases/conversation.interface.js.map +0 -1
- package/dist/conversation-ai.controller.d.ts +0 -18
- package/dist/conversation-ai.controller.d.ts.map +0 -1
- package/dist/conversation-ai.controller.js +0 -124
- package/dist/conversation-ai.controller.js.map +0 -1
- package/dist/conversation-cards.module.d.ts +0 -3
- package/dist/conversation-cards.module.d.ts.map +0 -1
- package/dist/conversation-cards.module.js +0 -27
- package/dist/conversation-cards.module.js.map +0 -1
- package/dist/conversation.controller.d.ts +0 -4
- package/dist/conversation.controller.d.ts.map +0 -1
- package/dist/conversation.controller.js +0 -33
- package/dist/conversation.controller.js.map +0 -1
- package/dist/dto/create-conversation.dto.d.ts +0 -18
- package/dist/dto/create-conversation.dto.d.ts.map +0 -1
- package/dist/dto/create-conversation.dto.js +0 -42
- package/dist/dto/create-conversation.dto.js.map +0 -1
- package/dist/entities/conversation.entity.d.ts +0 -68
- package/dist/entities/conversation.entity.d.ts.map +0 -1
- package/dist/entities/conversation.entity.js +0 -97
- package/dist/entities/conversation.entity.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -23
- package/dist/index.js.map +0 -1
- package/dist/services/audio-transcription.service.d.ts +0 -1
- package/dist/services/audio-transcription.service.d.ts.map +0 -1
- package/dist/services/audio-transcription.service.js +0 -1
- package/dist/services/audio-transcription.service.js.map +0 -1
- package/dist/services/conversation-ai.service.d.ts +0 -14
- package/dist/services/conversation-ai.service.d.ts.map +0 -1
- package/dist/services/conversation-ai.service.js +0 -58
- package/dist/services/conversation-ai.service.js.map +0 -1
- package/dist/services/conversation-cards.service.d.ts +0 -3
- package/dist/services/conversation-cards.service.d.ts.map +0 -1
- package/dist/services/conversation-cards.service.js +0 -17
- package/dist/services/conversation-cards.service.js.map +0 -1
- package/dist/tts/tts-service.d.ts +0 -1
- package/dist/tts/tts-service.d.ts.map +0 -1
- package/dist/tts/tts-service.js +0 -1
- package/dist/tts/tts-service.js.map +0 -1
- package/dist/tts/tts.classes.d.ts +0 -33
- package/dist/tts/tts.classes.d.ts.map +0 -1
- package/dist/tts/tts.classes.js +0 -200
- package/dist/tts/tts.classes.js.map +0 -1
- package/dist/tts/voices.d.ts +0 -4
- package/dist/tts/voices.d.ts.map +0 -1
- package/dist/tts/voices.js +0 -208
- package/dist/tts/voices.js.map +0 -1
package/package.json
CHANGED
@@ -1,13 +0,0 @@
|
|
1
|
-
import { Model } from 'mongoose';
|
2
|
-
import { ChatCompletionMessageParam } from 'groq-sdk/resources/chat/completions';
|
3
|
-
import { ChatMessageDict } from './clases/conversation.interface';
|
4
|
-
import { ConversationDocument } from './entities/conversation.entity';
|
5
|
-
export declare class IAModelsService {
|
6
|
-
private conversationModel;
|
7
|
-
private readonly groqClient;
|
8
|
-
constructor(conversationModel: Model<ConversationDocument>);
|
9
|
-
chat(messages: ChatCompletionMessageParam[]): Promise<ChatMessageDict>;
|
10
|
-
generateCompletion(prompt: string): Promise<string>;
|
11
|
-
getCompletion(prompt: string): Promise<string>;
|
12
|
-
}
|
13
|
-
//# sourceMappingURL=ai-models.service.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ai-models.service.d.ts","sourceRoot":"","sources":["../src/ai-models.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAY,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAgB,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEpF,qBACa,eAAe;IAGkB,OAAO,CAAC,iBAAiB;IAFrE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAO;gBAEkB,iBAAiB,EAAE,KAAK,CAAC,oBAAoB,CAAC;IAM5F,IAAI,CAAC,QAAQ,EAAE,0BAA0B,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAkBtE,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAenD,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAcrD"}
|
@@ -1,82 +0,0 @@
|
|
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.IAModelsService = void 0;
|
16
|
-
const common_1 = require("@nestjs/common");
|
17
|
-
const mongoose_1 = require("@nestjs/mongoose");
|
18
|
-
const mongoose_2 = require("mongoose");
|
19
|
-
const groq_sdk_1 = require("groq-sdk");
|
20
|
-
const conversation_interface_1 = require("./clases/conversation.interface");
|
21
|
-
const conversation_entity_1 = require("./entities/conversation.entity");
|
22
|
-
let IAModelsService = class IAModelsService {
|
23
|
-
constructor(conversationModel) {
|
24
|
-
this.conversationModel = conversationModel;
|
25
|
-
this.groqClient = new groq_sdk_1.default({
|
26
|
-
apiKey: process.env['GROQ_API_KEY'],
|
27
|
-
});
|
28
|
-
}
|
29
|
-
async chat(messages) {
|
30
|
-
try {
|
31
|
-
const completion = await this.groqClient.chat.completions.create({
|
32
|
-
messages,
|
33
|
-
model: 'mixtral-8x7b-32768',
|
34
|
-
temperature: 0.7,
|
35
|
-
max_tokens: 1024,
|
36
|
-
});
|
37
|
-
return {
|
38
|
-
content: completion.choices[0]?.message?.content || '',
|
39
|
-
role: conversation_interface_1.ChatRole.Assistant,
|
40
|
-
metadata: null,
|
41
|
-
};
|
42
|
-
}
|
43
|
-
catch (error) {
|
44
|
-
throw new Error(`Failed to generate completion: ${error.message}`);
|
45
|
-
}
|
46
|
-
}
|
47
|
-
async generateCompletion(prompt) {
|
48
|
-
try {
|
49
|
-
const completion = await this.groqClient.chat.completions.create({
|
50
|
-
messages: [{ role: 'user', content: prompt }],
|
51
|
-
model: 'mixtral-8x7b-32768',
|
52
|
-
temperature: 0.7,
|
53
|
-
max_tokens: 1024,
|
54
|
-
});
|
55
|
-
return completion.choices[0]?.message?.content || '';
|
56
|
-
}
|
57
|
-
catch (error) {
|
58
|
-
throw new Error(`Failed to generate completion: ${error.message}`);
|
59
|
-
}
|
60
|
-
}
|
61
|
-
async getCompletion(prompt) {
|
62
|
-
try {
|
63
|
-
const completion = await this.groqClient.chat.completions.create({
|
64
|
-
messages: [{ role: 'user', content: prompt }],
|
65
|
-
model: 'mixtral-8x7b-32768',
|
66
|
-
temperature: 0.7,
|
67
|
-
max_tokens: 1024,
|
68
|
-
});
|
69
|
-
return completion.choices[0]?.message?.content || '';
|
70
|
-
}
|
71
|
-
catch (error) {
|
72
|
-
throw new Error(`Failed to generate completion: ${error.message}`);
|
73
|
-
}
|
74
|
-
}
|
75
|
-
};
|
76
|
-
exports.IAModelsService = IAModelsService;
|
77
|
-
exports.IAModelsService = IAModelsService = __decorate([
|
78
|
-
(0, common_1.Injectable)(),
|
79
|
-
__param(0, (0, mongoose_1.InjectModel)(conversation_entity_1.Conversation.name)),
|
80
|
-
__metadata("design:paramtypes", [mongoose_2.Model])
|
81
|
-
], IAModelsService);
|
82
|
-
//# sourceMappingURL=ai-models.service.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ai-models.service.js","sourceRoot":"","sources":["../src/ai-models.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAA+C;AAC/C,uCAAiC;AACjC,uCAA4B;AAG5B,4EAA4E;AAC5E,wEAAoF;AAG7E,IAAM,eAAe,GAArB,MAAM,eAAe;IAG1B,YAAoD,iBAA8C;QAA9C,sBAAiB,GAAjB,iBAAiB,CAA6B;QAChG,IAAI,CAAC,UAAU,GAAG,IAAI,kBAAI,CAAC;YACzB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;SACpC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,QAAsC;QAC/C,IAAI;YACF,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;gBAC/D,QAAQ;gBACR,KAAK,EAAE,oBAAoB;gBAC3B,WAAW,EAAE,GAAG;gBAChB,UAAU,EAAE,IAAI;aACjB,CAAC,CAAC;YACH,OAAO;gBACL,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,IAAI,EAAE;gBACtD,IAAI,EAAE,iCAAQ,CAAC,SAAS;gBACxB,QAAQ,EAAE,IAAI;aACf,CAAC;SACH;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,C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gBAAK;GAHjE,eAAe,CAwD3B"}
|
@@ -1,161 +0,0 @@
|
|
1
|
-
export interface Message {
|
2
|
-
role: 'user' | 'assistant';
|
3
|
-
content: string;
|
4
|
-
}
|
5
|
-
export interface Conversation {
|
6
|
-
id: string;
|
7
|
-
messages?: Message[];
|
8
|
-
userId: string;
|
9
|
-
context?: Record<string, any>;
|
10
|
-
createdAt: Date;
|
11
|
-
updatedAt: Date;
|
12
|
-
}
|
13
|
-
export declare enum ChatRole {
|
14
|
-
System = "system",
|
15
|
-
User = "user",
|
16
|
-
Assistant = "assistant",
|
17
|
-
AssistantHelper = "assistantHelper"
|
18
|
-
}
|
19
|
-
export declare class ChatMultiMessage {
|
20
|
-
voice: string;
|
21
|
-
content: string;
|
22
|
-
text: string;
|
23
|
-
audioUrl: string;
|
24
|
-
audioPromise: any;
|
25
|
-
isLoading?: boolean;
|
26
|
-
transcription?: any;
|
27
|
-
transcriptionTimestamps?: WordTimestamps[];
|
28
|
-
tag: string | string[] | Set<string> | {
|
29
|
-
[klass: string]: any;
|
30
|
-
};
|
31
|
-
}
|
32
|
-
export type TranscriptionsWhisper = {
|
33
|
-
text: string;
|
34
|
-
task: string;
|
35
|
-
language: string;
|
36
|
-
words: any;
|
37
|
-
duration: number;
|
38
|
-
};
|
39
|
-
export declare class WordTimestamps {
|
40
|
-
word: string;
|
41
|
-
start: number;
|
42
|
-
end: number;
|
43
|
-
highlighted: any;
|
44
|
-
}
|
45
|
-
export declare class ChatMessageDict {
|
46
|
-
content: string;
|
47
|
-
role: ChatRole;
|
48
|
-
metadata?: any;
|
49
|
-
}
|
50
|
-
export declare class ChatMessage {
|
51
|
-
content: string;
|
52
|
-
role: ChatRole;
|
53
|
-
ssml?: string;
|
54
|
-
text?: string;
|
55
|
-
translation?: string;
|
56
|
-
audioUrl?: string;
|
57
|
-
audioHtml?: HTMLAudioElement;
|
58
|
-
promisePlay?: any;
|
59
|
-
stats?: any;
|
60
|
-
multiMessages?: ChatMultiMessage[];
|
61
|
-
transcription?: TranscriptionsWhisper;
|
62
|
-
transcriptionTimestamps?: WordTimestamps[];
|
63
|
-
voice?: string;
|
64
|
-
}
|
65
|
-
export interface CharaCard {
|
66
|
-
name: string;
|
67
|
-
description: string;
|
68
|
-
scenario: string;
|
69
|
-
first_mes: string;
|
70
|
-
creator_notes: string;
|
71
|
-
mes_example: string;
|
72
|
-
alternate_greetings: string[];
|
73
|
-
tags: string[];
|
74
|
-
system_prompt: string;
|
75
|
-
post_history_instructions: string;
|
76
|
-
}
|
77
|
-
export interface Appearance {
|
78
|
-
physicalDescription: string;
|
79
|
-
outfit: string;
|
80
|
-
objects: string;
|
81
|
-
quirks: string;
|
82
|
-
}
|
83
|
-
export interface CharacterCardDC {
|
84
|
-
spec: 'chara_card_v2';
|
85
|
-
spec_version: '2_v_dc';
|
86
|
-
data: {
|
87
|
-
name: string;
|
88
|
-
description: string;
|
89
|
-
scenario: string;
|
90
|
-
first_mes: string;
|
91
|
-
creator_notes: string;
|
92
|
-
mes_example: string;
|
93
|
-
alternate_greetings: string[];
|
94
|
-
tags: string[];
|
95
|
-
system_prompt: string;
|
96
|
-
post_history_instructions: string;
|
97
|
-
character_version: string;
|
98
|
-
extensions: Record<string, any>;
|
99
|
-
appearance: Appearance;
|
100
|
-
};
|
101
|
-
}
|
102
|
-
export declare enum TextEngines {
|
103
|
-
Plantext = "plantext",
|
104
|
-
SimpleText = "simpleText",
|
105
|
-
MarkdownMultiMessages = "markdownMultiMessages",
|
106
|
-
MarkdownSSML = "markdownSSML"
|
107
|
-
}
|
108
|
-
export declare enum ConversationType {
|
109
|
-
General = "general",
|
110
|
-
Reflection = "reflection",
|
111
|
-
LearningExample = "learningExample",
|
112
|
-
Challenge = "challenge",
|
113
|
-
RolePlay = "rolePlay",
|
114
|
-
RolePlayNoNarrator = "rolePlayNoNarrator",
|
115
|
-
RolePlayInnerThoughts = "rolePlayInnerThoughts"
|
116
|
-
}
|
117
|
-
export interface IConversation {
|
118
|
-
isPublic: any;
|
119
|
-
_id: any;
|
120
|
-
id: string;
|
121
|
-
card: CharacterCardDC;
|
122
|
-
title: string;
|
123
|
-
image: any;
|
124
|
-
voice: string;
|
125
|
-
secondaryVoice: string;
|
126
|
-
isPublished: boolean;
|
127
|
-
authorId: string;
|
128
|
-
authorEmail: string;
|
129
|
-
takenCount: number;
|
130
|
-
lang: string;
|
131
|
-
textEngine: TextEngines;
|
132
|
-
ConversationType: ConversationType;
|
133
|
-
}
|
134
|
-
export interface IConversationCard {
|
135
|
-
version: string;
|
136
|
-
id: string;
|
137
|
-
title: string;
|
138
|
-
assets: {
|
139
|
-
image: any;
|
140
|
-
};
|
141
|
-
characterCard: CharacterCardDC;
|
142
|
-
textEngine: TextEngines;
|
143
|
-
conversationType: ConversationType;
|
144
|
-
lang: string;
|
145
|
-
tts: {
|
146
|
-
voice: string;
|
147
|
-
secondaryVoice: string;
|
148
|
-
speed: string;
|
149
|
-
speedRate: number;
|
150
|
-
};
|
151
|
-
metaApp: {
|
152
|
-
isPublished: boolean;
|
153
|
-
isPublic: any;
|
154
|
-
authorId: string;
|
155
|
-
authorEmail: string;
|
156
|
-
createdAt: Date;
|
157
|
-
updatedAt: Date;
|
158
|
-
takenCount: number;
|
159
|
-
};
|
160
|
-
}
|
161
|
-
//# sourceMappingURL=conversation.interface.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"conversation.interface.d.ts","sourceRoot":"","sources":["../../src/clases/conversation.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,SAA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K,EAAE,MAAM,CAAC;QACd,cAAc,EAAE,MAAM,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF,OAAO,EAAE;QACP,WAAW,EAAE,OAAO,CAAC;QACrB,QAAQ,EAAE,GAAG,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,IAAI,CAAC;QAChB,SAAS,EAAE,IAAI,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
|
@@ -1,40 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.ConversationType = exports.TextEngines = exports.ChatMessage = exports.ChatMessageDict = exports.WordTimestamps = exports.ChatMultiMessage = exports.ChatRole = void 0;
|
4
|
-
var ChatRole;
|
5
|
-
(function (ChatRole) {
|
6
|
-
ChatRole["System"] = "system";
|
7
|
-
ChatRole["User"] = "user";
|
8
|
-
ChatRole["Assistant"] = "assistant";
|
9
|
-
ChatRole["AssistantHelper"] = "assistantHelper";
|
10
|
-
})(ChatRole || (exports.ChatRole = ChatRole = {}));
|
11
|
-
class ChatMultiMessage {
|
12
|
-
}
|
13
|
-
exports.ChatMultiMessage = ChatMultiMessage;
|
14
|
-
class WordTimestamps {
|
15
|
-
}
|
16
|
-
exports.WordTimestamps = WordTimestamps;
|
17
|
-
class ChatMessageDict {
|
18
|
-
}
|
19
|
-
exports.ChatMessageDict = ChatMessageDict;
|
20
|
-
class ChatMessage {
|
21
|
-
}
|
22
|
-
exports.ChatMessage = ChatMessage;
|
23
|
-
var TextEngines;
|
24
|
-
(function (TextEngines) {
|
25
|
-
TextEngines["Plantext"] = "plantext";
|
26
|
-
TextEngines["SimpleText"] = "simpleText";
|
27
|
-
TextEngines["MarkdownMultiMessages"] = "markdownMultiMessages";
|
28
|
-
TextEngines["MarkdownSSML"] = "markdownSSML";
|
29
|
-
})(TextEngines || (exports.TextEngines = TextEngines = {}));
|
30
|
-
var ConversationType;
|
31
|
-
(function (ConversationType) {
|
32
|
-
ConversationType["General"] = "general";
|
33
|
-
ConversationType["Reflection"] = "reflection";
|
34
|
-
ConversationType["LearningExample"] = "learningExample";
|
35
|
-
ConversationType["Challenge"] = "challenge";
|
36
|
-
ConversationType["RolePlay"] = "rolePlay";
|
37
|
-
ConversationType["RolePlayNoNarrator"] = "rolePlayNoNarrator";
|
38
|
-
ConversationType["RolePlayInnerThoughts"] = "rolePlayInnerThoughts";
|
39
|
-
})(ConversationType || (exports.ConversationType = ConversationType = {}));
|
40
|
-
//# sourceMappingURL=conversation.interface.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"conversation.interface.js","sourceRoot":"","sources":["../../src/clases/conversation.interface.ts"],"names":[],"mappings":";;;AAcA,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,6BAAiB,CAAA;IACjB,yBAAa,CAAA;IACb,mCAAuB,CAAA;IACvB,+CAAmC,CAAA;AACrC,CAAC,EALW,QAAQ,wBAAR,QAAQ,QAKnB;AAED,MAAa,gBAAgB;CAU5B;AAVD,4CAUC;AAID,MAAa,cAAc;CAK1B;AALD,wCAKC;AAED,MAAa,eAAe;CAI3B;AAJD,0CAIC;AAED,MAAa,WAAW;CAcvB;AAdD,kCAcC;AA2CD,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,wCAAyB,CAAA;IACzB,8DAA+C,CAAA;IAC/C,4CAA6B,CAAA;AAC/B,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED,IAAY,gBAQX;AARD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,6CAAyB,CAAA;IACzB,uDAAmC,CAAA;IACnC,2CAAuB,CAAA;IACvB,yCAAqB,CAAA;IACrB,6DAAyC,CAAA;IACzC,mEAA+C,CAAA;AACjD,CAAC,EARW,gBAAgB,gCAAhB,gBAAgB,QAQ3B"}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { ConversationAiService } from './services/conversation-ai.service';
|
2
|
-
import { ConversationDTO } from './dto/create-conversation.dto';
|
3
|
-
import { ChatMessageDict, IConversationCard } from './clases/conversation.interface';
|
4
|
-
import { Conversation, ConversationDocument } from './entities/conversation.entity';
|
5
|
-
import { IAModelsService } from './ai-models.service';
|
6
|
-
export declare class ConversationAiController {
|
7
|
-
private readonly conversationAiService;
|
8
|
-
private readonly aiModel;
|
9
|
-
constructor(conversationAiService: ConversationAiService, aiModel: IAModelsService);
|
10
|
-
getConversations(): Promise<ConversationDocument[]>;
|
11
|
-
saveConversation(conversation: IConversationCard): Promise<ConversationDocument>;
|
12
|
-
getConversationById(id: string): Promise<ConversationDocument>;
|
13
|
-
updateConversation(id: string, updateData: Partial<Conversation>): Promise<ConversationDocument>;
|
14
|
-
deleteConversationById(id: string): Promise<ConversationDocument>;
|
15
|
-
continueConversation(conversation: ConversationDTO): Promise<ChatMessageDict>;
|
16
|
-
test(): Promise<string>;
|
17
|
-
}
|
18
|
-
//# sourceMappingURL=conversation-ai.controller.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"conversation-ai.controller.d.ts","sourceRoot":"","sources":["../src/conversation-ai.controller.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAe,MAAM,iCAAiC,CAAC;AAClG,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGpF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,qBAEa,wBAAwB;IAEjC,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,qBAAqB,EAAE,qBAAqB,EAC5C,OAAO,EAAE,eAAe;IAOrC,gBAAgB,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAQnD,gBAAgB,CAAS,YAAY,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAOxF,mBAAmB,CAAc,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAO3E,kBAAkB,CAAc,EAAE,EAAE,MAAM,EAAU,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAOrH,sBAAsB,CAAc,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAO9E,oBAAoB,CAAS,YAAY,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAgCrF,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;CAI9B"}
|
@@ -1,124 +0,0 @@
|
|
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.ConversationAiController = void 0;
|
16
|
-
const common_1 = require("@nestjs/common");
|
17
|
-
const swagger_1 = require("@nestjs/swagger");
|
18
|
-
const conversation_ai_service_1 = require("./services/conversation-ai.service");
|
19
|
-
const create_conversation_dto_1 = require("./dto/create-conversation.dto");
|
20
|
-
const conversation_interface_1 = require("./clases/conversation.interface");
|
21
|
-
const conversation_entity_1 = require("./entities/conversation.entity");
|
22
|
-
const ai_models_service_1 = require("./ai-models.service");
|
23
|
-
let ConversationAiController = class ConversationAiController {
|
24
|
-
constructor(conversationAiService, aiModel) {
|
25
|
-
this.conversationAiService = conversationAiService;
|
26
|
-
this.aiModel = aiModel;
|
27
|
-
}
|
28
|
-
async getConversations() {
|
29
|
-
console.log('getConversations');
|
30
|
-
return this.conversationAiService.getConversations();
|
31
|
-
}
|
32
|
-
async saveConversation(conversation) {
|
33
|
-
return this.conversationAiService.saveConversation(conversation);
|
34
|
-
}
|
35
|
-
async getConversationById(id) {
|
36
|
-
return this.conversationAiService.getConversationById(id);
|
37
|
-
}
|
38
|
-
async updateConversation(id, updateData) {
|
39
|
-
return this.conversationAiService.updateConversation(id, updateData);
|
40
|
-
}
|
41
|
-
async deleteConversationById(id) {
|
42
|
-
return this.conversationAiService.deleteConversationById(id);
|
43
|
-
}
|
44
|
-
async continueConversation(conversation) {
|
45
|
-
const messages = conversation.messages;
|
46
|
-
console.log('messages', messages);
|
47
|
-
const response = await this.aiModel.chat(messages);
|
48
|
-
console.log('response', response);
|
49
|
-
return response;
|
50
|
-
}
|
51
|
-
async test() {
|
52
|
-
return 'Hello World' + conversation_interface_1.TextEngines.MarkdownMultiMessages;
|
53
|
-
}
|
54
|
-
};
|
55
|
-
exports.ConversationAiController = ConversationAiController;
|
56
|
-
__decorate([
|
57
|
-
(0, common_1.Get)('/conversation'),
|
58
|
-
(0, swagger_1.ApiOperation)({ summary: 'Get all conversations' }),
|
59
|
-
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return all conversations.' }),
|
60
|
-
__metadata("design:type", Function),
|
61
|
-
__metadata("design:paramtypes", []),
|
62
|
-
__metadata("design:returntype", Promise)
|
63
|
-
], ConversationAiController.prototype, "getConversations", null);
|
64
|
-
__decorate([
|
65
|
-
(0, common_1.Post)('/conversation'),
|
66
|
-
(0, swagger_1.ApiOperation)({ summary: 'Save new conversations' }),
|
67
|
-
(0, swagger_1.ApiResponse)({ status: 201, description: 'The conversation has been successfully created.', type: conversation_entity_1.Conversation }),
|
68
|
-
__param(0, (0, common_1.Body)()),
|
69
|
-
__metadata("design:type", Function),
|
70
|
-
__metadata("design:paramtypes", [Object]),
|
71
|
-
__metadata("design:returntype", Promise)
|
72
|
-
], ConversationAiController.prototype, "saveConversation", null);
|
73
|
-
__decorate([
|
74
|
-
(0, common_1.Get)('/conversation/:id'),
|
75
|
-
(0, swagger_1.ApiOperation)({ summary: 'Get a conversation by ID' }),
|
76
|
-
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the conversation.' }),
|
77
|
-
__param(0, (0, common_1.Param)('id')),
|
78
|
-
__metadata("design:type", Function),
|
79
|
-
__metadata("design:paramtypes", [String]),
|
80
|
-
__metadata("design:returntype", Promise)
|
81
|
-
], ConversationAiController.prototype, "getConversationById", null);
|
82
|
-
__decorate([
|
83
|
-
(0, common_1.Put)('/conversation/:id'),
|
84
|
-
(0, swagger_1.ApiOperation)({ summary: 'Update a conversation by ID' }),
|
85
|
-
(0, swagger_1.ApiResponse)({ status: 200, description: 'The conversation has been successfully updated.', type: conversation_entity_1.Conversation }),
|
86
|
-
__param(0, (0, common_1.Param)('id')),
|
87
|
-
__param(1, (0, common_1.Body)()),
|
88
|
-
__metadata("design:type", Function),
|
89
|
-
__metadata("design:paramtypes", [String, Object]),
|
90
|
-
__metadata("design:returntype", Promise)
|
91
|
-
], ConversationAiController.prototype, "updateConversation", null);
|
92
|
-
__decorate([
|
93
|
-
(0, common_1.Delete)('/conversation/:id'),
|
94
|
-
(0, swagger_1.ApiOperation)({ summary: 'Delete a conversation by ID' }),
|
95
|
-
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the deleted conversation.' }),
|
96
|
-
__param(0, (0, common_1.Param)('id')),
|
97
|
-
__metadata("design:type", Function),
|
98
|
-
__metadata("design:paramtypes", [String]),
|
99
|
-
__metadata("design:returntype", Promise)
|
100
|
-
], ConversationAiController.prototype, "deleteConversationById", null);
|
101
|
-
__decorate([
|
102
|
-
(0, common_1.Post)('/chat'),
|
103
|
-
(0, swagger_1.ApiOperation)({ summary: 'Continue the conversation' }),
|
104
|
-
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the conversation.' }),
|
105
|
-
__param(0, (0, common_1.Body)()),
|
106
|
-
__metadata("design:type", Function),
|
107
|
-
__metadata("design:paramtypes", [create_conversation_dto_1.ConversationDTO]),
|
108
|
-
__metadata("design:returntype", Promise)
|
109
|
-
], ConversationAiController.prototype, "continueConversation", null);
|
110
|
-
__decorate([
|
111
|
-
(0, common_1.Get)('/test'),
|
112
|
-
(0, swagger_1.ApiOperation)({ summary: 'Test the conversation AI' }),
|
113
|
-
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the test result.' }),
|
114
|
-
__metadata("design:type", Function),
|
115
|
-
__metadata("design:paramtypes", []),
|
116
|
-
__metadata("design:returntype", Promise)
|
117
|
-
], ConversationAiController.prototype, "test", null);
|
118
|
-
exports.ConversationAiController = ConversationAiController = __decorate([
|
119
|
-
(0, swagger_1.ApiTags)('conversation-ai-cards'),
|
120
|
-
(0, common_1.Controller)('api/conversation-ai-cards'),
|
121
|
-
__metadata("design:paramtypes", [conversation_ai_service_1.ConversationAiService,
|
122
|
-
ai_models_service_1.IAModelsService])
|
123
|
-
], ConversationAiController);
|
124
|
-
//# sourceMappingURL=conversation-ai.controller.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"conversation-ai.controller.js","sourceRoot":"","sources":["../src/conversation-ai.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsF;AACtF,6CAAqE;AAGrE,gFAA2E;AAC3E,2EAAgE;AAChE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sBAAY,EAAC,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC;IACxD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IAChD,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;sEAExC;AAKK;IAHL,IAAA,aAAI,EAAC,OAAO,CAAC;IACb,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC;IACtD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;IAC1C,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAe,yCAAe;;oEAM/D;AA0BK;IAHL,IAAA,YAAG,EAAC,OAAO,CAAC;IACZ,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC;IACrD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;;;oDAIpE;mCAjFU,wBAAwB;IAFpC,IAAA,iBAAO,EAAC,uBAAuB,CAAC;IAChC,IAAA,mBAAU,EAAC,2BAA2B,CAAC;qCAGI,+CAAqB;QACnC,mCAAe;GAHhC,wBAAwB,CAkFpC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"conversation-cards.module.d.ts","sourceRoot":"","sources":["../src/conversation-cards.module.ts"],"names":[],"mappings":"AAQA,qBAMa,uBAAuB;CAAG"}
|
@@ -1,27 +0,0 @@
|
|
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.ConversationCardsModule = void 0;
|
10
|
-
const common_1 = require("@nestjs/common");
|
11
|
-
const mongoose_1 = require("@nestjs/mongoose");
|
12
|
-
const conversation_ai_controller_1 = require("./conversation-ai.controller");
|
13
|
-
const conversation_entity_1 = require("./entities/conversation.entity");
|
14
|
-
const ai_models_service_1 = require("./ai-models.service");
|
15
|
-
const conversation_ai_service_1 = require("./services/conversation-ai.service");
|
16
|
-
let ConversationCardsModule = class ConversationCardsModule {
|
17
|
-
};
|
18
|
-
exports.ConversationCardsModule = ConversationCardsModule;
|
19
|
-
exports.ConversationCardsModule = ConversationCardsModule = __decorate([
|
20
|
-
(0, common_1.Module)({
|
21
|
-
imports: [mongoose_1.MongooseModule.forFeature([{ name: conversation_entity_1.Conversation.name, schema: conversation_entity_1.ConversationSchema }])],
|
22
|
-
controllers: [conversation_ai_controller_1.ConversationAiController],
|
23
|
-
providers: [conversation_ai_service_1.ConversationAiService, ai_models_service_1.IAModelsService],
|
24
|
-
exports: [conversation_ai_service_1.ConversationAiService, ai_models_service_1.IAModelsService],
|
25
|
-
})
|
26
|
-
], ConversationCardsModule);
|
27
|
-
//# sourceMappingURL=conversation-cards.module.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"conversation-cards.module.js","sourceRoot":"","sources":["../src/conversation-cards.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,6EAAwE;AACxE,wEAAkF;AAElF,2DAAsD;AACtD,gFAA2E;AAQpE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAAG,CAAA;AAA1B,0DAAuB;kCAAvB,uBAAuB;IANnC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,yBAAc,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,kCAAY,CAAC,IAAI,EAAE,MAAM,EAAE,wCAAkB,EAAE,CAAC,CAAC,CAAC;QAC/F,WAAW,EAAE,CAAC,qDAAwB,CAAC;QACvC,SAAS,EAAE,CAAC,+CAAqB,EAAE,mCAAe,CAAC;QACnD,OAAO,EAAE,CAAC,+CAAqB,EAAE,mCAAe,CAAC;KAClD,CAAC;GACW,uBAAuB,CAAG"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"conversation.controller.d.ts","sourceRoot":"","sources":["../src/conversation.controller.ts"],"names":[],"mappings":"AAGA,qBAEa,wBAAwB;IAI7B,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;CAGlC"}
|
@@ -1,33 +0,0 @@
|
|
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.ConversationAiController = void 0;
|
13
|
-
const common_1 = require("@nestjs/common");
|
14
|
-
const swagger_1 = require("@nestjs/swagger");
|
15
|
-
let ConversationAiController = class ConversationAiController {
|
16
|
-
async getCards() {
|
17
|
-
return 'Hello World';
|
18
|
-
}
|
19
|
-
};
|
20
|
-
exports.ConversationAiController = ConversationAiController;
|
21
|
-
__decorate([
|
22
|
-
(0, common_1.Get)('/cards'),
|
23
|
-
(0, swagger_1.ApiOperation)({ summary: 'Get the cards' }),
|
24
|
-
(0, swagger_1.ApiResponse)({ status: 200, description: 'Return the cards.' }),
|
25
|
-
__metadata("design:type", Function),
|
26
|
-
__metadata("design:paramtypes", []),
|
27
|
-
__metadata("design:returntype", Promise)
|
28
|
-
], ConversationAiController.prototype, "getCards", null);
|
29
|
-
exports.ConversationAiController = ConversationAiController = __decorate([
|
30
|
-
(0, swagger_1.ApiTags)('conversation-cards-library'),
|
31
|
-
(0, common_1.Controller)('api/conversation-cards-library')
|
32
|
-
], ConversationAiController);
|
33
|
-
//# sourceMappingURL=conversation.controller.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"conversation.controller.js","sourceRoot":"","sources":["../src/conversation.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;AACjD,6CAAqE;AAI9D,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAI7B,AAAN,KAAK,CAAC,QAAQ;QACZ,OAAO,aAAa,CAAC;IACvB,CAAC;CACF,CAAA;AAPY,4DAAwB;AAI7B;IAHL,IAAA,YAAG,EAAC,QAAQ,CAAC;IACb,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;IAC1C,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;;;;wDAG9D;mCANU,wBAAwB;IAFpC,IAAA,iBAAO,EAAC,4BAA4B,CAAC;IACrC,IAAA,mBAAU,EAAC,gCAAgC,CAAC;GAChC,wBAAwB,CAOpC"}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { ChatMessage, ConversationType } from '../clases/conversation.interface';
|
2
|
-
export declare class CreateConversationDto {
|
3
|
-
message: string;
|
4
|
-
userId: string;
|
5
|
-
context?: Record<string, any>;
|
6
|
-
}
|
7
|
-
export declare class ConversationDTO {
|
8
|
-
id?: string;
|
9
|
-
entityId?: string;
|
10
|
-
type?: ConversationType;
|
11
|
-
createdAt?: Date;
|
12
|
-
messages: Array<ChatMessage>;
|
13
|
-
transcription?: boolean;
|
14
|
-
modelName?: string;
|
15
|
-
provider?: string;
|
16
|
-
returnJson?: boolean;
|
17
|
-
}
|
18
|
-
//# sourceMappingURL=create-conversation.dto.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"create-conversation.dto.d.ts","sourceRoot":"","sources":["../../src/dto/create-conversation.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEjF,qBAAa,qBAAqB;IAKhC,OAAO,EAAE,MAAM,CAAC;IAMhB,MAAM,EAAE,MAAM,CAAC;IAOf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/B;AAED,qBAAa,eAAe;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
@@ -1,42 +0,0 @@
|
|
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.ConversationDTO = exports.CreateConversationDto = void 0;
|
13
|
-
const swagger_1 = require("@nestjs/swagger");
|
14
|
-
class CreateConversationDto {
|
15
|
-
}
|
16
|
-
exports.CreateConversationDto = CreateConversationDto;
|
17
|
-
__decorate([
|
18
|
-
(0, swagger_1.ApiProperty)({
|
19
|
-
description: 'The message content of the conversation',
|
20
|
-
example: 'Hello, how can I help you today?',
|
21
|
-
}),
|
22
|
-
__metadata("design:type", String)
|
23
|
-
], CreateConversationDto.prototype, "message", void 0);
|
24
|
-
__decorate([
|
25
|
-
(0, swagger_1.ApiProperty)({
|
26
|
-
description: 'The user ID associated with the conversation',
|
27
|
-
example: 'user123',
|
28
|
-
}),
|
29
|
-
__metadata("design:type", String)
|
30
|
-
], CreateConversationDto.prototype, "userId", void 0);
|
31
|
-
__decorate([
|
32
|
-
(0, swagger_1.ApiProperty)({
|
33
|
-
description: 'Additional context for the conversation',
|
34
|
-
required: false,
|
35
|
-
example: { previousContext: 'User asked about weather' },
|
36
|
-
}),
|
37
|
-
__metadata("design:type", Object)
|
38
|
-
], CreateConversationDto.prototype, "context", void 0);
|
39
|
-
class ConversationDTO {
|
40
|
-
}
|
41
|
-
exports.ConversationDTO = ConversationDTO;
|
42
|
-
//# sourceMappingURL=create-conversation.dto.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"create-conversation.dto.js","sourceRoot":"","sources":["../../src/dto/create-conversation.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,6CAA8C;AAG9C,MAAa,qBAAqB;CAmBjC;AAnBD,sDAmBC;AAdC;IAJC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,yCAAyC;QACtD,OAAO,EAAE,kCAAkC;KAC5C,CAAC;;sDACc;AAMhB;IAJC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,8CAA8C;QAC3D,OAAO,EAAE,SAAS;KACnB,CAAC;;qDACa;AAOf;IALC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,yCAAyC;QACtD,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,EAAE,eAAe,EAAE,0BAA0B,EAAE;KACzD,CAAC;;sDAC4B;AAGhC,MAAa,eAAe;CAU3B;AAVD,0CAUC"}
|