feat: speech to text default true

This commit is contained in:
Victor Calazans 2025-07-09 18:54:01 -03:00
parent c5121ac063
commit edb1dcf41f
5 changed files with 13 additions and 3 deletions

View File

@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE `OpenaiSetting` MODIFY COLUMN `speechToText` BOOLEAN NULL DEFAULT true;
-- Update existing records to use the new default
UPDATE `OpenaiSetting` SET `speechToText` = true WHERE `speechToText` IS NULL OR `speechToText` = false;

View File

@ -469,7 +469,7 @@ model OpenaiSetting {
ignoreJids Json?
splitMessages Boolean? @default(false)
timePerChar Int? @default(50) @db.Int
speechToText Boolean? @default(false)
speechToText Boolean? @default(true)
createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
OpenaiCreds OpenaiCreds? @relation(fields: [openaiCredsId], references: [id])

View File

@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "OpenaiSetting" ALTER COLUMN "speechToText" SET DEFAULT true;
-- Update existing records to use the new default
UPDATE "OpenaiSetting" SET "speechToText" = true WHERE "speechToText" IS NULL OR "speechToText" = false;

View File

@ -476,7 +476,7 @@ model OpenaiSetting {
ignoreJids Json?
splitMessages Boolean? @default(false) @db.Boolean
timePerChar Int? @default(50) @db.Integer
speechToText Boolean? @default(false) @db.Boolean
speechToText Boolean? @default(true) @db.Boolean
createdAt DateTime? @default(now()) @db.Timestamp
updatedAt DateTime @updatedAt @db.Timestamp
OpenaiCreds OpenaiCreds? @relation(fields: [openaiCredsId], references: [id])

View File

@ -184,7 +184,7 @@ export class OpenaiController extends BaseChatbotController<OpenaiBot, OpenaiDto
keepOpen: data.keepOpen !== undefined ? data.keepOpen : false,
debounceTime: data.debounceTime || 1,
ignoreJids: data.ignoreJids || [],
speechToText: false,
speechToText: true,
});
} else if (!existingSettings.openaiCredsId && data.openaiCredsId) {
// Update settings with OpenAI credentials if they're missing