From e589d66e363807d4ac47942bc49019dcaa366e93 Mon Sep 17 00:00:00 2001 From: "Kar l5.G" Date: Wed, 29 Jan 2025 21:03:30 +0530 Subject: [PATCH] list-models --- src/routes/api/aiTest.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/routes/api/aiTest.js b/src/routes/api/aiTest.js index 0586612..26c5c35 100644 --- a/src/routes/api/aiTest.js +++ b/src/routes/api/aiTest.js @@ -1,6 +1,6 @@ const aiFollowupQuestion = async (req, res) => { const { MongoClient } = require('mongodb'); - // const fetch = require('node-fetch'); + const fetch = require('node-fetch'); const { v4: uuidv4 } = require('uuid'); const url = process.env.MONGODB_URL; const dbName = process.env.MONGO_DB_NAME; @@ -14,12 +14,8 @@ const aiFollowupQuestion = async (req, res) => { const PROVIDER_KEYS = JSON.parse(process.env.PROVIDER_KEY || '[]'); const PROVIDER_MODELS = { - openai: [ - "gpt-4o", "gpt-4o-mini", "o1", "o1-mini", "gpt-3.5-turbo", "gpt-3.5" - ], - deepseek: [ - "deepseek-chat", "deepseek-reasoner" - ] + openai: [ "gpt-4o", "gpt-4o-mini", "o1", "o1-mini", "gpt-3.5-turbo", "gpt-3.5", "gpt-3.5-turbo-mini", "gpt-3.5-mini", "gpt-3.5-turbo-2", "gpt-3.5-2", "gpt-3.5-turbo-2-mini", "gpt-3.5-2-mini" ], + deepseek: [ "deepseek-chat", "deepseek-reasoner", "deepseek-qa", "deepseek-qa-mini" ], // Add more providers and models as needed }; @@ -61,7 +57,6 @@ const aiFollowupQuestion = async (req, res) => { const { prompt, sessionId, provider, model = "default-model", key } = req.body; - // Check if key is provided and valid if (!key || !PROVIDER_KEYS.includes(key)) { return res.status(403).json({ success: false,