From 6d453537c8acf92ea5d9decbf6744df07f00efb1 Mon Sep 17 00:00:00 2001
From: liudong <liudong>
Date: 星期六, 03 八月 2024 22:29:25 +0800
Subject: [PATCH] 智能体管理的页面开发和功能开发

---
 src/views/dmx/IntelligentAgent/components/addAgent.vue |   82 +++++++++++++++++++++++++++++------------
 1 files changed, 58 insertions(+), 24 deletions(-)

diff --git a/src/views/dmx/IntelligentAgent/components/addAgent.vue b/src/views/dmx/IntelligentAgent/components/addAgent.vue
index 178d923..cbfb80d 100644
--- a/src/views/dmx/IntelligentAgent/components/addAgent.vue
+++ b/src/views/dmx/IntelligentAgent/components/addAgent.vue
@@ -16,11 +16,14 @@
       <a-form-item field="name" label="鏅鸿兘浣撳悕绉�">
         <a-input v-model="form.name" placeholder="璇疯緭鍏ュ悕绉�"/>
       </a-form-item>
-
+      <a-form-item  label="浣犲笇鏈涙櫤鑳戒綋鐨勮鑹叉槸浠�涔堬紝鍏蜂綋瀹屾垚浠�涔堜换鍔★紵">
+        <a-textarea v-model="form.prompt_config.system" placeholder="" style="height: 180px"/>
+      </a-form-item>
       <a-form-item>
         <div style="width: 100%;text-align: right">
           <a-button @click="visible = false">鍙栨秷</a-button>
           <a-button style="margin-left: 10px" type="primary" html-type="submit">纭畾</a-button>
+          <editAgent ref="editAgentKuai" typeAngint="add" :formData="form" @cancelModal="handleCancel"></editAgent>
         </div>
       </a-form-item>
     </a-form>
@@ -29,28 +32,47 @@
 
 <script lang="ts" setup>
 import { onMounted ,onBeforeMount, reactive, ref } from "vue";
+import editAgent from "@/views/dmx/IntelligentAgent/components/editAgent.vue";
 
 const visible = ref(false);
 const loading = ref(false);
+const editAgentKuai = ref();
 const form = reactive({
-  size: "medium",
   name: "",
-  age: undefined,
-  section: "0",
-  province: "haidian",
-  options: [],
-  date: "",
-  time: "",
-  radio: "radio one",
-  slider: 5,
-  score: 5,
-  switch: false,
-  multiSelect: ["section one"],
-  treeSelect: "",
-  raptor: false,
-  prompt: '璇锋�荤粨浠ヤ笅娈佃惤銆� 灏忓績鏁板瓧锛屼笉瑕佺紪閫犮�� 娈佃惤濡備笅锛歕n' +
-    '      {cluster_content}\n' +
-    '浠ヤ笂灏辨槸浣犻渶瑕佹�荤粨鐨勫唴瀹广��',
+  icon: "",
+  language: "English",
+  prompt_config: {
+    empty_response: "",
+    prologue: "浣犲ソ锛� 鎴戞槸浣犵殑鍔╃悊锛屾湁浠�涔堝彲浠ュ府鍒颁綘鐨勫悧锛�",
+    quote: true,
+    self_rag: true,
+    system: "绀轰緥锛歕n" +
+      "浣犳槸 XX锛屽叿鏈� XX 缁忛獙锛屾搮闀� XX锛屸�n" +
+      "浣犵殑浠诲姟鏄� XX 锛岄渶瑕佹寜鐓т互涓嬫楠ゆ墽琛岋細\n" +
+      "1. XX\n" +
+      "2. XX\n" +
+      "3. 鈥n",
+    parameters: [
+      {
+        "key": "knowledge",
+        "optional": false
+      }
+    ]
+  },
+  kb_ids: [
+    "985eda244efc11ef9a7a0242ac120006"
+  ],
+  llm_id: "qwen-plus",
+  llm_setting: {
+    temperature: 0.1,
+    top_p: 0.3,
+    presence_penalty: 0.4,
+    frequency_penalty: 0.7,
+    max_tokens: 512
+  },
+  similarity_threshold: 0.2,
+  vector_similarity_weight: 0.30000000000000004,
+  top_n: 8
 });
 const formRef = ref(null);
 
@@ -67,6 +89,9 @@
 
 const handleSubmit = ({values, errors}) => {
   console.log('values:', values, '\nerrors:', errors)
+  if(!errors){
+    editAgentKuai.value.handleClick(form)
+  }
 }
 
 const handleClick = () => {
@@ -78,16 +103,25 @@
 
 const handleCancel = () => {
   visible.value = false;
+  formRef.value.resetFields();
+  form.name = ''
 }
 
 const handleOpened =(el) => {
-  Object.assign(form,{
-    name: '',// 鐢ㄦ埛鍚�
-    nameJoin: '',// 鏄电О
-    post: '',// 宀椾綅
-    txt: '',// 澶囨敞
-  });
+  // Object.assign(form,{
+  //   name: '',// 鐢ㄦ埛鍚�
+  //   nameJoin: '',// 鏄电О
+  //   post: '',// 宀椾綅
+  //   txt: '',// 澶囨敞
+  // });
   formRef.value.resetFields();
+  form.name = ''
+  form.prompt_config.system = "绀轰緥锛歕n" +
+    "浣犳槸 XX锛屽叿鏈� XX 缁忛獙锛屾搮闀� XX锛屸�n" +
+    "浣犵殑浠诲姟鏄� XX 锛岄渶瑕佹寜鐓т互涓嬫楠ゆ墽琛岋細\n" +
+    "1. XX\n" +
+    "2. XX\n" +
+    "3. 鈥n"
 }
 
 const file = ref();

--
Gitblit v1.8.0