Configuration: recactor how it is written and handled

This commit is contained in:
Wroclaw 2023-09-18 11:06:15 +02:00
parent 13e993b964
commit 7ff4abc3c0
10 changed files with 130 additions and 61 deletions

View file

@ -2,7 +2,7 @@ import { ChatCompletionRequestMessage as OpenAIMessage } from "openai";
import { Collection, Message as DiscordMessage, InteractionResponse } from "discord.js";
import FoldToAscii from "fold-to-ascii";
import config from "./config";
import { config } from "./index";
import countTokens from "./tokenCounter";
import { RequestMessage } from "./execution";
@ -115,7 +115,7 @@ export default function toOpenAIMessages(
});
}
rvalue.push(...config.systemPrompt().reverse());
rvalue.push(...config.systemPrompt([...messages][0]).reverse());
return rvalue.reverse();
}