mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
fix bingai bugs and add chatgptbrowser client
This commit is contained in:
parent
168d5e8075
commit
16932b37c0
7 changed files with 42 additions and 46 deletions
|
|
@ -22,14 +22,14 @@ const ask = async (question, progressCallback, convo) => {
|
|||
return res;
|
||||
};
|
||||
|
||||
const titleConvo = async (message, response) => {
|
||||
const titleConvo = async (message, response, model) => {
|
||||
const configuration = new Configuration({
|
||||
apiKey: process.env.OPENAI_KEY
|
||||
});
|
||||
const openai = new OpenAIApi(configuration);
|
||||
const completion = await openai.createCompletion({
|
||||
model: 'text-davinci-002',
|
||||
prompt: `Write a short title in title case, ideally in 5 words or less, and do not refer to the user or GPT, that summarizes this conversation:\nUser:"${message}"\nGPT:"${response}"\nTitle: `
|
||||
prompt: `Write a short title in title case, ideally in 5 words or less, and do not refer to the user or ${model}, that summarizes this conversation:\nUser:"${message}"\n${model}:"${response}"\nTitle: `
|
||||
});
|
||||
|
||||
return completion.data.choices[0].text.replace(/\n/g, '');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue