mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
Merge branch 'main' of https://github.com/maxkb-dev/maxkb
This commit is contained in:
commit
bb2b056cff
|
|
@ -0,0 +1,13 @@
|
|||
name: Typos Check
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
name: Spell Check with Typos
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Actions Repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Check spelling
|
||||
uses: crate-ci/typos@master
|
||||
|
|
@ -42,7 +42,7 @@ share/python-wheels/
|
|||
MANIFEST
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script froms a template
|
||||
# Usually these files are written by a python script forms a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ docker run -d --name=maxkb -p 8080:8080 -v ~/.maxkb:/var/lib/postgresql/data 1pa
|
|||
|
||||
- 前端:[Vue.js](https://cn.vuejs.org/)
|
||||
- 后端:[Python / Django](https://www.djangoproject.com/)
|
||||
- Langchain:[Langchain](https://www.langchain.com/)
|
||||
- LangChain:[LangChain](https://www.langchain.com/)
|
||||
- 向量数据库:[PostgreSQL / pgvector](https://www.postgresql.org/)
|
||||
- 大模型:Azure OpenAI、百度千帆大模型、[Ollama](https://github.com/ollama/ollama)
|
||||
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ class ApplicationSerializer(serializers.Serializer):
|
|||
application_model = ApplicationSerializer.Create.to_application_model(user_id, application)
|
||||
dataset_id_list = application.get('dataset_id_list', [])
|
||||
application_dataset_mapping_model_list = [
|
||||
ApplicationSerializer.Create.to_application_dateset_mapping(application_model.id, dataset_id) for
|
||||
ApplicationSerializer.Create.to_application_dataset_mapping(application_model.id, dataset_id) for
|
||||
dataset_id in dataset_id_list]
|
||||
# 插入应用
|
||||
application_model.save()
|
||||
|
|
@ -280,7 +280,7 @@ class ApplicationSerializer(serializers.Serializer):
|
|||
)
|
||||
|
||||
@staticmethod
|
||||
def to_application_dateset_mapping(application_id: str, dataset_id: str):
|
||||
def to_application_dataset_mapping(application_id: str, dataset_id: str):
|
||||
return ApplicationDatasetMapping(id=uuid.uuid1(), application_id=application_id, dataset_id=dataset_id)
|
||||
|
||||
class HitTest(serializers.Serializer):
|
||||
|
|
|
|||
|
|
@ -178,12 +178,12 @@ class ChatMessageSerializer(serializers.Serializer):
|
|||
client_id = self.data.get('client_id')
|
||||
client_type = self.data.get('client_type')
|
||||
chat_info = self.is_valid(raise_exception=True)
|
||||
pipline_manage_builder = PipelineManage.builder()
|
||||
pipeline_manage_builder = PipelineManage.builder()
|
||||
# 如果开启了问题优化,则添加上问题优化步骤
|
||||
if chat_info.application.problem_optimization:
|
||||
pipline_manage_builder.append_step(BaseResetProblemStep)
|
||||
pipeline_manage_builder.append_step(BaseResetProblemStep)
|
||||
# 构建流水线管理器
|
||||
pipline_message = (pipline_manage_builder.append_step(BaseSearchDatasetStep)
|
||||
pipeline_message = (pipeline_manage_builder.append_step(BaseSearchDatasetStep)
|
||||
.append_step(BaseGenerateHumanMessageStep)
|
||||
.append_step(BaseChatStep)
|
||||
.build())
|
||||
|
|
@ -198,8 +198,8 @@ class ChatMessageSerializer(serializers.Serializer):
|
|||
params = chat_info.to_pipeline_manage_params(message, get_post_handler(chat_info), exclude_paragraph_id_list,
|
||||
client_id, client_type, stream)
|
||||
# 运行流水线作业
|
||||
pipline_message.run(params)
|
||||
return pipline_message.context['chat_result']
|
||||
pipeline_message.run(params)
|
||||
return pipeline_message.context['chat_result']
|
||||
|
||||
@staticmethod
|
||||
def re_open_chat(chat_id: str):
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ class ListenerManagement:
|
|||
|
||||
@staticmethod
|
||||
@poxy
|
||||
def init_embedding_model(ags):
|
||||
def init_embedding_model(ages):
|
||||
EmbeddingModel.get_embedding_model()
|
||||
|
||||
def run(self):
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"""
|
||||
from typing import Dict
|
||||
|
||||
from common.froms.base_field import BaseExecField, TriggerType
|
||||
from common.forms.base_field import BaseExecField, TriggerType
|
||||
|
||||
|
||||
class ArrayCard(BaseExecField):
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
@date:2023/11/1 16:04
|
||||
@desc:
|
||||
"""
|
||||
from common.froms import BaseField
|
||||
from common.forms import BaseField
|
||||
|
||||
|
||||
class BaseForm:
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"""
|
||||
from typing import List, Dict
|
||||
|
||||
from common.froms.base_field import BaseExecField, TriggerType
|
||||
from common.forms.base_field import BaseExecField, TriggerType
|
||||
|
||||
|
||||
class MultiSelect(BaseExecField):
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"""
|
||||
from typing import Dict
|
||||
|
||||
from common.froms.base_field import BaseExecField, TriggerType
|
||||
from common.forms.base_field import BaseExecField, TriggerType
|
||||
|
||||
|
||||
class ObjectCard(BaseExecField):
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"""
|
||||
from typing import Dict
|
||||
|
||||
from common.froms import BaseField, TriggerType
|
||||
from common.forms import BaseField, TriggerType
|
||||
|
||||
|
||||
class PasswordInputField(BaseField):
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"""
|
||||
from typing import List, Dict
|
||||
|
||||
from common.froms.base_field import BaseExecField, TriggerType
|
||||
from common.forms.base_field import BaseExecField, TriggerType
|
||||
|
||||
|
||||
class Radio(BaseExecField):
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"""
|
||||
from typing import List, Dict
|
||||
|
||||
from common.froms.base_field import BaseExecField, TriggerType
|
||||
from common.forms.base_field import BaseExecField, TriggerType
|
||||
|
||||
|
||||
class Radio(BaseExecField):
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"""
|
||||
from typing import List, Dict
|
||||
|
||||
from common.froms.base_field import BaseExecField, TriggerType
|
||||
from common.forms.base_field import BaseExecField, TriggerType
|
||||
|
||||
|
||||
class Radio(BaseExecField):
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"""
|
||||
from typing import List, Dict
|
||||
|
||||
from common.froms.base_field import TriggerType, BaseExecField
|
||||
from common.forms.base_field import TriggerType, BaseExecField
|
||||
|
||||
|
||||
class SingleSelect(BaseExecField):
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"""
|
||||
from typing import Dict
|
||||
|
||||
from common.froms.base_field import BaseExecField, TriggerType
|
||||
from common.forms.base_field import BaseExecField, TriggerType
|
||||
|
||||
|
||||
class TabCard(BaseExecField):
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"""
|
||||
from typing import Dict
|
||||
|
||||
from common.froms.base_field import TriggerType, BaseExecField
|
||||
from common.forms.base_field import TriggerType, BaseExecField
|
||||
|
||||
|
||||
class TableRadio(BaseExecField):
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"""
|
||||
from typing import Dict
|
||||
|
||||
from common.froms.base_field import TriggerType, BaseExecField
|
||||
from common.forms.base_field import TriggerType, BaseExecField
|
||||
|
||||
|
||||
class TableRadio(BaseExecField):
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"""
|
||||
from typing import Dict
|
||||
|
||||
from common.froms.base_field import BaseField, TriggerType
|
||||
from common.forms.base_field import BaseField, TriggerType
|
||||
|
||||
|
||||
class TextInputField(BaseField):
|
||||
|
|
@ -9,8 +9,6 @@
|
|||
|
||||
|
||||
def get_file_content(path):
|
||||
file = open(path, "r",
|
||||
encoding='utf-8')
|
||||
content = file.read()
|
||||
file.close()
|
||||
with open(path, "r", encoding='utf-8') as file:
|
||||
content = file.read()
|
||||
return content
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ from typing import Dict
|
|||
from langchain.schema import HumanMessage
|
||||
from langchain_community.chat_models.azure_openai import AzureChatOpenAI
|
||||
|
||||
from common import froms
|
||||
from common import forms
|
||||
from common.exception.app_exception import AppApiException
|
||||
from common.froms import BaseForm
|
||||
from common.forms import BaseForm
|
||||
from common.util.file_util import get_file_content
|
||||
from setting.models_provider.base_model_provider import IModelProvider, ModelProvideInfo, BaseModelCredential, \
|
||||
ModelInfo, \
|
||||
|
|
@ -51,11 +51,11 @@ class AzureLLMModelCredential(BaseForm, BaseModelCredential):
|
|||
def encryption_dict(self, model: Dict[str, object]):
|
||||
return {**model, 'api_key': super().encryption(model.get('api_key', ''))}
|
||||
|
||||
api_base = froms.TextInputField('API 域名', required=True)
|
||||
api_base = forms.TextInputField('API 域名', required=True)
|
||||
|
||||
api_key = froms.PasswordInputField("API Key", required=True)
|
||||
api_key = forms.PasswordInputField("API Key", required=True)
|
||||
|
||||
deployment_name = froms.TextInputField("部署名", required=True)
|
||||
deployment_name = forms.TextInputField("部署名", required=True)
|
||||
|
||||
|
||||
class DefaultAzureLLMModelCredential(BaseForm, BaseModelCredential):
|
||||
|
|
@ -87,13 +87,13 @@ class DefaultAzureLLMModelCredential(BaseForm, BaseModelCredential):
|
|||
def encryption_dict(self, model: Dict[str, object]):
|
||||
return {**model, 'api_key': super().encryption(model.get('api_key', ''))}
|
||||
|
||||
api_version = froms.TextInputField("api_version", required=True)
|
||||
api_version = forms.TextInputField("api_version", required=True)
|
||||
|
||||
api_base = froms.TextInputField('API 域名', required=True)
|
||||
api_base = forms.TextInputField('API 域名', required=True)
|
||||
|
||||
api_key = froms.PasswordInputField("API Key", required=True)
|
||||
api_key = forms.PasswordInputField("API Key", required=True)
|
||||
|
||||
deployment_name = froms.TextInputField("部署名", required=True)
|
||||
deployment_name = forms.TextInputField("部署名", required=True)
|
||||
|
||||
|
||||
azure_llm_model_credential = AzureLLMModelCredential()
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ from urllib.parse import urlparse, ParseResult
|
|||
import requests
|
||||
from langchain.chat_models.base import BaseChatModel
|
||||
|
||||
from common import froms
|
||||
from common import forms
|
||||
from common.exception.app_exception import AppApiException
|
||||
from common.froms import BaseForm
|
||||
from common.forms import BaseForm
|
||||
from common.util.file_util import get_file_content
|
||||
from setting.models_provider.base_model_provider import IModelProvider, ModelProvideInfo, ModelInfo, ModelTypeConst, \
|
||||
BaseModelCredential, DownModelChunk, DownModelChunkStatus, ValidCode
|
||||
|
|
@ -51,8 +51,8 @@ class OllamaLLMModelCredential(BaseForm, BaseModelCredential):
|
|||
self.api_key = model_info.get('api_key')
|
||||
return self
|
||||
|
||||
api_base = froms.TextInputField('API 域名', required=True)
|
||||
api_key = froms.PasswordInputField('API Key', required=True)
|
||||
api_base = forms.TextInputField('API 域名', required=True)
|
||||
api_key = forms.PasswordInputField('API Key', required=True)
|
||||
|
||||
|
||||
ollama_llm_model_credential = OllamaLLMModelCredential()
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ from typing import Dict
|
|||
from langchain.schema import HumanMessage
|
||||
from langchain_openai import ChatOpenAI
|
||||
|
||||
from common import froms
|
||||
from common import forms
|
||||
from common.exception.app_exception import AppApiException
|
||||
from common.froms import BaseForm
|
||||
from common.forms import BaseForm
|
||||
from common.util.file_util import get_file_content
|
||||
from setting.models_provider.base_model_provider import IModelProvider, ModelProvideInfo, BaseModelCredential, \
|
||||
ModelInfo, \
|
||||
|
|
@ -50,8 +50,8 @@ class OpenAILLMModelCredential(BaseForm, BaseModelCredential):
|
|||
def encryption_dict(self, model: Dict[str, object]):
|
||||
return {**model, 'api_key': super().encryption(model.get('api_key', ''))}
|
||||
|
||||
api_base = froms.TextInputField('API 域名', required=True)
|
||||
api_key = froms.PasswordInputField('API Key', required=True)
|
||||
api_base = forms.TextInputField('API 域名', required=True)
|
||||
api_key = forms.PasswordInputField('API Key', required=True)
|
||||
|
||||
|
||||
openai_llm_model_credential = OpenAILLMModelCredential()
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ from langchain.schema import HumanMessage
|
|||
from langchain_community.chat_models import QianfanChatEndpoint
|
||||
from qianfan import ChatCompletion
|
||||
|
||||
from common import froms
|
||||
from common import forms
|
||||
from common.exception.app_exception import AppApiException
|
||||
from common.froms import BaseForm
|
||||
from common.forms import BaseForm
|
||||
from common.util.file_util import get_file_content
|
||||
from setting.models_provider.base_model_provider import ModelProvideInfo, ModelTypeConst, BaseModelCredential, \
|
||||
ModelInfo, IModelProvider, ValidCode
|
||||
|
|
@ -55,9 +55,9 @@ class WenxinLLMModelCredential(BaseForm, BaseModelCredential):
|
|||
self.secret_key = model_info.get('secret_key')
|
||||
return self
|
||||
|
||||
api_key = froms.PasswordInputField('API Key', required=True)
|
||||
api_key = forms.PasswordInputField('API Key', required=True)
|
||||
|
||||
secret_key = froms.PasswordInputField("Secret Key", required=True)
|
||||
secret_key = forms.PasswordInputField("Secret Key", required=True)
|
||||
|
||||
|
||||
win_xin_llm_model_credential = WenxinLLMModelCredential()
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ class ConfigManager:
|
|||
return True
|
||||
|
||||
def load_from_yml(self):
|
||||
for i in ['config_example.yml', 'config.yaml']:
|
||||
for i in ['config_example.yml', 'config.yaml', 'config.yml']:
|
||||
if not os.path.isfile(os.path.join(self.root_path, i)):
|
||||
continue
|
||||
loaded = self.from_yaml(i)
|
||||
|
|
@ -193,11 +193,12 @@ class ConfigManager:
|
|||
if manager.load_from_yml():
|
||||
config = manager.config
|
||||
else:
|
||||
msg = """
|
||||
msg = f"""
|
||||
|
||||
Error: No config file found.
|
||||
|
||||
You can run `cp config_example.yml config_example.yml`, and edit it.
|
||||
You can run `cp config_example.yml {root_path}/config.yml`, and edit it.
|
||||
|
||||
"""
|
||||
raise ImportError(msg)
|
||||
return config
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ The `urlpatterns` list routes URLs to views. For more information please see:
|
|||
https://docs.djangoproject.com/en/4.2/topics/http/urls/
|
||||
Examples:
|
||||
Function views
|
||||
1. Add an import: froms my_app import views
|
||||
1. Add an import: forms my_app import views
|
||||
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||
Class-based views
|
||||
1. Add an import: froms other_app.views import Home
|
||||
1. Add an import: forms other_app.views import Home
|
||||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||
Including another URLconf
|
||||
1. Import the include() function: froms django.urls import include, path
|
||||
1. Import the include() function: forms django.urls import include, path
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
import os
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Start postgress
|
||||
# Start postgresql
|
||||
docker-entrypoint.sh postgres &
|
||||
sleep 10
|
||||
# Wait postgress
|
||||
# Wait postgresql
|
||||
until pg_isready --host=127.0.0.1; do sleep 1 && echo "waiting for postgres"; done
|
||||
|
||||
# Start MaxKB
|
||||
|
|
|
|||
|
|
@ -7,64 +7,64 @@ const prefix = '/application'
|
|||
|
||||
/**
|
||||
* API_KEY列表
|
||||
* @param 参数 applicaiton_id
|
||||
* @param 参数 application_id
|
||||
*/
|
||||
const getAPIKey: (applicaiton_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
applicaiton_id,
|
||||
const getAPIKey: (application_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
application_id,
|
||||
loading
|
||||
) => {
|
||||
return get(`${prefix}/${applicaiton_id}/api_key`, undefined, loading)
|
||||
return get(`${prefix}/${application_id}/api_key`, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增API_KEY
|
||||
* @param 参数 applicaiton_id
|
||||
* @param 参数 application_id
|
||||
*/
|
||||
const postAPIKey: (applicaiton_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
applicaiton_id,
|
||||
const postAPIKey: (application_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
application_id,
|
||||
loading
|
||||
) => {
|
||||
return post(`${prefix}/${applicaiton_id}/api_key`, {}, undefined, loading)
|
||||
return post(`${prefix}/${application_id}/api_key`, {}, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除API_KEY
|
||||
* @param 参数 applicaiton_id api_key_id
|
||||
* @param 参数 application_id api_key_id
|
||||
*/
|
||||
const delAPIKey: (
|
||||
applicaiton_id: String,
|
||||
application_id: String,
|
||||
api_key_id: String,
|
||||
loading?: Ref<boolean>
|
||||
) => Promise<Result<boolean>> = (applicaiton_id, api_key_id, loading) => {
|
||||
return del(`${prefix}/${applicaiton_id}/api_key/${api_key_id}`, undefined, undefined, loading)
|
||||
) => Promise<Result<boolean>> = (application_id, api_key_id, loading) => {
|
||||
return del(`${prefix}/${application_id}/api_key/${api_key_id}`, undefined, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改API_KEY
|
||||
* @param 参数 applicaiton_id,api_key_id
|
||||
* @param 参数 application_id,api_key_id
|
||||
* data {
|
||||
* is_active: boolean
|
||||
* }
|
||||
*/
|
||||
const putAPIKey: (
|
||||
applicaiton_id: string,
|
||||
application_id: string,
|
||||
api_key_id: String,
|
||||
data: any,
|
||||
loading?: Ref<boolean>
|
||||
) => Promise<Result<any>> = (applicaiton_id, api_key_id, data, loading) => {
|
||||
return put(`${prefix}/${applicaiton_id}/api_key/${api_key_id}`, data, undefined, loading)
|
||||
) => Promise<Result<any>> = (application_id, api_key_id, data, loading) => {
|
||||
return put(`${prefix}/${application_id}/api_key/${api_key_id}`, data, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计
|
||||
* @param 参数 applicaiton_id, data
|
||||
* @param 参数 application_id, data
|
||||
*/
|
||||
const getStatistics: (
|
||||
applicaiton_id: string,
|
||||
application_id: string,
|
||||
data: any,
|
||||
loading?: Ref<boolean>
|
||||
) => Promise<Result<any>> = (applicaiton_id, data, loading) => {
|
||||
return get(`${prefix}/${applicaiton_id}/statistics/chat_record_aggregate_trend`, data, loading)
|
||||
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||
return get(`${prefix}/${application_id}/statistics/chat_record_aggregate_trend`, data, loading)
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -49,70 +49,70 @@ const postApplication: (
|
|||
|
||||
*/
|
||||
const putApplication: (
|
||||
applicaiton_id: String,
|
||||
application_id: String,
|
||||
data: ApplicationFormType,
|
||||
loading?: Ref<boolean>
|
||||
) => Promise<Result<any>> = (applicaiton_id, data, loading) => {
|
||||
return put(`${prefix}/${applicaiton_id}`, data, undefined, loading)
|
||||
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||
return put(`${prefix}/${application_id}`, data, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用
|
||||
* @param 参数 applicaiton_id
|
||||
* @param 参数 application_id
|
||||
*/
|
||||
const delApplication: (
|
||||
applicaiton_id: String,
|
||||
application_id: String,
|
||||
loading?: Ref<boolean>
|
||||
) => Promise<Result<boolean>> = (applicaiton_id, loading) => {
|
||||
return del(`${prefix}/${applicaiton_id}`, undefined, {}, loading)
|
||||
) => Promise<Result<boolean>> = (application_id, loading) => {
|
||||
return del(`${prefix}/${application_id}`, undefined, {}, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用详情
|
||||
* @param 参数 applicaiton_id
|
||||
* @param 参数 application_id
|
||||
*/
|
||||
const getApplicationDetail: (
|
||||
applicaiton_id: string,
|
||||
application_id: string,
|
||||
loading?: Ref<boolean>
|
||||
) => Promise<Result<any>> = (applicaiton_id, loading) => {
|
||||
return get(`${prefix}/${applicaiton_id}`, undefined, loading)
|
||||
) => Promise<Result<any>> = (application_id, loading) => {
|
||||
return get(`${prefix}/${application_id}`, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得当前应用可使用的知识库
|
||||
* @param 参数 applicaiton_id
|
||||
* @param 参数 application_id
|
||||
*/
|
||||
const getApplicationDataset: (
|
||||
applicaiton_id: string,
|
||||
application_id: string,
|
||||
loading?: Ref<boolean>
|
||||
) => Promise<Result<any>> = (applicaiton_id, loading) => {
|
||||
return get(`${prefix}/${applicaiton_id}/list_dataset`, undefined, loading)
|
||||
) => Promise<Result<any>> = (application_id, loading) => {
|
||||
return get(`${prefix}/${application_id}/list_dataset`, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取AccessToken
|
||||
* @param 参数 applicaiton_id
|
||||
* @param 参数 application_id
|
||||
*/
|
||||
const getAccessToken: (applicaiton_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
applicaiton_id,
|
||||
const getAccessToken: (application_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
application_id,
|
||||
loading
|
||||
) => {
|
||||
return get(`${prefix}/${applicaiton_id}/access_token`, undefined, loading)
|
||||
return get(`${prefix}/${application_id}/access_token`, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改AccessToken
|
||||
* @param 参数 applicaiton_id
|
||||
* @param 参数 application_id
|
||||
* data {
|
||||
* "is_active": true
|
||||
* }
|
||||
*/
|
||||
const putAccessToken: (
|
||||
applicaiton_id: string,
|
||||
application_id: string,
|
||||
data: any,
|
||||
loading?: Ref<boolean>
|
||||
) => Promise<Result<any>> = (applicaiton_id, data, loading) => {
|
||||
return put(`${prefix}/${applicaiton_id}/access_token`, data, undefined, loading)
|
||||
) => Promise<Result<any>> = (application_id, data, loading) => {
|
||||
return put(`${prefix}/${application_id}/access_token`, data, undefined, loading)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -161,8 +161,8 @@ const postChatOpen: (data: ApplicationFormType) => Promise<Result<any>> = (data)
|
|||
]
|
||||
}
|
||||
*/
|
||||
const getChatOpen: (applicaiton_id: String) => Promise<Result<any>> = (applicaiton_id) => {
|
||||
return get(`${prefix}/${applicaiton_id}/chat/open`)
|
||||
const getChatOpen: (application_id: String) => Promise<Result<any>> = (application_id) => {
|
||||
return get(`${prefix}/${application_id}/chat/open`)
|
||||
}
|
||||
/**
|
||||
* 对话
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ const prefix = '/dataset'
|
|||
"name": "string",
|
||||
}
|
||||
*/
|
||||
const getDateset: (
|
||||
const getDataset: (
|
||||
page: pageRequest,
|
||||
param: any,
|
||||
loading?: Ref<boolean>
|
||||
|
|
@ -29,7 +29,7 @@ const getDateset: (
|
|||
* 获取全部知识库
|
||||
* @param 参数
|
||||
*/
|
||||
const getAllDateset: (loading?: Ref<boolean>) => Promise<Result<any[]>> = (loading) => {
|
||||
const getAllDataset: (loading?: Ref<boolean>) => Promise<Result<any[]>> = (loading) => {
|
||||
return get(`${prefix}`, undefined, loading)
|
||||
}
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ const getAllDateset: (loading?: Ref<boolean>) => Promise<Result<any[]>> = (loadi
|
|||
* 删除知识库
|
||||
* @param 参数 dataset_id
|
||||
*/
|
||||
const delDateset: (dataset_id: String, loading?: Ref<boolean>) => Promise<Result<boolean>> = (
|
||||
const delDataset: (dataset_id: String, loading?: Ref<boolean>) => Promise<Result<boolean>> = (
|
||||
dataset_id,
|
||||
loading
|
||||
) => {
|
||||
|
|
@ -69,7 +69,7 @@ const delDateset: (dataset_id: String, loading?: Ref<boolean>) => Promise<Result
|
|||
]
|
||||
}
|
||||
*/
|
||||
const postDateset: (data: datasetData, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
const postDataset: (data: datasetData, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
data,
|
||||
loading
|
||||
) => {
|
||||
|
|
@ -86,7 +86,7 @@ const postDateset: (data: datasetData, loading?: Ref<boolean>) => Promise<Result
|
|||
"selector": "string",
|
||||
}
|
||||
*/
|
||||
const postWebDateset: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
const postWebDataset: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
data,
|
||||
loading
|
||||
) => {
|
||||
|
|
@ -97,7 +97,7 @@ const postWebDateset: (data: any, loading?: Ref<boolean>) => Promise<Result<any>
|
|||
* 知识库详情
|
||||
* @param 参数 dataset_id
|
||||
*/
|
||||
const getDatesetDetail: (dataset_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
const getDatasetDetail: (dataset_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
||||
dataset_id,
|
||||
loading
|
||||
) => {
|
||||
|
|
@ -113,7 +113,7 @@ const getDatesetDetail: (dataset_id: string, loading?: Ref<boolean>) => Promise<
|
|||
"desc": true
|
||||
}
|
||||
*/
|
||||
const putDateset: (dataset_id: string, data: any) => Promise<Result<any>> = (
|
||||
const putDataset: (dataset_id: string, data: any) => Promise<Result<any>> = (
|
||||
dataset_id,
|
||||
data: any
|
||||
) => {
|
||||
|
|
@ -152,7 +152,7 @@ const getDatasetHitTest: (
|
|||
* @param 参数 dataset_id
|
||||
* @query 参数 sync_type // 同步类型->replace:替换同步,complete:完整同步
|
||||
*/
|
||||
const putSyncWebDateset: (
|
||||
const putSyncWebDataset: (
|
||||
dataset_id: string,
|
||||
sync_type: string,
|
||||
loading?: Ref<boolean>
|
||||
|
|
@ -161,14 +161,14 @@ const putSyncWebDateset: (
|
|||
}
|
||||
|
||||
export default {
|
||||
getDateset,
|
||||
getAllDateset,
|
||||
delDateset,
|
||||
postDateset,
|
||||
getDatesetDetail,
|
||||
putDateset,
|
||||
getDataset,
|
||||
getAllDataset,
|
||||
delDataset,
|
||||
postDataset,
|
||||
getDatasetDetail,
|
||||
putDataset,
|
||||
listUsableApplication,
|
||||
getDatasetHitTest,
|
||||
postWebDateset,
|
||||
putSyncWebDateset
|
||||
postWebDataset,
|
||||
putSyncWebDataset
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<template v-for="(item, index) in prologueList" :key="index">
|
||||
<div
|
||||
v-if="item.type === 'question'"
|
||||
@click="quickProblemHandel(item.str)"
|
||||
@click="quickProblemHandle(item.str)"
|
||||
class="problem-button ellipsis-2 mb-8"
|
||||
:class="log ? 'disabled' : 'cursor'"
|
||||
>
|
||||
|
|
@ -266,7 +266,7 @@ function openParagraph(row: any, id?: string) {
|
|||
ParagraphSourceDialogRef.value.open(row, id)
|
||||
}
|
||||
|
||||
function quickProblemHandel(val: string) {
|
||||
function quickProblemHandle(val: string) {
|
||||
if (!props.log && !loading.value) {
|
||||
// inputValue.value = val
|
||||
// nextTick(() => {
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ function initChart() {
|
|||
myChart = echarts.init(document.getElementById(props.id))
|
||||
}
|
||||
const series: any = []
|
||||
if (props.option?.yDatas?.length) {
|
||||
props.option?.yDatas.forEach((item: any, index: number) => {
|
||||
if (props.option?.yData?.length) {
|
||||
props.option?.yData.forEach((item: any, index: number) => {
|
||||
series.push({
|
||||
itemStyle: {
|
||||
color: color[index]
|
||||
|
|
@ -83,7 +83,7 @@ function initChart() {
|
|||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: props.option.xDatas
|
||||
data: props.option.xData
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ defineProps({
|
|||
option: {
|
||||
type: Object,
|
||||
required: true
|
||||
} // { title , xDatas, yDatas, formatStr }
|
||||
} // { title , xData, yData, formatStr }
|
||||
})
|
||||
|
||||
const typeComponentMap = { line } as any
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<el-button type="primary" @click="submitHandle" :disabled="loading">创建</el-button>
|
||||
<el-button @click="showInput = false" :disabled="loading">取消</el-button>
|
||||
</div>
|
||||
<div v-else @click="quickCreateHandel" class="w-full">
|
||||
<div v-else @click="quickCreateHandle" class="w-full">
|
||||
<el-button type="primary" link class="quich-button">
|
||||
<el-icon><Plus /></el-icon>
|
||||
<span class="ml-4">{{ quickCreatePlaceholder }}</span>
|
||||
|
|
@ -104,7 +104,7 @@ function submitHandle() {
|
|||
}
|
||||
}
|
||||
|
||||
function quickCreateHandel() {
|
||||
function quickCreateHandle() {
|
||||
showInput.value = true
|
||||
nextTick(() => {
|
||||
quickInputRef.value?.focus()
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
:parent_field="formField.field + '.' + index"
|
||||
></DynamicsForm>
|
||||
<el-tooltip effect="dark" content="删除" placement="top">
|
||||
<el-button text @click.stop="deleteDateset(item)" class="delete-button">
|
||||
<el-button text @click.stop="deleteDataset(item)" class="delete-button">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
|
|
@ -46,7 +46,7 @@ const props = defineProps<{
|
|||
const render_data = () => {
|
||||
return Promise.resolve(Result.success(props.formField.children as Array<FormField>))
|
||||
}
|
||||
const deleteDateset = (item: any) => {
|
||||
const deleteDataset = (item: any) => {
|
||||
_data.value = _data.value.filter((row) => row !== item)
|
||||
}
|
||||
const emit = defineEmits(['update:modelValue', 'change'])
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ function changeMenu(id: string) {
|
|||
function getDataset() {
|
||||
loading.value = true
|
||||
dataset
|
||||
.asyncGetAllDateset()
|
||||
.asyncGetAllDataset()
|
||||
.then((res: any) => {
|
||||
list.value = res.data
|
||||
common.saveBreadcrumb(list.value)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ const applicationRouter = {
|
|||
parentPath: '/application/:id',
|
||||
parentName: 'ApplicationDetail'
|
||||
},
|
||||
component: () => import('@/views/applicaiton-overview/index.vue')
|
||||
component: () => import('@/views/application-overview/index.vue')
|
||||
},
|
||||
{
|
||||
path: 'setting',
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ export const routes: Array<RouteRecordRaw> = [
|
|||
component: () => import('@/layout/app-layout/index.vue'),
|
||||
redirect: '/application',
|
||||
children: [
|
||||
// TODO 待处理
|
||||
// {
|
||||
// path: '/first',
|
||||
// name: 'first',
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ const useDatasetStore = defineStore({
|
|||
saveDocumentsFile(file: UploadUserFile[]) {
|
||||
this.documentsFiles = file
|
||||
},
|
||||
async asyncGetAllDateset(loading?: Ref<boolean>) {
|
||||
async asyncGetAllDataset(loading?: Ref<boolean>) {
|
||||
return new Promise((resolve, reject) => {
|
||||
datasetApi
|
||||
.getAllDateset(loading)
|
||||
.getAllDataset(loading)
|
||||
.then((data) => {
|
||||
resolve(data)
|
||||
})
|
||||
|
|
@ -39,10 +39,10 @@ const useDatasetStore = defineStore({
|
|||
})
|
||||
})
|
||||
},
|
||||
async asyncGetDatesetDetail(id: string, loading?: Ref<boolean>) {
|
||||
async asyncGetDatasetDetail(id: string, loading?: Ref<boolean>) {
|
||||
return new Promise((resolve, reject) => {
|
||||
datasetApi
|
||||
.getDatesetDetail(id, loading)
|
||||
.getDatasetDetail(id, loading)
|
||||
.then((data) => {
|
||||
resolve(data)
|
||||
})
|
||||
|
|
@ -51,10 +51,10 @@ const useDatasetStore = defineStore({
|
|||
})
|
||||
})
|
||||
},
|
||||
async asyncSyncDateset(id: string, sync_type: string, loading?: Ref<boolean>) {
|
||||
async asyncSyncDataset(id: string, sync_type: string, loading?: Ref<boolean>) {
|
||||
return new Promise((resolve, reject) => {
|
||||
datasetApi
|
||||
.putSyncWebDateset(id, sync_type, loading)
|
||||
.putSyncWebDataset(id, sync_type, loading)
|
||||
.then((data) => {
|
||||
resolve(data)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@
|
|||
.el-checkbox {
|
||||
height: 23px;
|
||||
}
|
||||
tr.hightlight {
|
||||
tr.highlight {
|
||||
background: var(--el-table-current-row-bg-color);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,10 +86,10 @@ class Theme {
|
|||
/**
|
||||
* 转换外推数据
|
||||
* @param setting 设置
|
||||
* @param inferDatas 外推数据
|
||||
* @param inferData 外推数据
|
||||
*/
|
||||
mapInferData = (setting: ThemeSetting, inferDatas: Array<InferData>) => {
|
||||
return inferDatas
|
||||
mapInferData = (setting: ThemeSetting, inferData: Array<InferData>) => {
|
||||
return inferData
|
||||
.map((itemData) => {
|
||||
return this.mapInferMainStyle(setting, itemData)
|
||||
})
|
||||
|
|
@ -173,7 +173,7 @@ class Theme {
|
|||
*
|
||||
* @param setting 主题设置
|
||||
* @param keyValue 主题键值对数据
|
||||
* @param inferDatas 外推数据
|
||||
* @param inferData 外推数据
|
||||
* @returns 合并后的键值对数据
|
||||
*/
|
||||
tokeyValueStyle = () => {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export function isRightType(name: string) {
|
|||
/*
|
||||
从指定数组中过滤出对应的对象
|
||||
*/
|
||||
export function realatedObject(list: any, val: any, attr: string) {
|
||||
export function relatedObject(list: any, val: any, attr: string) {
|
||||
const filterData: any = list.filter((item: any) => item[attr] === val)?.[0]
|
||||
return filterData || null
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
<el-col class="message-container" :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
||||
<div class="title">404</div>
|
||||
<div class="message">很抱歉,无法访问应用!</div>
|
||||
<!-- TODO 暂时不处理 -->
|
||||
<!-- <div class="operate"><el-button type="primary" @click="router.push('/')">返回首页</el-button></div> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ const statisticsType = computed(() => [
|
|||
],
|
||||
option: {
|
||||
title: '用户总数',
|
||||
xDatas: getAttrsArray(props.data, 'day'),
|
||||
yDatas: [
|
||||
xData: getAttrsArray(props.data, 'day'),
|
||||
yData: [
|
||||
{
|
||||
name: '用户总数',
|
||||
type: 'line',
|
||||
|
|
@ -102,8 +102,8 @@ const statisticsType = computed(() => [
|
|||
sum: [getSum(getAttrsArray(props.data, 'chat_record_count') || 0)],
|
||||
option: {
|
||||
title: '提问次数',
|
||||
xDatas: getAttrsArray(props.data, 'day'),
|
||||
yDatas: [
|
||||
xData: getAttrsArray(props.data, 'day'),
|
||||
yData: [
|
||||
{
|
||||
type: 'line',
|
||||
data: getAttrsArray(props.data, 'chat_record_count')
|
||||
|
|
@ -120,8 +120,8 @@ const statisticsType = computed(() => [
|
|||
sum: [getSum(getAttrsArray(props.data, 'tokens_num') || 0)],
|
||||
option: {
|
||||
title: 'Tokens 总数',
|
||||
xDatas: getAttrsArray(props.data, 'day'),
|
||||
yDatas: [
|
||||
xData: getAttrsArray(props.data, 'day'),
|
||||
yData: [
|
||||
{
|
||||
type: 'line',
|
||||
data: getAttrsArray(props.data, 'tokens_num')
|
||||
|
|
@ -141,8 +141,8 @@ const statisticsType = computed(() => [
|
|||
],
|
||||
option: {
|
||||
title: '用户满意度',
|
||||
xDatas: getAttrsArray(props.data, 'day'),
|
||||
yDatas: [
|
||||
xData: getAttrsArray(props.data, 'day'),
|
||||
yData: [
|
||||
{
|
||||
name: '赞同',
|
||||
type: 'line',
|
||||
|
|
|
|||
|
|
@ -54,13 +54,13 @@
|
|||
<el-select
|
||||
v-model="applicationForm.model_id"
|
||||
placeholder="请选择 AI 模型"
|
||||
style="width: 100%"
|
||||
class="w-full"
|
||||
popper-class="select-model"
|
||||
>
|
||||
<el-option-group
|
||||
v-for="(value, label) in modelOptions"
|
||||
:key="value"
|
||||
:label="realatedObject(providerOptions, label, 'provider')?.name"
|
||||
:label="relatedObject(providerOptions, label, 'provider')?.name"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in value.filter((v: any) => v.status === 'SUCCESS')"
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
>
|
||||
<div class="flex">
|
||||
<span
|
||||
v-html="realatedObject(providerOptions, label, 'provider')?.icon"
|
||||
v-html="relatedObject(providerOptions, label, 'provider')?.icon"
|
||||
class="model-icon mr-8"
|
||||
></span>
|
||||
<span>{{ item.name }}</span>
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
>
|
||||
<div class="flex">
|
||||
<span
|
||||
v-html="realatedObject(providerOptions, label, 'provider')?.icon"
|
||||
v-html="relatedObject(providerOptions, label, 'provider')?.icon"
|
||||
class="model-icon mr-8"
|
||||
></span>
|
||||
<span>{{ item.name }}</span>
|
||||
|
|
@ -242,7 +242,7 @@
|
|||
<div class="flex-between">
|
||||
<div class="flex align-center">
|
||||
<AppAvatar
|
||||
v-if="realatedObject(datasetList, item, 'id')?.type === '1'"
|
||||
v-if="relatedObject(datasetList, item, 'id')?.type === '1'"
|
||||
class="mr-8 avatar-purple"
|
||||
shape="square"
|
||||
:size="32"
|
||||
|
|
@ -254,7 +254,7 @@
|
|||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
<div class="ellipsis">
|
||||
{{ realatedObject(datasetList, item, 'id')?.name }}
|
||||
{{ relatedObject(datasetList, item, 'id')?.name }}
|
||||
</div>
|
||||
</div>
|
||||
<el-button text @click="removeDataset(item)">
|
||||
|
|
@ -338,7 +338,7 @@ import applicationApi from '@/api/application'
|
|||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import type { ApplicationFormType } from '@/api/type/application'
|
||||
import type { Provider } from '@/api/type/model'
|
||||
import { realatedObject } from '@/utils/utils'
|
||||
import { relatedObject } from '@/utils/utils'
|
||||
import { MsgSuccess } from '@/utils/message'
|
||||
import useStore from '@/stores'
|
||||
|
||||
|
|
@ -474,7 +474,7 @@ function getDataset() {
|
|||
datasetList.value = res.data
|
||||
})
|
||||
} else {
|
||||
dataset.asyncGetAllDateset(datasetLoading).then((res: any) => {
|
||||
dataset.asyncGetAllDataset(datasetLoading).then((res: any) => {
|
||||
datasetList.value = res.data?.filter((v: any) => v.user_id === user.userInfo?.id)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ function submit() {
|
|||
loading.value = false
|
||||
})
|
||||
} else {
|
||||
datasetApi.postDateset(obj, loading).then((res) => {
|
||||
datasetApi.postDataset(obj, loading).then((res) => {
|
||||
successInfo.value = res.data
|
||||
active.value = 2
|
||||
clearStore()
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ async function submit() {
|
|||
...BaseFormRef.value.form
|
||||
}
|
||||
datasetApi
|
||||
.putDateset(id, obj)
|
||||
.putDataset(id, obj)
|
||||
.then((res) => {
|
||||
MsgSuccess('保存成功')
|
||||
loading.value = false
|
||||
|
|
@ -140,7 +140,7 @@ async function submit() {
|
|||
}
|
||||
|
||||
function getDetail() {
|
||||
dataset.asyncGetDatesetDetail(id, loading).then((res: any) => {
|
||||
dataset.asyncGetDatasetDetail(id, loading).then((res: any) => {
|
||||
detail.value = res.data
|
||||
if (detail.value.type === '1') {
|
||||
form.value = res.data.meta
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ const open = (id: string) => {
|
|||
}
|
||||
|
||||
const submit = () => {
|
||||
dataset.asyncSyncDateset(datasetId.value, method.value, loading).then((res: any) => {
|
||||
dataset.asyncSyncDataset(datasetId.value, method.value, loading).then((res: any) => {
|
||||
emit('refresh', res.data)
|
||||
dialogVisible.value = false
|
||||
})
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
<el-text type="info">{{ filesize(item && item?.size) || '0K' }}</el-text>
|
||||
</div>
|
||||
</div>
|
||||
<el-button text @click="deleteFlie(index)">
|
||||
<el-button text @click="deleteFile(index)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
|
|
@ -78,7 +78,7 @@ const FormRef = ref()
|
|||
watch(form.value, (value) => {
|
||||
dataset.saveDocumentsFile(value.fileList)
|
||||
})
|
||||
function deleteFlie(index: number) {
|
||||
function deleteFile(index: number) {
|
||||
form.value.fileList.splice(index, 1)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
@click.stop="router.push({ path: `/dataset/${item.id}/setting` })"
|
||||
>设置</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item icon="Delete" @click.stop="deleteDateset(item)"
|
||||
<el-dropdown-item icon="Delete" @click.stop="deleteDataset(item)"
|
||||
>删除</el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
|
|
@ -131,7 +131,7 @@ function searchHandle() {
|
|||
getList()
|
||||
}
|
||||
|
||||
function deleteDateset(row: any) {
|
||||
function deleteDataset(row: any) {
|
||||
MsgConfirm(
|
||||
`是否删除知识库:${row.name} ?`,
|
||||
`此知识库关联 ${row.application_mapping_count} 个应用,删除后无法恢复,请谨慎操作。`,
|
||||
|
|
@ -141,7 +141,7 @@ function deleteDateset(row: any) {
|
|||
}
|
||||
)
|
||||
.then(() => {
|
||||
datasetApi.delDateset(row.id, loading).then(() => {
|
||||
datasetApi.delDataset(row.id, loading).then(() => {
|
||||
const index = datasetList.value.findIndex((v) => v.id === row.id)
|
||||
datasetList.value.splice(index, 1)
|
||||
MsgSuccess('删除成功')
|
||||
|
|
@ -152,7 +152,7 @@ function deleteDateset(row: any) {
|
|||
|
||||
function getList() {
|
||||
datasetApi
|
||||
.getDateset(paginationConfig, searchValue.value && { name: searchValue.value }, loading)
|
||||
.getDataset(paginationConfig, searchValue.value && { name: searchValue.value }, loading)
|
||||
.then((res) => {
|
||||
paginationConfig.total = res.data.total
|
||||
datasetList.value = [...datasetList.value, ...res.data.records]
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ const onSubmit = async () => {
|
|||
await webFormRef.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
const obj = { ...BaseFormRef.value.form, ...form.value }
|
||||
datasetApi.postWebDateset(obj, loading).then((res) => {
|
||||
datasetApi.postWebDataset(obj, loading).then((res) => {
|
||||
MsgSuccess('提交成功')
|
||||
dataset.saveBaseInfo(null)
|
||||
dataset.saveWebInfo(null)
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ function getList(bool?: boolean) {
|
|||
}
|
||||
|
||||
function getDetail() {
|
||||
dataset.asyncGetDatesetDetail(id, loading).then((res: any) => {
|
||||
dataset.asyncGetDatasetDetail(id, loading).then((res: any) => {
|
||||
datasetDetail.value = res.data
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-drawer v-model="visible" size="60%" @close="closeHandel" class="chat-record-drawer">
|
||||
<el-drawer v-model="visible" size="60%" @close="closeHandle" class="chat-record-drawer">
|
||||
<template #header>
|
||||
<h4>{{ currentAbstract }}</h4>
|
||||
</template>
|
||||
|
|
@ -77,7 +77,7 @@ const paginationConfig = reactive({
|
|||
total: 0
|
||||
})
|
||||
|
||||
function closeHandel() {
|
||||
function closeHandle() {
|
||||
recordList.value = []
|
||||
paginationConfig.total = 0
|
||||
paginationConfig.current_page = 1
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ function rowClickHandle(row: any) {
|
|||
}
|
||||
|
||||
const setRowClass = ({ row }: any) => {
|
||||
return currentChatId.value === row?.id ? 'hightlight' : ''
|
||||
return currentChatId.value === row?.id ? 'highlight' : ''
|
||||
}
|
||||
|
||||
function deleteLog(row: any) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-drawer v-model="visible" size="60%" @close="closeHandel">
|
||||
<el-drawer v-model="visible" size="60%" @close="closeHandle">
|
||||
<template #header>
|
||||
<h4>问题详情</h4>
|
||||
</template>
|
||||
|
|
@ -148,7 +148,7 @@ function editName(val: string) {
|
|||
}
|
||||
}
|
||||
|
||||
function closeHandel() {
|
||||
function closeHandle() {
|
||||
paragraphList.value = []
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ function rowClickHandle(row: any) {
|
|||
}
|
||||
|
||||
const setRowClass = ({ row }: any) => {
|
||||
return currentClickId.value === row?.id ? 'hightlight' : ''
|
||||
return currentClickId.value === row?.id ? 'highlight' : ''
|
||||
}
|
||||
|
||||
function handleSizeChange() {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
"composite": true,
|
||||
"moduleResolution": "node",
|
||||
"baseUrl": ".",
|
||||
"target": "esnext", // 使用ES最新语法
|
||||
"module": "esnext", // 使用ES模块语法
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@
|
|||
"composite": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"types": ["node"]
|
||||
"skipLibCheck": true, // 跳过node依赖包语法检查
|
||||
"types": [
|
||||
"node"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,8 @@
|
|||
"exclude": [],
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "esnext", // 使用ES最新语法
|
||||
"module": "esnext", // 使用ES模块语法
|
||||
"lib": [],
|
||||
"types": ["node", "jsdom"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue