AutoGen自动忽略重复的输入
This commit is contained in:
parent
f7f6db831b
commit
a55bc0c07c
@ -55,12 +55,14 @@ class PluginMultiprocessManager:
|
|||||||
|
|
||||||
def send_command(self, cmd):
|
def send_command(self, cmd):
|
||||||
# ⭐ run in main process
|
# ⭐ run in main process
|
||||||
|
repeated = False
|
||||||
if cmd == self.last_user_input:
|
if cmd == self.last_user_input:
|
||||||
print('repeated input detected, ignore')
|
repeated = True
|
||||||
cmd = ""
|
cmd = ""
|
||||||
else:
|
else:
|
||||||
self.last_user_input = cmd
|
self.last_user_input = cmd
|
||||||
self.parent_conn.send(PipeCom("user_input", cmd))
|
self.parent_conn.send(PipeCom("user_input", cmd))
|
||||||
|
return repeated, cmd
|
||||||
|
|
||||||
def immediate_showoff_when_possible(self, fp):
|
def immediate_showoff_when_possible(self, fp):
|
||||||
# ⭐ 主进程
|
# ⭐ 主进程
|
||||||
@ -111,7 +113,7 @@ class PluginMultiprocessManager:
|
|||||||
if create_or_resume == 'create':
|
if create_or_resume == 'create':
|
||||||
self.cnt = 1
|
self.cnt = 1
|
||||||
self.parent_conn = self.launch_subprocess_with_pipe() # ⭐⭐⭐
|
self.parent_conn = self.launch_subprocess_with_pipe() # ⭐⭐⭐
|
||||||
self.send_command(txt)
|
repeated, cmd_to_autogen = self.send_command(txt)
|
||||||
if txt == 'exit':
|
if txt == 'exit':
|
||||||
self.chatbot.append([f"结束", "结束信号已明确,终止AutoGen程序。"])
|
self.chatbot.append([f"结束", "结束信号已明确,终止AutoGen程序。"])
|
||||||
yield from update_ui(chatbot=self.chatbot, history=self.history)
|
yield from update_ui(chatbot=self.chatbot, history=self.history)
|
||||||
@ -143,7 +145,9 @@ class PluginMultiprocessManager:
|
|||||||
break
|
break
|
||||||
if msg.cmd == "show":
|
if msg.cmd == "show":
|
||||||
yield from self.overwatch_workdir_file_change()
|
yield from self.overwatch_workdir_file_change()
|
||||||
self.chatbot.append([f"运行阶段-{self.cnt}", msg.content])
|
notice = ""
|
||||||
|
if repeated: notice = "(自动忽略重复的输入)"
|
||||||
|
self.chatbot.append([f"运行阶段-{self.cnt}(上次用户反馈输入为: 「{cmd_to_autogen}」{notice}", msg.content])
|
||||||
self.cnt += 1
|
self.cnt += 1
|
||||||
yield from update_ui(chatbot=self.chatbot, history=self.history)
|
yield from update_ui(chatbot=self.chatbot, history=self.history)
|
||||||
if msg.cmd == "interact":
|
if msg.cmd == "interact":
|
||||||
|
@ -3,11 +3,6 @@
|
|||||||
测试:
|
测试:
|
||||||
- show me the solution of $x^2=cos(x)$, solve this problem with figure, and plot and save image to t.jpg
|
- show me the solution of $x^2=cos(x)$, solve this problem with figure, and plot and save image to t.jpg
|
||||||
|
|
||||||
Testing:
|
|
||||||
- Crop the image, keeping the bottom half.
|
|
||||||
- Swap the blue channel and red channel of the image.
|
|
||||||
- Convert the image to grayscale.
|
|
||||||
- Convert the CSV file to an Excel spreadsheet.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user