[feature][chat]Add switch to allow human involvement.#1729

This commit is contained in:
jerryjzhang
2024-10-12 16:39:13 +08:00
parent f26845e29b
commit 612f046c0d
6 changed files with 11 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package com.tencent.supersonic.chat.server.agent;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.tencent.supersonic.chat.server.memory.MemoryReviewTask;
import com.tencent.supersonic.common.pojo.ChatApp; import com.tencent.supersonic.common.pojo.ChatApp;
import com.tencent.supersonic.common.pojo.RecordInfo; import com.tencent.supersonic.common.pojo.RecordInfo;
import lombok.Data; import lombok.Data;
@@ -21,6 +22,7 @@ public class Agent extends RecordInfo {
private Integer status; private Integer status;
private List<String> examples; private List<String> examples;
private Integer enableSearch; private Integer enableSearch;
private Integer enableFeedback;
private String toolConfig; private String toolConfig;
private Map<String, ChatApp> chatAppConfig = Collections.EMPTY_MAP; private Map<String, ChatApp> chatAppConfig = Collections.EMPTY_MAP;
private VisualConfig visualConfig; private VisualConfig visualConfig;
@@ -44,7 +46,7 @@ public class Agent extends RecordInfo {
} }
public boolean enableMemoryReview() { public boolean enableMemoryReview() {
return false; return chatAppConfig.get(MemoryReviewTask.APP_KEY).isEnable();
} }
public static boolean containsAllModel(Set<Long> detectViewIds) { public static boolean containsAllModel(Set<Long> detectViewIds) {

View File

@@ -33,6 +33,8 @@ public class AgentDO {
private Integer enableSearch; private Integer enableSearch;
private Integer enableFeedback;
private String toolConfig; private String toolConfig;
private String chatModelConfig; private String chatModelConfig;

View File

@@ -392,3 +392,6 @@ ALTER TABLE s2_agent RENAME COLUMN model_config TO chat_model_config;
ALTER TABLE s2_agent DROP COLUMN prompt_config; ALTER TABLE s2_agent DROP COLUMN prompt_config;
ALTER TABLE s2_agent DROP COLUMN multi_turn_config; ALTER TABLE s2_agent DROP COLUMN multi_turn_config;
ALTER TABLE s2_agent DROP COLUMN enable_memory_review; ALTER TABLE s2_agent DROP COLUMN enable_memory_review;
--20241012
alter table s2_agent add column `enable_feedback` tinyint DEFAULT 1;

View File

@@ -397,6 +397,7 @@ CREATE TABLE IF NOT EXISTS s2_agent
updated_by varchar(100) null, updated_by varchar(100) null,
updated_at TIMESTAMP null, updated_at TIMESTAMP null,
enable_search int null, enable_search int null,
enable_feedback int null,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
); COMMENT ON TABLE s2_agent IS 'agent information table'; ); COMMENT ON TABLE s2_agent IS 'agent information table';

View File

@@ -75,6 +75,7 @@ CREATE TABLE IF NOT EXISTS `s2_agent` (
`chat_model_config` text COLLATE utf8_unicode_ci DEFAULT NULL, `chat_model_config` text COLLATE utf8_unicode_ci DEFAULT NULL,
`visual_config` varchar(2000) COLLATE utf8_unicode_ci DEFAULT NULL, `visual_config` varchar(2000) COLLATE utf8_unicode_ci DEFAULT NULL,
`enable_search` tinyint DEFAULT 1, `enable_search` tinyint DEFAULT 1,
`enable_feedback` tinyint DEFAULT 1,
`created_by` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `created_by` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` datetime DEFAULT NULL, `created_at` datetime DEFAULT NULL,
`updated_by` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `updated_by` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,

View File

@@ -397,6 +397,7 @@ CREATE TABLE IF NOT EXISTS s2_agent
updated_by varchar(100) null, updated_by varchar(100) null,
updated_at TIMESTAMP null, updated_at TIMESTAMP null,
enable_search int null, enable_search int null,
enable_feedback int null,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
); COMMENT ON TABLE s2_agent IS 'agent information table'; ); COMMENT ON TABLE s2_agent IS 'agent information table';