refactor and rework palm request to work with the 'content' format and added an endpoint for googles tokenizer

This commit is contained in:
based
2023-12-14 15:49:50 +10:00
parent be396991de
commit e26159c00d
8 changed files with 108 additions and 46 deletions

View File

@ -1457,7 +1457,7 @@ async function sendOpenAIRequest(type, messages, signal) {
replaceItemizedPromptText(messageId, messages);
}
if (isAI21 || isGoogle) {
if (isAI21) {
const joinedMsgs = messages.reduce((acc, obj) => {
const prefix = prefixMap[obj.role];
return acc + (prefix ? (selected_group ? '\n' : prefix + ' ') : '') + obj.content + '\n';