merge commit

This commit is contained in:
Daniel Avila 2023-03-17 19:40:44 -04:00
commit 586c162404
25 changed files with 431 additions and 283 deletions

View file

@ -9,14 +9,14 @@ const clientOptions = {
debug: false
};
const askClient = async ({ text, onProgress, convo }) => {
const askClient = async ({ text, onProgress, convo, abortController }) => {
const ChatGPTClient = (await import('@waylaidwanderer/chatgpt-api')).default;
const store = {
store: new KeyvFile({ filename: './data/cache.json' })
};
const client = new ChatGPTClient(process.env.OPENAI_KEY, clientOptions, store);
let options = { onProgress };
let options = { onProgress, abortController };
if (!!convo.parentMessageId && !!convo.conversationId) {
options = { ...options, ...convo };