bugfix
This commit is contained in:
parent
fcb477d7ea
commit
8117c1ee7e
@ -5,8 +5,8 @@ from aiohttp import ClientSession, ClientTimeout
|
||||
import json
|
||||
from .file import file_uploaded, file_deleted
|
||||
from .folderinfo import RagFileMgr
|
||||
from .ragprogram import set_program, get_rag_programs
|
||||
from appPublic.registerfunction import RegisterFunction
|
||||
from filemgr.filemgr import use_module_patches
|
||||
|
||||
async def _make_connection_request(action: str, params: dict = None) -> dict:
|
||||
"""
|
||||
@ -141,9 +141,6 @@ def load_rag():
|
||||
"""
|
||||
初始化 ServerEnv,绑定 MilvusConnection 的所有功能。
|
||||
"""
|
||||
rf = RegisterFunction()
|
||||
rf.register('fileuploaded', file_uploaded)
|
||||
rf.register('filedeleted', file_deleted)
|
||||
env = ServerEnv()
|
||||
env.create_collection = create_collection
|
||||
env.delete_collection = delete_collection
|
||||
@ -156,4 +153,6 @@ def load_rag():
|
||||
env.list_all_knowledge_bases = list_all_knowledge_bases
|
||||
env.docs = docs
|
||||
env.RagFileMgr = RagFileMgr
|
||||
env.set_program = set_program
|
||||
env.get_rag_program = get_rag_program
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ def set_program(request, program_type, quota):
|
||||
await sor.C('ragquota', ns)
|
||||
|
||||
|
||||
def get_programs(request):
|
||||
def get_rag_programs(request):
|
||||
db = DBPools()
|
||||
dbname = get_serverenv('get_module_dbanme')('rag')
|
||||
async with db.sqlorContext(dbname) as sor:
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
"height":"100%"
|
||||
},
|
||||
"subwidgets":[
|
||||
{% for p in get_rag_programs() %}
|
||||
{% for p in get_rag_programs(request) %}
|
||||
{
|
||||
"widgettype":"VBox",
|
||||
"options":{
|
||||
@ -54,7 +54,51 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype":"HBox",
|
||||
"options":{
|
||||
"height":1.5
|
||||
},
|
||||
"subwidgets":[
|
||||
{
|
||||
"widgettype":"text",
|
||||
"options":{
|
||||
"otext":"时长(月)",
|
||||
"i18n":true
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype":"text",
|
||||
"options":{
|
||||
"text":"{{p.term}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"widgettype":"HBox",
|
||||
"options":{
|
||||
"height":1.5
|
||||
},
|
||||
"subwidgets":[
|
||||
{
|
||||
"widgettype":"text",
|
||||
"options":{
|
||||
"otext":"价格",
|
||||
"i18n":true
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype":"text",
|
||||
"options":{
|
||||
"color":"red",
|
||||
"text":"{{p.price}}圆"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
],
|
||||
"binds":[
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user