enviemronts
This commit is contained in:
1 parent
8b26bca72d
commit
04f5d6ec75
3 files changed
+5
-6
No files matched your search
+1
-2
@@ -1,4 +1,3 @@
|
|||||||
DISCORD_TOKEN=
|
DISCORD_TOKEN=
|
||||||
GEMINI_API_KEY=
|
GEMINI_API_KEY=
|
||||||
# Opcional
|
GEMINI_MODEL=
|
||||||
GEMINI_MODEL=gemini-3.8-flash
|
|
||||||
+1
-1
@@ -3,7 +3,7 @@ import type { AudioTrack } from './recorder.js';
|
|||||||
import { buildPrompt } from './prompt.js';
|
import { buildPrompt } from './prompt.js';
|
||||||
|
|
||||||
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
|
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
|
||||||
const MODEL = process.env.GEMINI_MODEL || 'gemini-3.8-flash';
|
export const MODEL = process.env.GEMINI_MODEL!;
|
||||||
|
|
||||||
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
|
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -9,9 +9,9 @@ import {
|
|||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { VoiceConnectionStatus, entersState } from '@discordjs/voice';
|
import { VoiceConnectionStatus, entersState } from '@discordjs/voice';
|
||||||
import { Recording } from './recorder.js';
|
import { Recording } from './recorder.js';
|
||||||
import { generateNotes } from './gemini.js';
|
import { MODEL, generateNotes } from './gemini.js';
|
||||||
|
|
||||||
for (const key of ['DISCORD_TOKEN', 'GEMINI_API_KEY']) {
|
for (const key of ['DISCORD_TOKEN', 'GEMINI_API_KEY', 'GEMINI_MODEL']) {
|
||||||
if (!process.env[key]) throw new Error(`Falta la variable de entorno ${key}`);
|
if (!process.env[key]) throw new Error(`Falta la variable de entorno ${key}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ async function autoFinish(guildId: string, reason: string) {
|
|||||||
|
|
||||||
client.once(Events.ClientReady, async (c) => {
|
client.once(Events.ClientReady, async (c) => {
|
||||||
await c.application.commands.set(commands.map((cmd) => cmd.toJSON()));
|
await c.application.commands.set(commands.map((cmd) => cmd.toJSON()));
|
||||||
console.log(`ready as ${c.user.tag}`);
|
console.log(`ready as ${c.user.tag} | modelo: ${MODEL}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on(Events.InteractionCreate, async (interaction) => {
|
client.on(Events.InteractionCreate, async (interaction) => {
|
||||||
|
|||||||
Reference in new issue
Block a user