mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
feat: allow default gpt api model before frontend customization
This commit is contained in:
parent
39ff9c1bc2
commit
4a94ee7af8
2 changed files with 11 additions and 0 deletions
|
|
@ -18,6 +18,12 @@ MONGO_URI="mongodb://127.0.0.1:27017/chatgpt-clone"
|
||||||
# API key configuration.
|
# API key configuration.
|
||||||
# Leave blank if you don't want them.
|
# Leave blank if you don't want them.
|
||||||
OPENAI_KEY=
|
OPENAI_KEY=
|
||||||
|
|
||||||
|
# Default ChatGPT API Model, options: 'gpt-4', 'text-davinci-003', 'gpt-3.5-turbo', 'gpt-3.5-turbo-0301'
|
||||||
|
# you will have errors if you don't have access to a model like 'gpt-4', defaults to turbo if left empty/excluded.
|
||||||
|
DEFAULT_API_GPT=gpt-3.5-turbo
|
||||||
|
|
||||||
|
# _U Cookies Value from bing.com
|
||||||
BING_TOKEN=
|
BING_TOKEN=
|
||||||
|
|
||||||
# ChatGPT Browser Client (free but use at your own risk)
|
# ChatGPT Browser Client (free but use at your own risk)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
const { KeyvFile } = require('keyv-file');
|
const { KeyvFile } = require('keyv-file');
|
||||||
|
const set = new Set(['gpt-4', 'text-davinci-003', 'gpt-3.5-turbo', 'gpt-3.5-turbo-0301']);
|
||||||
|
|
||||||
const clientOptions = {
|
const clientOptions = {
|
||||||
modelOptions: {
|
modelOptions: {
|
||||||
|
|
@ -9,6 +10,10 @@ const clientOptions = {
|
||||||
debug: false
|
debug: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (set.has(process.env.DEFAULT_API_GPT)) {
|
||||||
|
clientOptions.modelOptions.model = process.env.DEFAULT_API_GPT;
|
||||||
|
}
|
||||||
|
|
||||||
const askClient = async ({ text, onProgress, convo, abortController }) => {
|
const askClient = async ({ text, onProgress, convo, abortController }) => {
|
||||||
const ChatGPTClient = (await import('@waylaidwanderer/chatgpt-api')).default;
|
const ChatGPTClient = (await import('@waylaidwanderer/chatgpt-api')).default;
|
||||||
const store = {
|
const store = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue