Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
liqiang-fit2cloud committed Mar 21, 2024
2 parents 6533b87 + df89650 commit d895998
Show file tree
Hide file tree
Showing 36 changed files with 22 additions and 84 deletions.
2 changes: 1 addition & 1 deletion apps/application/chat_pipeline/I_base_chat_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
import time
from abc import abstractmethod
from typing import Type, Dict
from typing import Type

from rest_framework import serializers

Expand Down
10 changes: 0 additions & 10 deletions apps/application/swagger_api/application_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@

from common.mixins.api_mixin import ApiMixin

"""
name = serializers.CharField(required=True)
desc = serializers.CharField(required=True)
model_id = serializers.CharField(required=True)
multiple_rounds_dialogue = serializers.BooleanField(required=True)
prologue = serializers.CharField(required=True)
example = serializers.ListSerializer(required=False, child=serializers.CharField(required=True))
dataset_id_list = serializers.ListSerializer(required=False, child=serializers.UUIDField(required=True))
"""


class ApplicationApi(ApiMixin):
class Authentication(ApiMixin):
Expand Down
7 changes: 0 additions & 7 deletions apps/common/auth/authenticate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,12 @@

from django.core import cache
from django.core import signing
from django.db.models import QuerySet
from rest_framework.authentication import TokenAuthentication

from application.models.api_key_model import ApplicationAccessToken, ApplicationApiKey
from common.auth.handle.impl.application_key import ApplicationKey
from common.auth.handle.impl.public_access_token import PublicAccessToken
from common.auth.handle.impl.user_token import UserToken
from common.constants.authentication_type import AuthenticationType
from common.constants.permission_constants import Auth, get_permission_list_by_role, RoleConstants, Permission, Group, \
Operate
from common.exception.app_exception import AppAuthenticationFailed, AppEmbedIdentityFailed, AppChatNumOutOfBoundsFailed
from smartdoc.settings import JWT_AUTH
from users.models.user import User, get_user_dynamics_permission

token_cache = cache.caches['token_cache']

Expand Down
4 changes: 2 additions & 2 deletions apps/common/config/embedding_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
@date:2023/10/23 16:03
@desc:
"""
import types
from smartdoc.const import CONFIG
from langchain_community.embeddings import HuggingFaceEmbeddings

from smartdoc.const import CONFIG


class EmbeddingModel:
instance = None
Expand Down
2 changes: 1 addition & 1 deletion apps/common/froms/array_object_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@date:2023/10/31 18:03
@desc:
"""
from typing import List, Dict
from typing import Dict

from common.froms.base_field import BaseExecField, TriggerType

Expand Down
2 changes: 1 addition & 1 deletion apps/common/froms/object_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@date:2023/10/31 18:02
@desc:
"""
from typing import List, Dict
from typing import Dict

from common.froms.base_field import BaseExecField, TriggerType

Expand Down
2 changes: 1 addition & 1 deletion apps/common/froms/password_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@date:2023/11/1 14:48
@desc:
"""
from typing import List, Dict
from typing import Dict

from common.froms import BaseField, TriggerType

Expand Down
2 changes: 1 addition & 1 deletion apps/common/froms/tab_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@date:2023/10/31 18:03
@desc:
"""
from typing import List, Dict
from typing import Dict

from common.froms.base_field import BaseExecField, TriggerType

Expand Down
2 changes: 1 addition & 1 deletion apps/common/froms/table_checkbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@date:2023/10/31 18:01
@desc:
"""
from typing import List, Dict
from typing import Dict

from common.froms.base_field import TriggerType, BaseExecField

Expand Down
2 changes: 1 addition & 1 deletion apps/common/froms/table_radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@date:2023/10/31 18:01
@desc:
"""
from typing import List, Dict
from typing import Dict

from common.froms.base_field import TriggerType, BaseExecField

Expand Down
2 changes: 1 addition & 1 deletion apps/common/froms/text_input_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@date:2023/10/31 17:58
@desc:
"""
from typing import List, Dict
from typing import Dict

from common.froms.base_field import BaseField, TriggerType

Expand Down
1 change: 0 additions & 1 deletion apps/common/handle/handle_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"""
import logging
import traceback
from typing import Dict

from rest_framework.exceptions import ValidationError, ErrorDetail, APIException
from rest_framework.views import exception_handler
Expand Down
7 changes: 3 additions & 4 deletions apps/common/util/fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
import traceback
from functools import reduce
from typing import List, Set
import requests
from urllib.parse import urljoin, urlparse, ParseResult, urlsplit

import html2text as ht
import requests
from bs4 import BeautifulSoup
from urllib.parse import urljoin, urlparse, ParseResult, urlsplit, parse_qs

from common.exception.app_exception import AppApiException

requests.packages.urllib3.disable_warnings()

Expand Down
6 changes: 2 additions & 4 deletions apps/common/util/rsa_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
@desc:
"""
import base64
import os
import threading

from Crypto.Cipher import PKCS1_v1_5 as PKCS1_cipher
from Crypto.PublicKey import RSA
from django.db.models import QuerySet
from django.core import cache
from django.db.models import QuerySet

from setting.models import SystemSetting, SettingType

import threading

lock = threading.Lock()
rsa_cache = cache.caches['default']
cache_key = "rsa_key"
Expand Down
5 changes: 2 additions & 3 deletions apps/common/util/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
@date:2023/11/15 15:13
@desc:
"""
import hashlib
import time

from django.core import signing
import hashlib
from django.core.cache import cache

# alg使用的算法
Expand Down Expand Up @@ -75,5 +76,3 @@ def check_token(token):
return False


if __name__ == '__main__':
token = create_token('zhangsan', 'lisi')
5 changes: 2 additions & 3 deletions apps/embedding/vector/pg_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
import uuid
from typing import Dict, List

from django.contrib.postgres.search import SearchVector
from django.db.models import QuerySet
from langchain_community.embeddings import HuggingFaceEmbeddings

from common.config.embedding_config import EmbeddingModel
from common.db.search import native_search, generate_sql_by_query_dict
from common.db.sql_execute import select_one, select_list
from common.db.search import generate_sql_by_query_dict
from common.db.sql_execute import select_list
from common.util.file_util import get_file_content
from embedding.models import Embedding, SourceType
from embedding.vector.base_vector import BaseVectorStore
Expand Down
1 change: 0 additions & 1 deletion apps/setting/models/system_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@date:2024/3/19 13:47
@desc: 邮箱管理
"""
import uuid

from django.db import models

Expand Down
2 changes: 1 addition & 1 deletion apps/setting/views/system_setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from rest_framework.views import APIView

from common.auth import TokenAuth, has_permissions
from common.constants.permission_constants import PermissionConstants, RoleConstants
from common.constants.permission_constants import RoleConstants
from common.response import result
from setting.serializers.system_setting import SystemSettingSerializer
from setting.swagger_api.system_setting import SystemSettingEmailApi
Expand Down
1 change: 0 additions & 1 deletion ui/src/api/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ const updateModel: (
request: EditModelRequest,
loading?: Ref<boolean>
) => Promise<Result<Model>> = (model_id, request, loading) => {
console.log(request)
return put(`${prefix}/${model_id}`, request, {}, loading)
}

Expand Down
1 change: 0 additions & 1 deletion ui/src/components/ai-chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ function chatMessage(chat?: any, problem?: string) {
applicationApi
.postChatMessage(chartOpenId.value, chat.problem_text)
.then((response) => {
console.log(response.status)
if (response.status === 401) {
application
.asyncAppAuthentication(accessToken)
Expand Down
2 changes: 0 additions & 2 deletions ui/src/components/dynamics-form/FormItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,9 @@ onMounted(() => {
bus.on(key, (v: any) => {
if (value && value.length > 0) {
if (value.includes(v)) {
console.log('符合情况,即将获取数据', key, v)
props.trigger(props.formfield, loading)
}
} else {
console.log('符合情况,即将获取数据', key, v)
props.trigger(props.formfield, loading)
}
})
Expand Down
2 changes: 0 additions & 2 deletions ui/src/components/dynamics-form/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ const show = (field: FormField) => {
for (const index in keys) {
const key = keys[index]
let v = _.get(formValue.value, key)
console.log(v, key)
if (v && v !== undefined && v !== null) {
let values = field.relation_show_field_dict[key]
if (values && values.length > 0) {
Expand Down Expand Up @@ -173,7 +172,6 @@ const render = (
})
}
if (data) {
console.log(data)
formValue.value = data
}
}
Expand Down
5 changes: 1 addition & 4 deletions ui/src/request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ instance.interceptors.response.use(
return response
},
(err: any) => {
console.log(err)
if (err.code === 'ECONNABORTED') {
MsgError(err.message)
console.error(err)
Expand Down Expand Up @@ -218,9 +217,7 @@ export const exportExcel: (
window.URL.revokeObjectURL(link.href)
}
})
.catch((e) => {
console.log(e)
})
.catch((e) => {})
}

/**
Expand Down
2 changes: 0 additions & 2 deletions ui/src/views/applicaiton-overview/component/LimitDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ const submit = async (formEl: FormInstance | undefined) => {
MsgSuccess('设置成功')
dialogVisible.value = false
})
} else {
console.log('error submit!', fields)
}
})
}
Expand Down
2 changes: 0 additions & 2 deletions ui/src/views/application/CreateAndSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,6 @@ const submit = async (formEl: FormInstance | undefined) => {
router.push({ path: `/application` })
})
}
} else {
console.log('error submit!')
}
})
}
Expand Down
1 change: 0 additions & 1 deletion ui/src/views/dataset/component/BaseForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const FormRef = ref()
watch(
() => props.data,
(value) => {
console.log(value)
if (value && JSON.stringify(value) !== '{}') {
form.value.name = value.name
form.value.desc = value.desc
Expand Down
4 changes: 1 addition & 3 deletions ui/src/views/dataset/component/ParagraphPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ function updateContent(data: any) {
emit('update:data', newData.value)
}
const handleClick = (tab: TabsPaneContext, event: Event) => {
// console.log(tab, event)
}
const handleClick = (tab: TabsPaneContext, event: Event) => {}
onMounted(() => {})
</script>
Expand Down
2 changes: 0 additions & 2 deletions ui/src/views/document/component/ImportDocumentDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ const submit = async (formEl: FormInstance | undefined) => {
dialogVisible.value = false
})
}
} else {
console.log('error submit!', fields)
}
})
}
Expand Down
1 change: 0 additions & 1 deletion ui/src/views/document/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ function changeState(bool: Boolean, row: any) {
}
function editName(val: string) {
console.log()
if (val) {
const obj = {
name: val
Expand Down
2 changes: 0 additions & 2 deletions ui/src/views/email/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ const submit = async (formEl: FormInstance | undefined, test?: string) => {
MsgSuccess('设置成功')
})
}
} else {
console.log('error submit!')
}
})
}
Expand Down
2 changes: 0 additions & 2 deletions ui/src/views/log/component/EditContentDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ const submitForm = async (formEl: FormInstance | undefined) => {
emit('refresh', res.data)
dialogVisible.value = false
})
} else {
console.log('error submit!', fields)
}
})
}
Expand Down
2 changes: 0 additions & 2 deletions ui/src/views/log/component/EditMarkDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ const submit = async (formEl: FormInstance) => {
.then((res) => {
dialogVisible.value = false
})
} else {
console.log('error submit!')
}
})
}
Expand Down
8 changes: 0 additions & 8 deletions ui/src/views/team/component/CreateMemberDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,10 @@ const submitMember = async (formEl: FormInstance | undefined) => {
dialogVisible.value = false
loading.value = false
})
} else {
console.log('error submit!')
}
})
}
// const getUser = (val: string) => {
// UserApi.getUserList(val, loading).then((res) => {
// userOptions.value.push(res.data)
// })
// }
onMounted(() => {})
defineExpose({ open, close })
Expand Down
1 change: 0 additions & 1 deletion ui/src/views/template/component/EditModel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ const getModelForm = (model_name: string) => {
).then((ok) => {
model_form_field.value = ok.data
if (modelValue.value) {
console.log(modelValue.value.credential)
// 渲染动态表单
dynamicsFormRef.value?.render(model_form_field.value, modelValue.value.credential)
}
Expand Down
2 changes: 0 additions & 2 deletions ui/src/views/user-manage/component/UserDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ const submit = async (formEl: FormInstance | undefined) => {
dialogVisible.value = false
})
}
} else {
console.log('error submit!', fields)
}
})
}
Expand Down
Loading

0 comments on commit d895998

Please sign in to comment.