mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 12:12:55 -06:00
refactor(openai): improve service initialization and streamline audio transcription handling
- Updated OpenaiService and related classes to enhance the initialization process by ensuring the correct order of parameters. - Simplified audio message handling by consolidating transcription logic and improving error handling. - Refactored the OpenaiController to utilize the new structure, ensuring better integration with the base chatbot framework. - Enhanced logging for better traceability during audio processing and API interactions.
This commit is contained in:
parent
69b4f1aa02
commit
c30bae4c3a
@ -165,11 +165,7 @@ export class EvolutionStartupService extends ChannelStartupService {
|
|||||||
openAiDefaultSettings.speechToText &&
|
openAiDefaultSettings.speechToText &&
|
||||||
received?.message?.audioMessage
|
received?.message?.audioMessage
|
||||||
) {
|
) {
|
||||||
messageRaw.message.speechToText = await this.openaiService.speechToText(
|
messageRaw.message.speechToText = await this.openaiService.speechToText(received);
|
||||||
openAiDefaultSettings.OpenaiCreds,
|
|
||||||
received,
|
|
||||||
this.client.updateMediaMessage,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,16 +501,12 @@ export class BusinessStartupService extends ChannelStartupService {
|
|||||||
openAiDefaultSettings.speechToText &&
|
openAiDefaultSettings.speechToText &&
|
||||||
audioMessage
|
audioMessage
|
||||||
) {
|
) {
|
||||||
messageRaw.message.speechToText = await this.openaiService.speechToText(
|
messageRaw.message.speechToText = await this.openaiService.speechToText({
|
||||||
openAiDefaultSettings.OpenaiCreds,
|
message: {
|
||||||
{
|
mediaUrl: messageRaw.message.mediaUrl,
|
||||||
message: {
|
...messageRaw,
|
||||||
mediaUrl: messageRaw.message.mediaUrl,
|
|
||||||
...messageRaw,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
() => {},
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1298,11 +1298,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (openAiDefaultSettings && openAiDefaultSettings.openaiCredsId && openAiDefaultSettings.speechToText) {
|
if (openAiDefaultSettings && openAiDefaultSettings.openaiCredsId && openAiDefaultSettings.speechToText) {
|
||||||
messageRaw.message.speechToText = await this.openaiService.speechToText(
|
messageRaw.message.speechToText = await this.openaiService.speechToText(received);
|
||||||
openAiDefaultSettings.OpenaiCreds,
|
|
||||||
received,
|
|
||||||
this.client.updateMediaMessage,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2297,11 +2293,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (openAiDefaultSettings && openAiDefaultSettings.openaiCredsId && openAiDefaultSettings.speechToText) {
|
if (openAiDefaultSettings && openAiDefaultSettings.openaiCredsId && openAiDefaultSettings.speechToText) {
|
||||||
messageRaw.message.speechToText = await this.openaiService.speechToText(
|
messageRaw.message.speechToText = await this.openaiService.speechToText(messageRaw);
|
||||||
openAiDefaultSettings.OpenaiCreds,
|
|
||||||
messageRaw,
|
|
||||||
this.client.updateMediaMessage,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,10 @@ export interface BaseBotData {
|
|||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export abstract class BaseChatbotController<BotType = any, BotData extends BaseChatbotDto = BaseChatbotDto> extends ChatbotController implements ChatbotControllerInterface {
|
export abstract class BaseChatbotController<BotType = any, BotData extends BaseChatbotDto = BaseChatbotDto>
|
||||||
|
extends ChatbotController
|
||||||
|
implements ChatbotControllerInterface
|
||||||
|
{
|
||||||
public readonly logger: Logger;
|
public readonly logger: Logger;
|
||||||
|
|
||||||
integrationEnabled: boolean;
|
integrationEnabled: boolean;
|
||||||
@ -74,10 +77,7 @@ export abstract class BaseChatbotController<BotType = any, BotData extends BaseC
|
|||||||
// Method to get the fallback bot ID from settings
|
// Method to get the fallback bot ID from settings
|
||||||
protected abstract getFallbackBotId(settings: any): string | undefined;
|
protected abstract getFallbackBotId(settings: any): string | undefined;
|
||||||
|
|
||||||
constructor(
|
constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) {
|
||||||
prismaRepository: PrismaRepository,
|
|
||||||
waMonitor: WAMonitoringService,
|
|
||||||
) {
|
|
||||||
super(prismaRepository, waMonitor);
|
super(prismaRepository, waMonitor);
|
||||||
|
|
||||||
this.sessionRepository = this.prismaRepository.integrationSession;
|
this.sessionRepository = this.prismaRepository.integrationSession;
|
||||||
@ -161,7 +161,9 @@ export abstract class BaseChatbotController<BotType = any, BotData extends BaseC
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (checkTriggerAll && data.triggerType === 'all') {
|
if (checkTriggerAll && data.triggerType === 'all') {
|
||||||
throw new Error(`You already have a ${this.integrationName} with an "All" trigger, you cannot have more bots while it is active`);
|
throw new Error(
|
||||||
|
`You already have a ${this.integrationName} with an "All" trigger, you cannot have more bots while it is active`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for trigger keyword duplicates
|
// Check for trigger keyword duplicates
|
||||||
@ -336,20 +338,25 @@ export abstract class BaseChatbotController<BotType = any, BotData extends BaseC
|
|||||||
// Map the specific fallback field to a generic 'fallbackId' in the response
|
// Map the specific fallback field to a generic 'fallbackId' in the response
|
||||||
return {
|
return {
|
||||||
...settings,
|
...settings,
|
||||||
fallbackId: settings[fallbackFieldName]
|
fallbackId: settings[fallbackFieldName],
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
const settings = await this.settingsRepository.create({
|
const settings = await this.settingsRepository.create({
|
||||||
data: {
|
data: {
|
||||||
...settingsData,
|
...settingsData,
|
||||||
instanceId: instanceId,
|
instanceId: instanceId,
|
||||||
|
Instance: {
|
||||||
|
connect: {
|
||||||
|
id: instanceId,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Map the specific fallback field to a generic 'fallbackId' in the response
|
// Map the specific fallback field to a generic 'fallbackId' in the response
|
||||||
return {
|
return {
|
||||||
...settings,
|
...settings,
|
||||||
fallbackId: settings[fallbackFieldName]
|
fallbackId: settings[fallbackFieldName],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -631,7 +638,9 @@ export abstract class BaseChatbotController<BotType = any, BotData extends BaseC
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (checkTriggerAll) {
|
if (checkTriggerAll) {
|
||||||
throw new Error(`You already have a ${this.integrationName} with an "All" trigger, you cannot have more bots while it is active`);
|
throw new Error(
|
||||||
|
`You already have a ${this.integrationName} with an "All" trigger, you cannot have more bots while it is active`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { InstanceDto } from '@api/dto/instance.dto';
|
import { InstanceDto } from '@api/dto/instance.dto';
|
||||||
import { PrismaRepository } from '@api/repository/repository.service';
|
import { PrismaRepository } from '@api/repository/repository.service';
|
||||||
import { WAMonitoringService } from '@api/services/monitor.service';
|
import { WAMonitoringService } from '@api/services/monitor.service';
|
||||||
|
import { Integration } from '@api/types/wa.types';
|
||||||
import { ConfigService, Language } from '@config/env.config';
|
import { ConfigService, Language } from '@config/env.config';
|
||||||
import { Logger } from '@config/logger.config';
|
import { Logger } from '@config/logger.config';
|
||||||
import { IntegrationSession } from '@prisma/client';
|
import { IntegrationSession } from '@prisma/client';
|
||||||
import { Integration } from '@api/types/wa.types';
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import FormData from 'form-data';
|
import FormData from 'form-data';
|
||||||
|
|
||||||
@ -119,14 +119,16 @@ export abstract class BaseChatbotService<BotType = any, SettingsType = any> {
|
|||||||
public async createNewSession(instance: InstanceDto | any, data: any, type: string) {
|
public async createNewSession(instance: InstanceDto | any, data: any, type: string) {
|
||||||
try {
|
try {
|
||||||
// Extract pushName safely - if data.pushName is an object with a pushName property, use that
|
// Extract pushName safely - if data.pushName is an object with a pushName property, use that
|
||||||
const pushNameValue = typeof data.pushName === 'object' && data.pushName?.pushName
|
const pushNameValue =
|
||||||
? data.pushName.pushName
|
typeof data.pushName === 'object' && data.pushName?.pushName
|
||||||
: (typeof data.pushName === 'string' ? data.pushName : null);
|
? data.pushName.pushName
|
||||||
|
: typeof data.pushName === 'string'
|
||||||
|
? data.pushName
|
||||||
|
: null;
|
||||||
|
|
||||||
// Extract remoteJid safely
|
// Extract remoteJid safely
|
||||||
const remoteJidValue = typeof data.remoteJid === 'object' && data.remoteJid?.remoteJid
|
const remoteJidValue =
|
||||||
? data.remoteJid.remoteJid
|
typeof data.remoteJid === 'object' && data.remoteJid?.remoteJid ? data.remoteJid.remoteJid : data.remoteJid;
|
||||||
: data.remoteJid;
|
|
||||||
|
|
||||||
const session = await this.prismaRepository.integrationSession.create({
|
const session = await this.prismaRepository.integrationSession.create({
|
||||||
data: {
|
data: {
|
||||||
@ -206,7 +208,7 @@ export abstract class BaseChatbotService<BotType = any, SettingsType = any> {
|
|||||||
instance: any,
|
instance: any,
|
||||||
remoteJid: string,
|
remoteJid: string,
|
||||||
message: string,
|
message: string,
|
||||||
settings: SettingsType
|
settings: SettingsType,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (!message) return;
|
if (!message) return;
|
||||||
|
|
||||||
@ -303,7 +305,7 @@ export abstract class BaseChatbotService<BotType = any, SettingsType = any> {
|
|||||||
remoteJid: string,
|
remoteJid: string,
|
||||||
text: string,
|
text: string,
|
||||||
settings: any,
|
settings: any,
|
||||||
splitMessages: boolean
|
splitMessages: boolean,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const timePerChar = settings?.timePerChar ?? 0;
|
const timePerChar = settings?.timePerChar ?? 0;
|
||||||
const minDelay = 1000;
|
const minDelay = 1000;
|
||||||
@ -385,15 +387,18 @@ export abstract class BaseChatbotService<BotType = any, SettingsType = any> {
|
|||||||
// Create a session if none exists
|
// Create a session if none exists
|
||||||
if (!session) {
|
if (!session) {
|
||||||
// Extract pushName properly - if it's an object with pushName property, use that
|
// Extract pushName properly - if it's an object with pushName property, use that
|
||||||
const pushNameValue = typeof pushName === 'object' && pushName?.pushName
|
const pushNameValue =
|
||||||
? pushName.pushName
|
typeof pushName === 'object' && pushName?.pushName
|
||||||
: (typeof pushName === 'string' ? pushName : null);
|
? pushName.pushName
|
||||||
|
: typeof pushName === 'string'
|
||||||
|
? pushName
|
||||||
|
: null;
|
||||||
|
|
||||||
session = (
|
session = (
|
||||||
await this.createNewSession(
|
await this.createNewSession(
|
||||||
{
|
{
|
||||||
instanceName: instance.instanceName,
|
instanceName: instance.instanceName,
|
||||||
instanceId: instance.instanceId
|
instanceId: instance.instanceId,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
remoteJid,
|
remoteJid,
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import { InstanceDto } from '@api/dto/instance.dto';
|
import { InstanceDto } from '@api/dto/instance.dto';
|
||||||
import { DifyDto } from '@api/integrations/chatbot/dify/dto/dify.dto';
|
import { DifyDto } from '@api/integrations/chatbot/dify/dto/dify.dto';
|
||||||
import { DifyService } from '@api/integrations/chatbot/dify/services/dify.service';
|
import { DifyService } from '@api/integrations/chatbot/dify/services/dify.service';
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { $Enums, TriggerOperator, TriggerType } from '@prisma/client';
|
import { $Enums, TriggerOperator, TriggerType } from '@prisma/client';
|
||||||
|
|
||||||
import { BaseChatbotDto, BaseChatbotSettingDto } from '../../base-chatbot.dto';
|
import { BaseChatbotDto, BaseChatbotSettingDto } from '../../base-chatbot.dto';
|
||||||
|
|
||||||
export class DifyDto extends BaseChatbotDto {
|
export class DifyDto extends BaseChatbotDto {
|
||||||
|
@ -2,21 +2,16 @@ import { InstanceDto } from '@api/dto/instance.dto';
|
|||||||
import { PrismaRepository } from '@api/repository/repository.service';
|
import { PrismaRepository } from '@api/repository/repository.service';
|
||||||
import { WAMonitoringService } from '@api/services/monitor.service';
|
import { WAMonitoringService } from '@api/services/monitor.service';
|
||||||
import { Integration } from '@api/types/wa.types';
|
import { Integration } from '@api/types/wa.types';
|
||||||
|
import { Auth, ConfigService, HttpServer } from '@config/env.config';
|
||||||
import { Dify, DifySetting, IntegrationSession } from '@prisma/client';
|
import { Dify, DifySetting, IntegrationSession } from '@prisma/client';
|
||||||
import { sendTelemetry } from '@utils/sendTelemetry';
|
import { sendTelemetry } from '@utils/sendTelemetry';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { downloadMediaMessage } from 'baileys';
|
import { downloadMediaMessage } from 'baileys';
|
||||||
|
|
||||||
import { BaseChatbotService } from '../../base-chatbot.service';
|
import { BaseChatbotService } from '../../base-chatbot.service';
|
||||||
import { ConfigService, HttpServer } from '@config/env.config';
|
|
||||||
import { Auth } from '@config/env.config';
|
|
||||||
|
|
||||||
export class DifyService extends BaseChatbotService<Dify, DifySetting> {
|
export class DifyService extends BaseChatbotService<Dify, DifySetting> {
|
||||||
constructor(
|
constructor(waMonitor: WAMonitoringService, configService: ConfigService, prismaRepository: PrismaRepository) {
|
||||||
waMonitor: WAMonitoringService,
|
|
||||||
configService: ConfigService,
|
|
||||||
prismaRepository: PrismaRepository,
|
|
||||||
) {
|
|
||||||
super(waMonitor, prismaRepository, 'DifyService', configService);
|
super(waMonitor, prismaRepository, 'DifyService', configService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -554,16 +549,7 @@ export class DifyService extends BaseChatbotService<Dify, DifySetting> {
|
|||||||
data,
|
data,
|
||||||
);
|
);
|
||||||
|
|
||||||
await this.initNewSession(
|
await this.initNewSession(instance, remoteJid, dify, settings, createSession.session, content, pushName, msg);
|
||||||
instance,
|
|
||||||
remoteJid,
|
|
||||||
dify,
|
|
||||||
settings,
|
|
||||||
createSession.session,
|
|
||||||
content,
|
|
||||||
pushName,
|
|
||||||
msg,
|
|
||||||
);
|
|
||||||
|
|
||||||
await sendTelemetry('/dify/session/start');
|
await sendTelemetry('/dify/session/start');
|
||||||
return;
|
return;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { TriggerOperator, TriggerType } from '@prisma/client';
|
import { TriggerOperator, TriggerType } from '@prisma/client';
|
||||||
|
|
||||||
import { BaseChatbotDto, BaseChatbotSettingDto } from '../../base-chatbot.dto';
|
import { BaseChatbotDto, BaseChatbotSettingDto } from '../../base-chatbot.dto';
|
||||||
|
|
||||||
export class EvoaiDto extends BaseChatbotDto {
|
export class EvoaiDto extends BaseChatbotDto {
|
||||||
|
@ -11,11 +11,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|||||||
import { BaseChatbotService } from '../../base-chatbot.service';
|
import { BaseChatbotService } from '../../base-chatbot.service';
|
||||||
|
|
||||||
export class EvoaiService extends BaseChatbotService<Evoai, EvoaiSetting> {
|
export class EvoaiService extends BaseChatbotService<Evoai, EvoaiSetting> {
|
||||||
constructor(
|
constructor(waMonitor: WAMonitoringService, prismaRepository: PrismaRepository, configService: ConfigService) {
|
||||||
waMonitor: WAMonitoringService,
|
|
||||||
prismaRepository: PrismaRepository,
|
|
||||||
configService: ConfigService,
|
|
||||||
) {
|
|
||||||
super(waMonitor, prismaRepository, 'EvoaiService', configService);
|
super(waMonitor, prismaRepository, 'EvoaiService', configService);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { TriggerOperator, TriggerType } from '@prisma/client';
|
import { TriggerOperator, TriggerType } from '@prisma/client';
|
||||||
|
|
||||||
import { BaseChatbotDto, BaseChatbotSettingDto } from '../../base-chatbot.dto';
|
import { BaseChatbotDto, BaseChatbotSettingDto } from '../../base-chatbot.dto';
|
||||||
|
|
||||||
export class N8nDto extends BaseChatbotDto {
|
export class N8nDto extends BaseChatbotDto {
|
||||||
|
@ -11,11 +11,7 @@ import { BaseChatbotService } from '../../base-chatbot.service';
|
|||||||
import { N8nDto } from '../dto/n8n.dto';
|
import { N8nDto } from '../dto/n8n.dto';
|
||||||
|
|
||||||
export class N8nService extends BaseChatbotService<N8n, N8nSetting> {
|
export class N8nService extends BaseChatbotService<N8n, N8nSetting> {
|
||||||
constructor(
|
constructor(waMonitor: WAMonitoringService, prismaRepository: PrismaRepository, configService: ConfigService) {
|
||||||
waMonitor: WAMonitoringService,
|
|
||||||
prismaRepository: PrismaRepository,
|
|
||||||
configService: ConfigService,
|
|
||||||
) {
|
|
||||||
super(waMonitor, prismaRepository, 'N8nService', configService);
|
super(waMonitor, prismaRepository, 'N8nService', configService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -443,16 +439,7 @@ export class N8nService extends BaseChatbotService<N8n, N8nSetting> {
|
|||||||
data,
|
data,
|
||||||
);
|
);
|
||||||
|
|
||||||
await this.initNewSession(
|
await this.initNewSession(instance, remoteJid, n8n, settings, createSession.session, content, pushName, msg);
|
||||||
instance,
|
|
||||||
remoteJid,
|
|
||||||
n8n,
|
|
||||||
settings,
|
|
||||||
createSession.session,
|
|
||||||
content,
|
|
||||||
pushName,
|
|
||||||
msg,
|
|
||||||
);
|
|
||||||
|
|
||||||
await sendTelemetry('/n8n/session/start');
|
await sendTelemetry('/n8n/session/start');
|
||||||
return;
|
return;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,15 +1,15 @@
|
|||||||
import { TriggerOperator, TriggerType } from '@prisma/client';
|
import { TriggerOperator, TriggerType } from '@prisma/client';
|
||||||
|
|
||||||
|
import { BaseChatbotDto, BaseChatbotSettingDto } from '../../base-chatbot.dto';
|
||||||
|
|
||||||
export class OpenaiCredsDto {
|
export class OpenaiCredsDto {
|
||||||
name: string;
|
name: string;
|
||||||
apiKey: string;
|
apiKey: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class OpenaiDto {
|
export class OpenaiDto extends BaseChatbotDto {
|
||||||
enabled?: boolean;
|
|
||||||
description?: string;
|
|
||||||
openaiCredsId: string;
|
openaiCredsId: string;
|
||||||
botType?: string;
|
botType: string;
|
||||||
assistantId?: string;
|
assistantId?: string;
|
||||||
functionUrl?: string;
|
functionUrl?: string;
|
||||||
model?: string;
|
model?: string;
|
||||||
@ -17,35 +17,10 @@ export class OpenaiDto {
|
|||||||
assistantMessages?: string[];
|
assistantMessages?: string[];
|
||||||
userMessages?: string[];
|
userMessages?: string[];
|
||||||
maxTokens?: number;
|
maxTokens?: number;
|
||||||
expire?: number;
|
|
||||||
keywordFinish?: string;
|
|
||||||
delayMessage?: number;
|
|
||||||
unknownMessage?: string;
|
|
||||||
listeningFromMe?: boolean;
|
|
||||||
stopBotFromMe?: boolean;
|
|
||||||
keepOpen?: boolean;
|
|
||||||
debounceTime?: number;
|
|
||||||
triggerType?: TriggerType;
|
|
||||||
triggerOperator?: TriggerOperator;
|
|
||||||
triggerValue?: string;
|
|
||||||
ignoreJids?: any;
|
|
||||||
splitMessages?: boolean;
|
|
||||||
timePerChar?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class OpenaiSettingDto {
|
export class OpenaiSettingDto extends BaseChatbotSettingDto {
|
||||||
openaiCredsId?: string;
|
openaiCredsId?: string;
|
||||||
expire?: number;
|
|
||||||
keywordFinish?: string;
|
|
||||||
delayMessage?: number;
|
|
||||||
unknownMessage?: string;
|
|
||||||
listeningFromMe?: boolean;
|
|
||||||
stopBotFromMe?: boolean;
|
|
||||||
keepOpen?: boolean;
|
|
||||||
debounceTime?: number;
|
|
||||||
openaiIdFallback?: string;
|
openaiIdFallback?: string;
|
||||||
ignoreJids?: any;
|
|
||||||
speechToText?: boolean;
|
speechToText?: boolean;
|
||||||
splitMessages?: boolean;
|
|
||||||
timePerChar?: number;
|
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -119,7 +119,7 @@ export const baileysController = new BaileysController(waMonitor);
|
|||||||
const typebotService = new TypebotService(waMonitor, configService, prismaRepository);
|
const typebotService = new TypebotService(waMonitor, configService, prismaRepository);
|
||||||
export const typebotController = new TypebotController(typebotService, prismaRepository, waMonitor);
|
export const typebotController = new TypebotController(typebotService, prismaRepository, waMonitor);
|
||||||
|
|
||||||
const openaiService = new OpenaiService(waMonitor, configService, prismaRepository);
|
const openaiService = new OpenaiService(waMonitor, prismaRepository, configService);
|
||||||
export const openaiController = new OpenaiController(openaiService, prismaRepository, waMonitor);
|
export const openaiController = new OpenaiController(openaiService, prismaRepository, waMonitor);
|
||||||
|
|
||||||
const difyService = new DifyService(waMonitor, configService, prismaRepository);
|
const difyService = new DifyService(waMonitor, configService, prismaRepository);
|
||||||
|
@ -47,7 +47,7 @@ export class ChannelStartupService {
|
|||||||
|
|
||||||
public typebotService = new TypebotService(waMonitor, this.configService, this.prismaRepository);
|
public typebotService = new TypebotService(waMonitor, this.configService, this.prismaRepository);
|
||||||
|
|
||||||
public openaiService = new OpenaiService(waMonitor, this.configService, this.prismaRepository);
|
public openaiService = new OpenaiService(waMonitor, this.prismaRepository, this.configService);
|
||||||
|
|
||||||
public difyService = new DifyService(waMonitor, this.configService, this.prismaRepository);
|
public difyService = new DifyService(waMonitor, this.configService, this.prismaRepository);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user