mirror of
https://github.com/coaidev/coai.git
synced 2025-05-21 05:50:14 +09:00
fix conversation context error
thanks @sipc
This commit is contained in:
parent
af91621800
commit
066a237770
@ -1,6 +1,6 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
export const version = "3.3.0";
|
export const version = "3.3.1";
|
||||||
export const deploy: boolean = true;
|
export const deploy: boolean = true;
|
||||||
export let rest_api: string = "http://localhost:8094";
|
export let rest_api: string = "http://localhost:8094";
|
||||||
export let ws_api: string = "ws://localhost:8094";
|
export let ws_api: string = "ws://localhost:8094";
|
||||||
|
@ -129,4 +129,18 @@ export class Conversation {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public sendMessageWithRaise(t: any, id: number, props: ChatProps): boolean {
|
||||||
|
if (!this.end) return false;
|
||||||
|
|
||||||
|
this.addMessage({
|
||||||
|
content: props.message,
|
||||||
|
role: "user",
|
||||||
|
});
|
||||||
|
|
||||||
|
this.send(t, props);
|
||||||
|
this.setId(id);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ export class Manager {
|
|||||||
delete this.conversations[-1]; // fix pointer
|
delete this.conversations[-1]; // fix pointer
|
||||||
this.conversations[-1] = this.createConversation(-1);
|
this.conversations[-1] = this.createConversation(-1);
|
||||||
this.current = target;
|
this.current = target;
|
||||||
return this.get(target)!.sendMessage(t, props);
|
return this.get(target)!.sendMessageWithRaise(t, target, props);
|
||||||
}
|
}
|
||||||
const conversation = this.get(id);
|
const conversation = this.get(id);
|
||||||
if (!conversation) return false;
|
if (!conversation) return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user