Compare commits
No commits in common. "9c42771aa8270c2592d507e38277e0710152b136" and "ea205fbb7c81235b5d7a609bdd7910197f17ee7e" have entirely different histories.
9c42771aa8
...
ea205fbb7c
@ -5,8 +5,8 @@ from aiohttp import ClientSession, ClientTimeout
|
|||||||
import json
|
import json
|
||||||
from .file import file_uploaded, file_deleted
|
from .file import file_uploaded, file_deleted
|
||||||
from .folderinfo import RagFileMgr
|
from .folderinfo import RagFileMgr
|
||||||
from .ragprogram import set_program, get_rag_programs
|
|
||||||
from appPublic.registerfunction import RegisterFunction
|
from appPublic.registerfunction import RegisterFunction
|
||||||
|
from filemgr.filemgr import use_module_patches
|
||||||
|
|
||||||
async def _make_connection_request(action: str, params: dict = None) -> dict:
|
async def _make_connection_request(action: str, params: dict = None) -> dict:
|
||||||
"""
|
"""
|
||||||
@ -141,6 +141,9 @@ def load_rag():
|
|||||||
"""
|
"""
|
||||||
初始化 ServerEnv,绑定 MilvusConnection 的所有功能。
|
初始化 ServerEnv,绑定 MilvusConnection 的所有功能。
|
||||||
"""
|
"""
|
||||||
|
rf = RegisterFunction()
|
||||||
|
rf.register('fileuploaded', file_uploaded)
|
||||||
|
rf.register('filedeleted', file_deleted)
|
||||||
env = ServerEnv()
|
env = ServerEnv()
|
||||||
env.create_collection = create_collection
|
env.create_collection = create_collection
|
||||||
env.delete_collection = delete_collection
|
env.delete_collection = delete_collection
|
||||||
@ -153,6 +156,4 @@ def load_rag():
|
|||||||
env.list_all_knowledge_bases = list_all_knowledge_bases
|
env.list_all_knowledge_bases = list_all_knowledge_bases
|
||||||
env.docs = docs
|
env.docs = docs
|
||||||
env.RagFileMgr = RagFileMgr
|
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)
|
await sor.C('ragquota', ns)
|
||||||
|
|
||||||
|
|
||||||
def get_rag_programs(request):
|
def get_programs(request):
|
||||||
db = DBPools()
|
db = DBPools()
|
||||||
dbname = get_serverenv('get_module_dbanme')('rag')
|
dbname = get_serverenv('get_module_dbanme')('rag')
|
||||||
async with db.sqlorContext(dbname) as sor:
|
async with db.sqlorContext(dbname) as sor:
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
"height":"100%"
|
"height":"100%"
|
||||||
},
|
},
|
||||||
"subwidgets":[
|
"subwidgets":[
|
||||||
{% for p in get_rag_programs(request) %}
|
{% for p in get_rag_programs() %}
|
||||||
{
|
{
|
||||||
"widgettype":"VBox",
|
"widgettype":"VBox",
|
||||||
"options":{
|
"options":{
|
||||||
@ -54,51 +54,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
{
|
|
||||||
"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":[
|
"binds":[
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user