liudong
2024-08-21 4123b18e86c05753e52c68a48c8a4067c2a6d625
智能体详情信息
2个文件已修改
92 ■■■■■ 已修改文件
src/views/dmx/IntelligentAgent/components/agentConfig.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dmx/IntelligentAgent/index.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dmx/IntelligentAgent/components/agentConfig.vue
@@ -1,25 +1,4 @@
<template>
  <a-button
    v-if="typeAngint == 'add'"
    type="primary"
    @click="handleClick"
    style="margin-left: 10px"
  >
    <template #icon>
      <icon-plus />
    </template>
    新建智能体
  </a-button>
  <a-button
    v-if="typeAngint == 'edit'"
    type="text"
    size="small"
    @click="editClick"
  >
    <template #icon>
      <icon-tool />
    </template>
  </a-button>
  <a-modal
    v-model:visible="visible"
    title="智能体配置"
@@ -514,9 +493,6 @@
  const handleClick = () => {
    visible.value = true;
  };
  defineExpose({
    handleClick,
  });
  const handleCancel = () => {
    visible.value = false;
@@ -546,7 +522,7 @@
          '你是一个智能助手,请总结知识库的内容来回答问题,请列举知识库中的数据详细回答。当所有知识库内容都与问题无关时,你的回答必须包括“知识库中未找到您要的答案!”这句话。' +
          '回答需要考虑聊天历史。\n        以下是知识库:\n        {knowledge}\n        以上是知识库。';
      }
      console.log(form, '新建智能体弹窗');
      // console.log(form, '新建智能体弹窗');
      avatarShow.value = false;
      setTimeout(() => {
        avatarShow.value = true;
@@ -629,6 +605,7 @@
    });
  };
  const addVariable = () => {
    form.prompt_config.parameters.push({
      index: form.prompt_config.parameters.length,
@@ -699,6 +676,12 @@
  onMounted(() => {});
  onBeforeUnmount(() => {});
  defineExpose({
    handleClick,
    editClick
  });
</script>
<style lang="less" scoped>
  :deep(.arco-tabs-nav-tab-list) {
src/views/dmx/IntelligentAgent/index.vue
@@ -10,7 +10,16 @@
              style="width: 240px"
              @change="queryList"
            />
            <agent-config typeAngint="add"></agent-config>
            <a-button
              type="primary"
              @click="handleClick"
              style="margin-left: 10px"
            >
              <template #icon>
                <icon-plus />
              </template>
              新建智能体
            </a-button>
          </div>
          <a-divider style="margin: 10px 0" />
          <a-row justify="space-between">
@@ -72,12 +81,15 @@
                      >
                        <a-space>
                          <span v-show="!item.off">
                            <agent-config
                              ref="editAgentKuai"
                              typeAngint="edit"
                              :formData="item"
                              @queryList="queryList"
                            ></agent-config>
                              <a-button
                                type="text"
                                size="small"
                                @click="editClick(item)"
                              >
                              <template #icon>
                                <icon-tool />
                              </template>
                            </a-button>
                          </span>
                          <a-popconfirm
                            :content="'确定删除吗'"
@@ -195,6 +207,12 @@
        </a-card>
      </a-col>
    </a-row>
    <agent-config
      ref="editAgentKuai"
      :typeAngint="addType"
      :formData="itemObj"
      @queryList="queryList"
    ></agent-config>
  </div>
</template>
@@ -208,7 +226,7 @@
    onBeforeUnmount,
  } from 'vue';
  import { Message } from '@arco-design/web-vue';
  import { deletedialog, queryCanvasList, querydialogList } from "@/api/Agent";
  import { deletedialog, queryCanvasList, querydialogdetail, querydialogList } from "@/api/Agent";
  import useLoading from '@/hooks/loading';
  const { loading, setLoading } = useLoading(true);
  import EventBus from '@/utils/EventBus';
@@ -220,7 +238,7 @@
  let count = 5;
  const activeKey = ref(1);
  const addAgents = ref();
  const editAgentKuai = ref();
  const editAgentKuai = ref(null);
  const imgSrc = ref(logo);
  const agentList = ref([]);
  const agentNewList = ref([]);
@@ -233,10 +251,25 @@
  const visible = ref(false);
  const formRef = ref(null);
  const form = reactive({
    // size: 'medium',
    // name: '',
  });
  let addType = ref('add');
  let itemObj = reactive({});
  const form = reactive({});
  const handleClick = () => {
    addType.value = 'add';
    editAgentKuai.value.handleClick();
  };
  const editClick = async(data) => {
    let res = await querydialogdetail({
      dialog_id: data.id
    })
    Object.assign(itemObj, res.data);
    addType.value = 'edit';
    editAgentKuai.value.editClick();
  };
  const queryList = async (params = {}) => {
    setLoading(true);