From 566a6784c816c996350c47d9c4448c66ab0674b3 Mon Sep 17 00:00:00 2001 From: Luis Bauza Date: Thu, 6 Feb 2025 20:00:24 -0500 Subject: [PATCH] Update model references in ask command to use the latest version and clean up web search option handling --- __tests__/commands/ask.test.js | 6 +++--- commands/ask.js | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/__tests__/commands/ask.test.js b/__tests__/commands/ask.test.js index 19b05af..97a7a1d 100644 --- a/__tests__/commands/ask.test.js +++ b/__tests__/commands/ask.test.js @@ -120,7 +120,7 @@ describe('Ask Command', () => { expect(axios.post).toHaveBeenCalledWith( 'https://openrouter.ai/api/v1/chat/completions', expect.objectContaining({ - model: 'google/gemini-2.0-flash-exp:free', + model: 'google/gemini-2.0-flash-001', plugins: undefined, }), expect.any(Object), @@ -151,7 +151,7 @@ describe('Ask Command', () => { expect(axios.post).toHaveBeenCalledWith( 'https://openrouter.ai/api/v1/chat/completions', expect.objectContaining({ - model: 'google/gemini-2.0-flash-exp:free:online', + model: 'google/gemini-2.0-flash-001:online', plugins: expect.arrayContaining([ expect.objectContaining({ id: 'web', @@ -185,7 +185,7 @@ describe('Ask Command', () => { expect(axios.post).toHaveBeenCalledWith( 'https://openrouter.ai/api/v1/chat/completions', expect.objectContaining({ - model: 'google/gemini-2.0-flash-exp:free', + model: 'google/gemini-2.0-flash-001', plugins: undefined, }), expect.any(Object), diff --git a/commands/ask.js b/commands/ask.js index 0754536..5ab8b83 100644 --- a/commands/ask.js +++ b/commands/ask.js @@ -28,9 +28,7 @@ module.exports = { .setName('websearch') .setDescription('Enable web search for more up-to-date information') .setRequired(false), - ) - // Only show the websearch option if overrides are allowed - .setDMPermission(false), + ), async execute(interaction) { await interaction.deferReply(); @@ -49,8 +47,8 @@ module.exports = { 'https://openrouter.ai/api/v1/chat/completions', { model: webSearchEnabled - ? 'google/gemini-2.0-flash-exp:free:online' - : 'google/gemini-2.0-flash-exp:free', + ? 'google/gemini-2.0-flash-001:online' + : 'google/gemini-2.0-flash-001', messages: [ { role: 'system',