diff --git a/bot/prod/config/prompt.js b/bot/prod/config/prompt.js index 9593e41..bba1936 100644 --- a/bot/prod/config/prompt.js +++ b/bot/prod/config/prompt.js @@ -6,8 +6,8 @@ export const prompt = `You are a support agent named Hikari. Your personality is upbeat and energetic, almost like a magical girl. Your role is to help NHCarrigan's customer with their questions about our products. As such, you should be referencing the following sources: +- The MCP server you have been provided - Our documentation, at https://docs.nhcarrigan.com -- The Model Context Protocol for our documentation, at https://hikari.nhcarrigan.com/api/mcp - Our source code, at https://git.nhcarrigan.com/nhcarrigan - A TypeScript file containing our list of products, at https://git.nhcarrigan.com/nhcarrigan/hikari/raw/branch/main/client/src/app/config/products.ts - if you refer to this, the URL you share with the user should be the human-friendly https://hikari.nhcarrigan.com/products. If a user asks something you do not know, you should encourage them to reach out in our Discord community. diff --git a/bot/prod/modules/ai.js b/bot/prod/modules/ai.js index 005eea8..2aff465 100644 --- a/bot/prod/modules/ai.js +++ b/bot/prod/modules/ai.js @@ -30,9 +30,17 @@ export const ai = async (hikari, messages, username, channel) => { }, 3000); const parsedPrompt = prompt.replace("{{username}}", username); const result = await anthropic.beta.messages.create({ - betas: ["web-search-2025-03-05"], + betas: ["web-search-2025-03-05", "mcp-client-2025-04-04"], // eslint-disable-next-line @typescript-eslint/naming-convention -- API requirement max_tokens: 20_000, + // eslint-disable-next-line @typescript-eslint/naming-convention -- API requirement + mcp_servers: [ + { + name: "documentation", + type: "url", + url: "https://hikari.nhcarrigan.com/api/mcp", + }, + ], messages: messages.map((message) => { return { content: message.content, diff --git a/bot/src/config/prompt.ts b/bot/src/config/prompt.ts index 9593e41..bba1936 100644 --- a/bot/src/config/prompt.ts +++ b/bot/src/config/prompt.ts @@ -6,8 +6,8 @@ export const prompt = `You are a support agent named Hikari. Your personality is upbeat and energetic, almost like a magical girl. Your role is to help NHCarrigan's customer with their questions about our products. As such, you should be referencing the following sources: +- The MCP server you have been provided - Our documentation, at https://docs.nhcarrigan.com -- The Model Context Protocol for our documentation, at https://hikari.nhcarrigan.com/api/mcp - Our source code, at https://git.nhcarrigan.com/nhcarrigan - A TypeScript file containing our list of products, at https://git.nhcarrigan.com/nhcarrigan/hikari/raw/branch/main/client/src/app/config/products.ts - if you refer to this, the URL you share with the user should be the human-friendly https://hikari.nhcarrigan.com/products. If a user asks something you do not know, you should encourage them to reach out in our Discord community. diff --git a/bot/src/modules/ai.ts b/bot/src/modules/ai.ts index 13c9751..1012a01 100644 --- a/bot/src/modules/ai.ts +++ b/bot/src/modules/ai.ts @@ -41,10 +41,18 @@ export const ai = async( const parsedPrompt = prompt.replace("{{username}}", username); const result = await anthropic.beta.messages.create({ - betas: [ "web-search-2025-03-05" ], + betas: [ "web-search-2025-03-05", "mcp-client-2025-04-04" ], // eslint-disable-next-line @typescript-eslint/naming-convention -- API requirement - max_tokens: 20_000, - messages: messages.map((message) => { + max_tokens: 20_000, + // eslint-disable-next-line @typescript-eslint/naming-convention -- API requirement + mcp_servers: [ + { + name: "documentation", + type: "url", + url: "https://hikari.nhcarrigan.com/api/mcp", + }, + ], + messages: messages.map((message) => { return { content: message.content, role: message.author.id === hikari.user?.id @@ -62,6 +70,7 @@ export const ai = async( name: "web_search", type: "web_search_20250305", }, + ], }); await calculateCost(result.usage, username);