diff --git a/Dockerfile b/Dockerfile index 32d0e7f..9ef0693 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,4 +17,3 @@ RUN npx tsc # Run the app CMD ["node", "dist/src/index.js"] -STOPSIGNAL SIGINT diff --git a/src/execution.ts b/src/execution.ts index 44e5710..3b8e2fd 100644 --- a/src/execution.ts +++ b/src/execution.ts @@ -246,7 +246,7 @@ async function executeFromQueue(channel: string) { ...config.chatCompletionParams, messages: OpenAImessages, // FIXME: don't use new instance of FunctionManager - functions: new FunctionManager().getFunctionsForOpenAi(), + functions: new FunctionManager().getFunctions(), }); logUsedTokens(answer, message, ++functionRanCounter); diff --git a/src/funcitonManager.ts b/src/funcitonManager.ts index 11b1bac..41e35c1 100644 --- a/src/funcitonManager.ts +++ b/src/funcitonManager.ts @@ -62,11 +62,6 @@ export default class FunctionManager { return rvalue; } - public getFunctionsForOpenAi(): ChatCompletionFunctions[] | undefined { - const rvalue = this.getFunctions(); - return rvalue.length > 0 ? rvalue : undefined; - } - public handleFunction(request: ChatCompletionFunctionCall): ChatCompletionMessageParam { // eslint-disable-next-line @typescript-eslint/no-explicit-any let parsedArguments: any; diff --git a/src/index.ts b/src/index.ts index e0506ab..27e5c45 100644 --- a/src/index.ts +++ b/src/index.ts @@ -63,17 +63,4 @@ discord.on("messageCreate", message => { return queueRequest(message); }); -if (require.main === module) { - void discord.login(config.tokens.Discord); - process.on("SIGINT", () => { - console.log("got SIGINT, exiting"); - //FIXME: finish executing requests then exit - discord.destroy() - .then(() => process.exit()) - .catch((e) => { - console.error("Failed to gracefully exit"); - console.error(e); - process.exit(); - }); - }); -} +if (require.main === module) void discord.login(config.tokens.Discord);