mirror of
https://github.com/vastxie/99AI.git
synced 2025-11-13 20:23:43 +08:00
v3.7.0
This commit is contained in:
34
dist/modules/ai/lumaVideo.service.js
vendored
34
dist/modules/ai/lumaVideo.service.js
vendored
@@ -13,9 +13,13 @@ exports.LumaVideoService = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const axios_1 = require("axios");
|
||||
const chatLog_service_1 = require("../chatLog/chatLog.service");
|
||||
const globalConfig_service_1 = require("../globalConfig/globalConfig.service");
|
||||
const upload_service_1 = require("../upload/upload.service");
|
||||
let LumaVideoService = class LumaVideoService {
|
||||
constructor(chatLogService) {
|
||||
constructor(chatLogService, globalConfigService, uploadService) {
|
||||
this.chatLogService = chatLogService;
|
||||
this.globalConfigService = globalConfigService;
|
||||
this.uploadService = uploadService;
|
||||
}
|
||||
async lumaVideo(inputs) {
|
||||
var _a, _b, _c;
|
||||
@@ -32,12 +36,15 @@ let LumaVideoService = class LumaVideoService {
|
||||
let payloadJson = {};
|
||||
const headers = { Authorization: `Bearer ${apiKey}` };
|
||||
url = `${proxyUrl}/luma/generations/`;
|
||||
const aspectRatio = '16:9';
|
||||
const aspectRatio = extraParam.size || '16:9';
|
||||
payloadJson = {
|
||||
user_prompt: prompt,
|
||||
aspect_ratio: aspectRatio,
|
||||
expand_prompt: true,
|
||||
};
|
||||
if (fileInfo) {
|
||||
payloadJson['image_url'] = fileInfo;
|
||||
}
|
||||
common_1.Logger.log(`正在准备发送请求到 ${url},payload: ${JSON.stringify(payloadJson)}, headers: ${JSON.stringify(headers)}`, 'LumaService');
|
||||
try {
|
||||
response = await axios_1.default.post(url, payloadJson, { headers });
|
||||
@@ -150,6 +157,25 @@ let LumaVideoService = class LumaVideoService {
|
||||
result.taskId = responses.id;
|
||||
result.taskData = JSON.stringify(responses);
|
||||
result.fileInfo = responses.video.url;
|
||||
try {
|
||||
const localStorageStatus = await this.globalConfigService.getConfigs([
|
||||
'localStorageStatus',
|
||||
]);
|
||||
if (Number(localStorageStatus)) {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(now.getDate()).padStart(2, '0');
|
||||
const currentDate = `${year}${month}/${day}`;
|
||||
result.fileInfo = await this.uploadService.uploadFileFromUrl({
|
||||
url: responses.video.download_url,
|
||||
dir: `video/luma/${currentDate}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
common_1.Logger.error(`上传文件失败: ${error.message}`, 'LumaService');
|
||||
}
|
||||
result.answer = `提示词: "${responses.prompt}"`;
|
||||
onSuccess(result);
|
||||
clearInterval(interval);
|
||||
@@ -180,6 +206,8 @@ let LumaVideoService = class LumaVideoService {
|
||||
};
|
||||
LumaVideoService = __decorate([
|
||||
(0, common_1.Injectable)(),
|
||||
__metadata("design:paramtypes", [chatLog_service_1.ChatLogService])
|
||||
__metadata("design:paramtypes", [chatLog_service_1.ChatLogService,
|
||||
globalConfig_service_1.GlobalConfigService,
|
||||
upload_service_1.UploadService])
|
||||
], LumaVideoService);
|
||||
exports.LumaVideoService = LumaVideoService;
|
||||
|
||||
54
dist/modules/ai/midjourneyDraw.service.js
vendored
54
dist/modules/ai/midjourneyDraw.service.js
vendored
@@ -22,8 +22,8 @@ let MidjourneyService = class MidjourneyService {
|
||||
this.chatLogService = chatLogService;
|
||||
}
|
||||
async midjourneyDraw(inputs) {
|
||||
var _a, _b;
|
||||
const { id, apiKey, proxyUrl, action, drawId, prompt, usePrompt, customId, timeout, assistantLogId, } = inputs;
|
||||
var _a, _b, _c, _d;
|
||||
const { id, apiKey, proxyUrl, action, drawId, prompt, usePrompt, customId, timeout, fileInfo, assistantLogId, } = inputs;
|
||||
let result = {
|
||||
text: '',
|
||||
fileInfo: '',
|
||||
@@ -34,6 +34,8 @@ let MidjourneyService = class MidjourneyService {
|
||||
let response;
|
||||
let retryCount = 0;
|
||||
let url = '';
|
||||
const headers = { 'mj-api-secret': apiKey };
|
||||
common_1.Logger.debug(`当前任务类型: ${action}`, 'MidjourneyService');
|
||||
while (retryCount < 3) {
|
||||
let payloadJson = {};
|
||||
try {
|
||||
@@ -41,15 +43,40 @@ let MidjourneyService = class MidjourneyService {
|
||||
url = `${proxyUrl}/mj/submit/imagine`;
|
||||
payloadJson = { prompt: usePrompt };
|
||||
}
|
||||
else if (action === 'DESCRIBE') {
|
||||
url = `${proxyUrl}/mj/submit/describe`;
|
||||
if (fileInfo) {
|
||||
const response = await fetch(fileInfo);
|
||||
const blob = await response.blob();
|
||||
const buffer = Buffer.from(await blob.arrayBuffer());
|
||||
const base64String = buffer.toString('base64');
|
||||
payloadJson = { base64: `data:image/png;base64,${base64String}` };
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (action === 'PICREADER') {
|
||||
url = `${proxyUrl}/mj/submit/action`;
|
||||
payloadJson = { taskId: drawId, customId: customId };
|
||||
response = await axios_1.default.post(url, payloadJson, { headers });
|
||||
if ((response === null || response === void 0 ? void 0 : response.status) === 200 && ((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result)) {
|
||||
url = `${proxyUrl}/mj/submit/modal`;
|
||||
payloadJson = { taskId: (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.result };
|
||||
}
|
||||
}
|
||||
else {
|
||||
url = `${proxyUrl}/mj/submit/action`;
|
||||
payloadJson = { taskId: drawId, customId: customId };
|
||||
}
|
||||
const headers = { 'mj-api-secret': apiKey };
|
||||
common_1.Logger.log(`正在准备发送请求到 ${url},payload: ${JSON.stringify(payloadJson)}, headers: ${JSON.stringify(headers)}`, 'MidjourneyService');
|
||||
response = await axios_1.default.post(url, payloadJson, { headers });
|
||||
if ((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) {
|
||||
result.drawId = (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.result;
|
||||
if ((response === null || response === void 0 ? void 0 : response.status) === 200 && ((_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.result)) {
|
||||
common_1.Logger.debug(`收到响应: ${JSON.stringify(response.data)}`, 'MidjourneyService');
|
||||
result.drawId = (_d = response === null || response === void 0 ? void 0 : response.data) === null || _d === void 0 ? void 0 : _d.result;
|
||||
result.state = 2;
|
||||
result.answer = '绘画任务提交成功';
|
||||
common_1.Logger.log(`绘画任务提交成功, 绘画ID: ${response.data.result}`, 'MidjourneyService');
|
||||
break;
|
||||
}
|
||||
else {
|
||||
@@ -59,6 +86,8 @@ let MidjourneyService = class MidjourneyService {
|
||||
catch (error) {
|
||||
retryCount++;
|
||||
if (retryCount >= 3) {
|
||||
result.answer = '任务提交失败,请检查提示词后重试';
|
||||
result.status = 5;
|
||||
common_1.Logger.log(`绘画任务提交失败, 请检查后台配置或者稍后重试! ${error}`, 'MidjourneyService');
|
||||
}
|
||||
}
|
||||
@@ -66,7 +95,7 @@ let MidjourneyService = class MidjourneyService {
|
||||
this.pollMjDrawingResult({
|
||||
proxyUrl,
|
||||
apiKey,
|
||||
drawId: response.data.result,
|
||||
drawId: result.drawId,
|
||||
timeout,
|
||||
prompt,
|
||||
onSuccess: async (data) => {
|
||||
@@ -78,7 +107,7 @@ let MidjourneyService = class MidjourneyService {
|
||||
drawId: data === null || data === void 0 ? void 0 : data.drawId,
|
||||
customId: data === null || data === void 0 ? void 0 : data.customId,
|
||||
});
|
||||
common_1.Logger.log('绘图成功!');
|
||||
common_1.Logger.log('绘图成功!', 'MidjourneyService');
|
||||
},
|
||||
onDrawing: async (data) => {
|
||||
await this.chatLogService.updateChatLog(assistantLogId, {
|
||||
@@ -86,19 +115,18 @@ let MidjourneyService = class MidjourneyService {
|
||||
progress: data === null || data === void 0 ? void 0 : data.progress,
|
||||
status: 2,
|
||||
});
|
||||
common_1.Logger.log(`绘制中!绘制进度${data === null || data === void 0 ? void 0 : data.progress}`);
|
||||
common_1.Logger.log(`绘制中!绘制进度${data === null || data === void 0 ? void 0 : data.progress}`, 'MidjourneyService');
|
||||
},
|
||||
onFailure: async (data) => {
|
||||
await this.chatLogService.updateChatLog(assistantLogId, {
|
||||
answer: '绘图失败',
|
||||
status: data.status,
|
||||
});
|
||||
common_1.Logger.log('绘图失败');
|
||||
common_1.Logger.log('绘图失败', 'MidjourneyService');
|
||||
},
|
||||
}).catch((error) => {
|
||||
common_1.Logger.error('查询绘图结果时发生错误:', error, 'MidjourneyService');
|
||||
});
|
||||
common_1.Logger.log(`绘画任务提交成功, 绘画ID: ${response.data.result}`, 'MidjourneyService');
|
||||
return result;
|
||||
}
|
||||
async pollMjDrawingResult(inputs) {
|
||||
@@ -108,7 +136,6 @@ let MidjourneyService = class MidjourneyService {
|
||||
'mjProxyImgUrl',
|
||||
'mjNotUseProxy',
|
||||
]);
|
||||
let response;
|
||||
let result = {
|
||||
fileInfo: '',
|
||||
drawId: '',
|
||||
@@ -117,11 +144,9 @@ let MidjourneyService = class MidjourneyService {
|
||||
progress: 0,
|
||||
answer: '',
|
||||
};
|
||||
let payloadJson = {};
|
||||
const startTime = Date.now();
|
||||
const POLL_INTERVAL = 5000;
|
||||
let retryCount = 0;
|
||||
let pollingCount = 0;
|
||||
try {
|
||||
while (Date.now() - startTime < timeout) {
|
||||
await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL));
|
||||
@@ -133,6 +158,7 @@ let MidjourneyService = class MidjourneyService {
|
||||
const url = `${proxyUrl}/mj/task/${drawId}/fetch`;
|
||||
const res = await axios_1.default.get(url, { headers });
|
||||
const responses = res.data;
|
||||
common_1.Logger.debug(`查询结果: ${JSON.stringify(responses)}`, 'MidjourneyService');
|
||||
if (responses.status === 'SUCCESS') {
|
||||
common_1.Logger.log(`绘制成功, 获取到的URL: ${responses.imageUrl}`, 'MidjourneyService');
|
||||
let processedUrl = responses.imageUrl;
|
||||
@@ -150,7 +176,7 @@ let MidjourneyService = class MidjourneyService {
|
||||
}
|
||||
if (mjNotSaveImg !== '1') {
|
||||
try {
|
||||
common_1.Logger.log(`------> 开始上传图片!!!`);
|
||||
common_1.Logger.log(`------> 开始上传图片!!!`, 'MidjourneyService');
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||
|
||||
30
dist/modules/ai/openaiDraw.service.js
vendored
30
dist/modules/ai/openaiDraw.service.js
vendored
@@ -25,10 +25,34 @@ let OpenAIDrawService = OpenAIDrawService_1 = class OpenAIDrawService {
|
||||
this.openAIChatService = openAIChatService;
|
||||
this.logger = new common_1.Logger(OpenAIDrawService_1.name);
|
||||
}
|
||||
async dalleDraw(inputs, messagesHistory) {
|
||||
async dalleDraw(inputs, buildMessageFromParentMessageId) {
|
||||
var _a, _b, _c, _d;
|
||||
common_1.Logger.log('开始提交 Dalle 绘图任务 ', 'DrawService');
|
||||
const { apiKey, model, proxyUrl, prompt, extraParam, timeout, onSuccess, onFailure, } = inputs;
|
||||
const { apiKey, model, proxyUrl, prompt, extraParam, timeout, onSuccess, onFailure, groupId, } = inputs;
|
||||
const isDalleChat = await this.globalConfigService.getConfigs([
|
||||
'isDalleChat',
|
||||
]);
|
||||
let drawPrompt;
|
||||
if (isDalleChat === '1') {
|
||||
try {
|
||||
common_1.Logger.log('已开启连续绘画模式', 'DalleDraw');
|
||||
const { messagesHistory } = await buildMessageFromParentMessageId(`参考上文,结合我的需求,给出绘画描述。我的需求是:${prompt}`, {
|
||||
groupId,
|
||||
systemMessage: '你是一个绘画提示词生成工具,请根据用户的要求,结合上下文,用一段文字,描述用户需要的绘画需求,不用包含任何礼貌性的寒暄,只需要场景的描述,可以适当联想',
|
||||
maxModelTokens: 8000,
|
||||
maxRounds: 5,
|
||||
fileInfo: '',
|
||||
}, this.chatLogService);
|
||||
drawPrompt = await this.openAIChatService.chatFree(prompt, undefined, messagesHistory);
|
||||
}
|
||||
catch (error) {
|
||||
console.error('调用chatFree失败:', error);
|
||||
drawPrompt = prompt;
|
||||
}
|
||||
}
|
||||
else {
|
||||
drawPrompt = prompt;
|
||||
}
|
||||
const size = (extraParam === null || extraParam === void 0 ? void 0 : extraParam.size) || '1024x1024';
|
||||
let result = { answer: '', fileInfo: '', status: 2 };
|
||||
try {
|
||||
@@ -42,7 +66,7 @@ let OpenAIDrawService = OpenAIDrawService_1 = class OpenAIDrawService {
|
||||
},
|
||||
data: {
|
||||
model: model,
|
||||
prompt: prompt,
|
||||
prompt: drawPrompt,
|
||||
size,
|
||||
},
|
||||
};
|
||||
|
||||
20
dist/modules/ai/stableDiffusion.service.js
vendored
20
dist/modules/ai/stableDiffusion.service.js
vendored
@@ -24,7 +24,7 @@ let StableDiffusionService = StableDiffusionService_1 = class StableDiffusionSer
|
||||
this.logger = new common_1.Logger(StableDiffusionService_1.name);
|
||||
}
|
||||
async sdxl(messagesHistory, inputs) {
|
||||
const { onGenerate, onSuccess, onFailure, apiKey, model, proxyUrl, modelName, timeout, chatId, isFileUpload, prompt, } = inputs;
|
||||
const { onSuccess, onFailure, apiKey, model, proxyUrl, modelName, timeout, chatId, prompt, } = inputs;
|
||||
let result = {
|
||||
answer: '',
|
||||
model: model,
|
||||
@@ -58,12 +58,28 @@ let StableDiffusionService = StableDiffusionService_1 = class StableDiffusionSer
|
||||
const match = content.match(regex);
|
||||
if (match && match[1]) {
|
||||
result.fileInfo = match[1];
|
||||
try {
|
||||
const localStorageStatus = await this.globalConfigService.getConfigs(['localStorageStatus']);
|
||||
if (Number(localStorageStatus)) {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(now.getDate()).padStart(2, '0');
|
||||
const currentDate = `${year}${month}/${day}`;
|
||||
result.fileInfo = await this.uploadService.uploadFileFromUrl({
|
||||
url: result.fileInfo,
|
||||
dir: `images/stable-diffusion/${currentDate}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
common_1.Logger.error(`上传文件失败: ${error.message}`, 'StableDiffusionService');
|
||||
}
|
||||
console.log('找到链接', match[1]);
|
||||
}
|
||||
else {
|
||||
console.log('没有找到链接');
|
||||
}
|
||||
let revised_prompt_cn;
|
||||
result.answer = `${prompt} 绘制成功`;
|
||||
if (result.fileInfo) {
|
||||
onSuccess(result);
|
||||
|
||||
118
dist/modules/ai/suno.service.js
vendored
118
dist/modules/ai/suno.service.js
vendored
@@ -13,9 +13,13 @@ exports.SunoService = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const axios_1 = require("axios");
|
||||
const chatLog_service_1 = require("../chatLog/chatLog.service");
|
||||
const globalConfig_service_1 = require("../globalConfig/globalConfig.service");
|
||||
const upload_service_1 = require("../upload/upload.service");
|
||||
let SunoService = class SunoService {
|
||||
constructor(chatLogService) {
|
||||
constructor(chatLogService, uploadService, globalConfigService) {
|
||||
this.chatLogService = chatLogService;
|
||||
this.uploadService = uploadService;
|
||||
this.globalConfigService = globalConfigService;
|
||||
}
|
||||
async suno(inputs) {
|
||||
var _a, _b, _c;
|
||||
@@ -46,7 +50,7 @@ let SunoService = class SunoService {
|
||||
throw new Error('taskData格式错误');
|
||||
}
|
||||
}
|
||||
common_1.Logger.log(`正在准备发送请求到 ${url},payload: ${JSON.stringify(payloadJson)}, headers: ${JSON.stringify(headers)}`);
|
||||
common_1.Logger.log(`正在准备发送请求到 ${url},payload: ${JSON.stringify(payloadJson)}, headers: ${JSON.stringify(headers)}`, 'SunoService');
|
||||
try {
|
||||
response = await axios_1.default.post(url, payloadJson, { headers });
|
||||
}
|
||||
@@ -164,6 +168,7 @@ let SunoService = class SunoService {
|
||||
try {
|
||||
const res = await axios_1.default.get(url, { headers });
|
||||
const responses = res.data.data;
|
||||
common_1.Logger.debug(`轮询结果: ${JSON.stringify(responses)}`, 'SunoService');
|
||||
if (action === 'LYRICS') {
|
||||
if (responses.status === 'SUCCESS') {
|
||||
result.taskId = responses.data.id;
|
||||
@@ -179,7 +184,6 @@ let SunoService = class SunoService {
|
||||
}
|
||||
}
|
||||
if (action === 'MUSIC') {
|
||||
const data = responses.data;
|
||||
if (responses.data) {
|
||||
const data = responses.data;
|
||||
result.taskData = JSON.stringify(data);
|
||||
@@ -195,30 +199,100 @@ let SunoService = class SunoService {
|
||||
.filter((url) => url);
|
||||
const titles = data.map((item) => item.title);
|
||||
const firstTitle = titles.length > 0 ? titles[0] : '音乐已生成';
|
||||
const audioUrls = validAudioUrls.join(',');
|
||||
const videoUrls = validVideoUrls.join(',');
|
||||
const imageUrls = validImageUrls.join(',');
|
||||
result.audioUrl = audioUrls;
|
||||
result.videoUrl = videoUrls;
|
||||
result.fileInfo = imageUrls;
|
||||
if (validAudioUrls.length === 2) {
|
||||
result.status = 3;
|
||||
result.answer = firstTitle;
|
||||
if (responses.status === 'SUCCESS') {
|
||||
let audioUrls = [];
|
||||
let videoUrls = [];
|
||||
let imageUrls = [];
|
||||
try {
|
||||
const localStorageStatus = await this.globalConfigService.getConfigs([
|
||||
'localStorageStatus',
|
||||
]);
|
||||
if (Number(localStorageStatus)) {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(now.getDate()).padStart(2, '0');
|
||||
const currentDate = `${year}${month}/${day}`;
|
||||
for (const url of validAudioUrls) {
|
||||
try {
|
||||
const uploadedUrl = await this.uploadService.uploadFileFromUrl({
|
||||
url: url,
|
||||
dir: `audio/suno-music/${currentDate}`,
|
||||
});
|
||||
audioUrls.push(uploadedUrl);
|
||||
}
|
||||
catch (error) {
|
||||
common_1.Logger.error(`上传音频文件失败: ${error.message}`, 'SunoService');
|
||||
audioUrls.push(url);
|
||||
}
|
||||
}
|
||||
for (const url of validVideoUrls) {
|
||||
try {
|
||||
const uploadedUrl = await this.uploadService.uploadFileFromUrl({
|
||||
url: url,
|
||||
dir: `video/suno-music/${currentDate}`,
|
||||
});
|
||||
videoUrls.push(uploadedUrl);
|
||||
}
|
||||
catch (error) {
|
||||
common_1.Logger.error(`上传视频文件失败: ${error.message}`, 'SunoService');
|
||||
videoUrls.push(url);
|
||||
}
|
||||
}
|
||||
for (const url of validImageUrls) {
|
||||
try {
|
||||
const uploadedUrl = await this.uploadService.uploadFileFromUrl({
|
||||
url: url,
|
||||
dir: `images/suno-music/${currentDate}`,
|
||||
});
|
||||
imageUrls.push(uploadedUrl);
|
||||
}
|
||||
catch (error) {
|
||||
common_1.Logger.error(`上传图片文件失败: ${error.message}`, 'SunoService');
|
||||
imageUrls.push(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
audioUrls = validAudioUrls;
|
||||
videoUrls = validVideoUrls;
|
||||
imageUrls = validImageUrls;
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
common_1.Logger.error(`获取配置失败: ${error.message}`, 'LumaService');
|
||||
audioUrls = validAudioUrls;
|
||||
videoUrls = validVideoUrls;
|
||||
imageUrls = validImageUrls;
|
||||
}
|
||||
result.audioUrl = audioUrls.join(',');
|
||||
result.videoUrl = videoUrls.join(',');
|
||||
result.fileInfo = imageUrls.join(',');
|
||||
if (validAudioUrls.length === 2) {
|
||||
result.status = 3;
|
||||
result.answer = firstTitle;
|
||||
}
|
||||
else {
|
||||
result.status = 2;
|
||||
result.progress = responses === null || responses === void 0 ? void 0 : responses.progress;
|
||||
result.answer = `当前生成进度 ${responses === null || responses === void 0 ? void 0 : responses.progress}`;
|
||||
}
|
||||
common_1.Logger.debug(`音乐生成成功: ${JSON.stringify(data)}`, 'SunoService');
|
||||
onSuccess(result);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
result.audioUrl = validAudioUrls.join(',');
|
||||
result.videoUrl = validVideoUrls.join(',');
|
||||
result.fileInfo = validImageUrls.join(',');
|
||||
result.status = 2;
|
||||
result.progress = responses === null || responses === void 0 ? void 0 : responses.progress;
|
||||
result.answer = `当前生成进度 ${responses === null || responses === void 0 ? void 0 : responses.progress}`;
|
||||
result.answer = firstTitle;
|
||||
onAudioSuccess(result);
|
||||
}
|
||||
onAudioSuccess(result);
|
||||
}
|
||||
}
|
||||
if (responses.status === 'SUCCESS') {
|
||||
common_1.Logger.debug(`音乐生成成功: ${JSON.stringify(data)}`, 'SunoService');
|
||||
onSuccess(result);
|
||||
return;
|
||||
}
|
||||
if (result.progress && result.status === 2) {
|
||||
if (!result.audioUrl && result.progress && result.status === 2) {
|
||||
onGenerating(result);
|
||||
}
|
||||
}
|
||||
@@ -242,6 +316,8 @@ let SunoService = class SunoService {
|
||||
};
|
||||
SunoService = __decorate([
|
||||
(0, common_1.Injectable)(),
|
||||
__metadata("design:paramtypes", [chatLog_service_1.ChatLogService])
|
||||
__metadata("design:paramtypes", [chatLog_service_1.ChatLogService,
|
||||
upload_service_1.UploadService,
|
||||
globalConfig_service_1.GlobalConfigService])
|
||||
], SunoService);
|
||||
exports.SunoService = SunoService;
|
||||
|
||||
Reference in New Issue
Block a user