mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-26 00:53:54 +08:00
update: 优化系统prompt
This commit is contained in:
@@ -335,10 +335,8 @@ class ConnectionHandler:
|
|||||||
|
|
||||||
def change_system_prompt(self, prompt):
|
def change_system_prompt(self, prompt):
|
||||||
self.prompt = prompt
|
self.prompt = prompt
|
||||||
# 找到原来的role==system,替换原来的系统提示
|
# 更新系统prompt至上下文
|
||||||
for m in self.dialogue.dialogue:
|
self.dialogue.update_system_message(self.prompt)
|
||||||
if m.role == "system":
|
|
||||||
m.content = prompt
|
|
||||||
|
|
||||||
def chat(self, query):
|
def chat(self, query):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user