fix: add PaLM icon as SVG and improve meilisearch syncing to prevent large indicing jobs (#600)

* feat(getIcon.jsx): replace palm.png with google-palm.svg as the icon for the 'google' endpoint

* fix(mongoMeili): improve syncing, prevent large indicing jobs from being queued
fix(gptPlugins.js, openAI.js): use unfinished and cancelled values when saving messages to help optimize syncing
This commit is contained in:
Danny Avila 2023-07-07 02:03:23 -04:00 committed by GitHub
parent 2607f157d3
commit 9eefa3e24c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 127 additions and 24 deletions

View file

@ -71,7 +71,7 @@ class BaseClient {
};
}
createUserMessage({ messageId, parentMessageId, conversationId, text}) {
createUserMessage({ messageId, parentMessageId, conversationId, text }) {
const userMessage = {
messageId,
parentMessageId,
@ -293,7 +293,7 @@ class BaseClient {
};
}
async handleContextStrategy({instructions, orderedMessages, formattedMessages}) {
async handleContextStrategy({ instructions, orderedMessages, formattedMessages }) {
let payload = this.addInstructions(formattedMessages, instructions);
let orderedWithInstructions = this.addInstructions(orderedMessages, instructions);
let {
@ -350,7 +350,7 @@ class BaseClient {
}
if (index === refineIndex) {
map.refined = { ...refinedMessage, messageId: message.messageId};
map.refined = { ...refinedMessage, messageId: message.messageId };
}
map[message.messageId] = payload[index].tokenCount;
@ -457,7 +457,7 @@ class BaseClient {
}
async saveMessageToDatabase(message, endpointOptions, user = null) {
await saveMessage({ ...message, unfinished: false });
await saveMessage({ ...message, unfinished: false, cancelled: false });
await saveConvo(user, {
conversationId: message.conversationId,
endpoint: this.options.endpoint,