File size: 781 Bytes
9705b6c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const {
  getOpenAIModels,
  getChatGPTBrowserModels,
  getAnthropicModels,
} = require('../services/ModelService');

const { useAzurePlugins } = require('../services/EndpointService').config;

async function modelController(req, res) {
  const google = ['chat-bison', 'text-bison', 'codechat-bison'];
  const openAI = await getOpenAIModels();
  const azureOpenAI = await getOpenAIModels({ azure: true });
  const gptPlugins = await getOpenAIModels({ azure: useAzurePlugins, plugins: true });
  const bingAI = ['BingAI', 'Sydney'];
  const chatGPTBrowser = getChatGPTBrowserModels();
  const anthropic = getAnthropicModels();

  res.send(
    JSON.stringify({ azureOpenAI, openAI, google, bingAI, chatGPTBrowser, gptPlugins, anthropic }),
  );
}

module.exports = modelController;