#1994 Add Cohere as a Chat Completion source

This commit is contained in:
Cohee
2024-04-02 00:20:17 +03:00
parent 9c6d8e6895
commit 9838ba8044
12 changed files with 347 additions and 19 deletions

View File

@ -4836,7 +4836,7 @@ function extractMessageFromData(data) {
case 'novel':
return data.output;
case 'openai':
return data?.choices?.[0]?.message?.content ?? data?.choices?.[0]?.text ?? '';
return data?.choices?.[0]?.message?.content ?? data?.choices?.[0]?.text ?? data?.text ?? '';
default:
return '';
}
@ -8187,6 +8187,11 @@ const CONNECT_API_MAP = {
button: '#api_button_openai',
source: chat_completion_sources.CUSTOM,
},
'cohere': {
selected: 'cohere',
button: '#api_button_openai',
source: chat_completion_sources.COHERE,
},
'infermaticai': {
selected: 'textgenerationwebui',
button: '#api_button_textgenerationwebui',