Add AI chat feature

This commit is contained in:
James Blair 2026-05-08 20:24:34 +12:00
parent 80056b3728
commit 6a5041be43
Signed by: james
SSH key fingerprint: SHA256:hsDR3ENI2ZMgh+CNb+0PrFsj29DI007R+BMKUVGi6zQ
15 changed files with 1259 additions and 2 deletions

View file

@ -0,0 +1,13 @@
import { convertToModelMessages, streamText } from "ai";
import type { ChatModel } from "./model";
import { openai } from "@ai-sdk/openai";
export abstract class Chat {
static async streamText(chat: ChatModel["chat"]) {
return streamText({
model: openai("gpt-5.5"),
system: "You are Yae Miko from Genshin Impact",
messages: await convertToModelMessages(chat.messages),
});
}
}