Skip to content

Commit

Permalink
补充遗漏的 闲时任务、图像识别的遗忘配置;修复自定义命令默认配置API过期问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Mar 22, 2024
1 parent e072220 commit 115cc50
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
6 changes: 3 additions & 3 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@
"来个笑话"
],
"similarity": 1.0,
"api_url": "https://api.vvhan.com/api/joke",
"api_url": "https://api.vvhan.com/api/text/joke",
"api_type": "GET",
"resp_data_type": "content",
"data_analysis": "resp",
Expand All @@ -1198,7 +1198,7 @@
"情话"
],
"similarity": 1.0,
"api_url": "https://api.vvhan.com/api/love",
"api_url": "https://api.vvhan.com/api/text/love",
"api_type": "GET",
"resp_data_type": "content",
"data_analysis": "resp",
Expand All @@ -1211,7 +1211,7 @@
"骚话"
],
"similarity": 1.0,
"api_url": "https://api.vvhan.com/api/sao",
"api_url": "https://api.vvhan.com/api/text/sexy",
"api_type": "GET",
"resp_data_type": "content",
"data_analysis": "resp",
Expand Down
6 changes: 3 additions & 3 deletions config.json.bak
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@
"来个笑话"
],
"similarity": 1.0,
"api_url": "https://api.vvhan.com/api/joke",
"api_url": "https://api.vvhan.com/api/text/joke",
"api_type": "GET",
"resp_data_type": "content",
"data_analysis": "resp",
Expand All @@ -1198,7 +1198,7 @@
"情话"
],
"similarity": 1.0,
"api_url": "https://api.vvhan.com/api/love",
"api_url": "https://api.vvhan.com/api/text/love",
"api_type": "GET",
"resp_data_type": "content",
"data_analysis": "resp",
Expand All @@ -1211,7 +1211,7 @@
"骚话"
],
"similarity": 1.0,
"api_url": "https://api.vvhan.com/api/sao",
"api_url": "https://api.vvhan.com/api/text/sexy",
"api_type": "GET",
"resp_data_type": "content",
"data_analysis": "resp",
Expand Down
13 changes: 13 additions & 0 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,11 @@ def common_textarea_handle(content):
config_data["filter"]["talk_forget_reserve_num"] = int(input_filter_talk_forget_reserve_num.value)
config_data["filter"]["schedule_forget_duration"] = round(float(input_filter_schedule_forget_duration.value), 2)
config_data["filter"]["schedule_forget_reserve_num"] = int(input_filter_schedule_forget_reserve_num.value)
config_data["filter"]["idle_time_task_forget_duration"] = round(float(input_filter_idle_time_task_forget_duration.value), 2)
config_data["filter"]["idle_time_task_forget_reserve_num"] = int(input_filter_idle_time_task_forget_reserve_num.value)
config_data["filter"]["image_recognition_schedule_forget_duration"] = round(float(input_filter_image_recognition_schedule_forget_duration.value), 2)
config_data["filter"]["image_recognition_schedule_forget_reserve_num"] = int(input_filter_image_recognition_schedule_forget_reserve_num.value)


# 答谢
if config.get("webui", "show_card", "common_config", "thanks"):
Expand Down Expand Up @@ -2282,6 +2287,14 @@ def common_textarea_handle(content):
input_filter_talk_forget_reserve_num = ui.input(label='聊天保留数', placeholder='保留最新收到的数据的数量', value=config.get("filter", "talk_forget_reserve_num")).style("width:200px;")
input_filter_schedule_forget_duration = ui.input(label='定时遗忘间隔', placeholder='指的是每隔这个间隔时间(秒),就会丢弃这个间隔时间中接收到的数据,\n保留数据在以下配置中可以自定义', value=config.get("filter", "schedule_forget_duration")).style("width:200px;")
input_filter_schedule_forget_reserve_num = ui.input(label='定时保留数', placeholder='保留最新收到的数据的数量', value=config.get("filter", "schedule_forget_reserve_num")).style("width:200px;")
with ui.grid(columns=4):
input_filter_idle_time_task_forget_duration = ui.input(label='闲时任务遗忘间隔', placeholder='指的是每隔这个间隔时间(秒),就会丢弃这个间隔时间中接收到的数据,\n保留数据在以下配置中可以自定义', value=config.get("filter", "idle_time_task_forget_duration")).style("width:200px;")
input_filter_idle_time_task_forget_reserve_num = ui.input(label='闲时任务保留数', placeholder='保留最新收到的数据的数量', value=config.get("filter", "idle_time_task_forget_reserve_num")).style("width:200px;")
input_filter_image_recognition_schedule_forget_duration = ui.input(label='图像识别遗忘间隔', placeholder='指的是每隔这个间隔时间(秒),就会丢弃这个间隔时间中接收到的数据,\n保留数据在以下配置中可以自定义', value=config.get("filter", "image_recognition_schedule_forget_duration")).style("width:200px;")
input_filter_image_recognition_schedule_forget_reserve_num = ui.input(label='图像识别保留数', placeholder='保留最新收到的数据的数量', value=config.get("filter", "image_recognition_schedule_forget_reserve_num")).style("width:200px;")



if config.get("webui", "show_card", "common_config", "thanks"):
with ui.card().style(card_css):
ui.label('答谢')
Expand Down

0 comments on commit 115cc50

Please sign in to comment.