Compare commits

..

9 Commits

Author SHA1 Message Date
045c89a6cb chore: some prompt stuff
Some checks failed
Publish Docker image / Push Docker image to Docker Hub (push) Failing after 33s
2026-04-03 23:30:07 +02:00
8dcd2de683 chore: switch models again 2026-04-03 23:28:39 +02:00
e3c63632a1 chore: switch models 2026-04-03 23:27:13 +02:00
a6df2e4f31 fix: dont use the imports
Some checks failed
Publish Docker image / Push Docker image to Docker Hub (push) Failing after 13m0s
2026-04-02 17:47:59 +02:00
502811ca9f fix: disable scripts 2026-04-02 17:44:54 +02:00
58dd540ea9 fix: use bun 2026-04-02 17:42:24 +02:00
589f53c65c fix: install sern cli 2026-04-02 17:41:17 +02:00
66594ce8bd chore: run db migrations 2026-04-02 17:32:25 +02:00
effbe7d9c5 feat: the rewrite (#55) 2026-04-02 17:09:04 +02:00
9 changed files with 16 additions and 13 deletions

3
.gitignore vendored
View File

@@ -7,4 +7,5 @@ dist/
/generated/generated/prisma
src/utils/db/dict.db
prisma/vinci.db
!.env.example
!.env.example
.codex

View File

@@ -1,10 +1,11 @@
FROM oven/bun:alpine AS base
WORKDIR /app
RUN bun add -g @sern/cli
# Install dependencies
FROM base AS deps
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
RUN bun install --frozen-lockfile --ignore-scripts
# Build the application
FROM base AS build
@@ -35,4 +36,4 @@ COPY --from=build /app/.sern ./.sern
COPY --from=build /app/package.json ./package.json
COPY --from=build /app/prisma ./prisma
CMD ["bun", "dist/index.js"]
CMD ["sh", "-c", "bun run db:migrate && bun dist/index.js"]

View File

@@ -7,6 +7,7 @@
"scripts": {
"build": "sern build",
"start": "bun run --inspect .",
"db:migrate": "prisma migrate deploy",
"install": "sern build",
"commands:publish": "sern commands publish",
"dev": "sern build -w --watch-command \"bun start\"",

View File

@@ -1,4 +1,4 @@
import { Resolver } from '#/resolver';
import { Resolver } from '../../utils/resolver.js';
import { commandModule, CommandType } from '@sern/handler'
import { PublishConfig } from '@sern/publisher';
import { ActionRowBuilder, ApplicationCommandOptionType, ChannelType, Collection, EmbedBuilder, PermissionFlagsBits, Role, StringSelectMenuBuilder, TextChannel } from "discord.js";
@@ -87,4 +87,4 @@ function createMenu(channel: TextChannel, role: Collection<string, Role>) {
);
const row = new ActionRowBuilder<StringSelectMenuBuilder>().setComponents(menu);
return row;
};
};

View File

@@ -1,4 +1,4 @@
import { fisherYatesShuffle } from '#/fisheryates';
import { fisherYatesShuffle } from '../../utils/fisheryates.js';
import { commandModule, CommandType } from '@sern/handler';
import { EmbedBuilder } from 'discord.js';
import { readFile } from 'fs/promises';

View File

@@ -1,5 +1,5 @@
import { Palabra } from '#/db/dict.types';
import { WordController } from '#/wordController';
import { Palabra } from '../../utils/db/dict.types.js';
import { WordController } from '../../utils/wordController.js';
import { commandModule, CommandType } from '@sern/handler';
import { ActionRowBuilder, TextInputBuilder, TextInputStyle } from 'discord.js';

View File

@@ -1,4 +1,4 @@
import { Palabra } from '#/db/dict.types';
import { Palabra } from '../../utils/db/dict.types.js';
import { commandModule, CommandType } from '@sern/handler';
export default commandModule({

View File

@@ -1,4 +1,4 @@
import { aiHandle } from '#/aiHandle';
import { aiHandle } from '../../utils/aiHandle.js';
import { EventType, eventModule } from '@sern/handler';
import { ChannelType } from 'discord.js';

View File

@@ -13,7 +13,7 @@ export async function aiHandle(msg: OmitPartialGroupDMChannel<Message<boolean>>,
let aiChatId;
const newMessages: { role: string; content: string }[] = [];
const systemMsg =
'You are Vinci, a friendly and helpful Discord bot assistant dedicated to answering all user questions clearly and naturally, as if texting a friend. Avoid mentioning that you are an assistant, since users already know this. When it is useful, you can use markdown. You will interact with Spanish-speaking users, so all your responses, including any future ones, must be written exclusively in Spanish without exception.';
'You are Vinci, a friendly and helpful Discord bot assistant dedicated to answering all user questions clearly and naturally, as if texting a friend. Avoid mentioning that you are an assistant, since users already know this. When it is useful, you can use markdown. You will interact with Spanish-speaking users, so all your responses, including any future ones, must be written exclusively in Spanish without exception. Maintain a friendly tone. Ensure that your messages are short since you have a 2000 character limit.';
const messages: ChatCompletionMessageParam[] = [];
@@ -39,7 +39,7 @@ export async function aiHandle(msg: OmitPartialGroupDMChannel<Message<boolean>>,
const sentMsg = await msg.reply(':sparkles: Razonando...');
const stream = await openai.chat.completions.create({
model: 'google/gemini-3-pro-preview',
model: 'moonshotai/kimi-k2.5',
messages,
max_tokens: 2000,
max_completion_tokens: 2000,
@@ -70,7 +70,7 @@ export async function aiHandle(msg: OmitPartialGroupDMChannel<Message<boolean>>,
if (!isThread) {
const titleMessage = (
await openai.chat.completions.create({
model: 'google/gemini-3-pro-preview',
model: 'openai/gpt-oss-120b',
messages: [
{ role: 'system', content: systemMsg },
{