diff --git a/src/pages/api/chat.ts b/src/pages/api/chat.ts index c13a827..8dfce4e 100644 --- a/src/pages/api/chat.ts +++ b/src/pages/api/chat.ts @@ -1,7 +1,12 @@ import { env } from "../../env/server.mjs"; import { type NextApiRequest, type NextApiResponse } from "next"; import { PromptableApi } from "promptable"; -import { getReply } from "../../server/chat/gpt3"; +import { BOT_VERSION } from "../../server/chat/botConfig"; +import { getReply as getOriginalReply } from "../../server/chat/gpt3"; +import { getReply as getAlternateReply } from "../../server/chat/gpt3Alternate"; + +const getReply = BOT_VERSION === 'original' ? getOriginalReply : getAlternateReply; + import { Configuration, OpenAIApi } from "openai"; export const EMPATHY_PROMPT_ID = "clcj71xae00a0i6eghu9v7xbo"; diff --git a/src/server/chat/botConfig.ts b/src/server/chat/botConfig.ts new file mode 100644 index 0000000..1f3e5be --- /dev/null +++ b/src/server/chat/botConfig.ts @@ -0,0 +1,2 @@ +// src/server/chat/botConfig.ts +export const BOT_VERSION = 'original'; // can be 'original' or 'alternate' diff --git a/src/server/chat/gpt3Alternate.ts b/src/server/chat/gpt3Alternate.ts new file mode 100644 index 0000000..368f67f --- /dev/null +++ b/src/server/chat/gpt3Alternate.ts @@ -0,0 +1,8 @@ +import { Message } from "../../../types"; + +export async function getReply(message: Message): Promise { + // TODO: Implement your alternate response generation strategy here. + + // For now, let's just return a placeholder message: + return "I'm the alternate version of the chat bot. Nice to meet you!"; +}