mirror of
https://github.com/idootop/mi-gpt.git
synced 2024-09-20 14:56:14 +00:00
fix: update to new ConversationManager
This commit is contained in:
parent
aae3202c98
commit
18c246ac6c
|
@ -48,16 +48,13 @@ export class MyBot {
|
||||||
}
|
}
|
||||||
|
|
||||||
async ask(msg: string) {
|
async ask(msg: string) {
|
||||||
const memory = await this.manager.getMemory();
|
const { bot, master, room, memory } = await this.manager.get();
|
||||||
const room = await this.manager.getRoom();
|
if (!memory) {
|
||||||
const bot = await this.manager.getUser("bot");
|
return;
|
||||||
const master = await this.manager.getUser("master");
|
}
|
||||||
const lastMessages = await this.manager.getMessages({
|
const lastMessages = await this.manager.getMessages({
|
||||||
take: 10,
|
take: 10,
|
||||||
});
|
});
|
||||||
if (!this.manager.isReady) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const result = await openai.chat({
|
const result = await openai.chat({
|
||||||
system: buildPrompt(systemTemplate, {
|
system: buildPrompt(systemTemplate, {
|
||||||
bot_name: bot!.name,
|
bot_name: bot!.name,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user