bugfix
This commit is contained in:
parent
ae43ce2c6c
commit
fbed69ea35
34
app/sage.py
34
app/sage.py
@ -21,8 +21,6 @@ from dapi.init import load_dapi
|
|||||||
from rag.init import load_rag
|
from rag.init import load_rag
|
||||||
from msp.init import load_msp
|
from msp.init import load_msp
|
||||||
from checklang.init import load_checklang
|
from checklang.init import load_checklang
|
||||||
# from skillagent.init import load_skillagent
|
|
||||||
# from dagflow.init import load_dagflow
|
|
||||||
from discount.init import load_discount
|
from discount.init import load_discount
|
||||||
from harnessed_agent.init import load_harnessed_agent
|
from harnessed_agent.init import load_harnessed_agent
|
||||||
from harnessed_reasoning.init import load_harnessed_reasoning
|
from harnessed_reasoning.init import load_harnessed_reasoning
|
||||||
@ -31,39 +29,11 @@ from global_func import set_globalvariable
|
|||||||
from unipay.init import load_unipay
|
from unipay.init import load_unipay
|
||||||
from platformbiz.init import load_platformbiz
|
from platformbiz.init import load_platformbiz
|
||||||
from accounting.init import load_accounting
|
from accounting.init import load_accounting
|
||||||
# from woa.init import load_woa
|
|
||||||
from smssend import load_smssend
|
from smssend import load_smssend
|
||||||
from ext import *
|
from ext import *
|
||||||
from rf import *
|
from rf import *
|
||||||
__version__ = '0.0.1'
|
__version__ = '0.0.1'
|
||||||
|
|
||||||
async def run_zmq_proxy(app):
|
|
||||||
task = asyncio.create_task(run_proxy())
|
|
||||||
app['zmq_proxy_task'] = task
|
|
||||||
task1 = asyncio.create_task(woa_msghande())
|
|
||||||
yield
|
|
||||||
task1.cancel()
|
|
||||||
task.cancel()
|
|
||||||
|
|
||||||
async def msg_handler(msgstr):
|
|
||||||
debug(f'get message:{msgstr}')
|
|
||||||
msg = DictObject(**json.loads(msgstr))
|
|
||||||
ret = {
|
|
||||||
"msgtype": "text", # 要返回的消息类型
|
|
||||||
"content": "收到" # 每个类型的消息所需要的数据
|
|
||||||
}
|
|
||||||
retstr = json.dumps(ret, ensure_ascii=False)
|
|
||||||
await zmq_publish(msg.subscribe_id, retstr)
|
|
||||||
|
|
||||||
async def woa_msghande():
|
|
||||||
config = getConfig()
|
|
||||||
debug(f'woa_msghander on({config.woa_handler_id}) starting ....')
|
|
||||||
try:
|
|
||||||
await zmq_subscribe(config.woa_handler_id, msg_handler)
|
|
||||||
except Exception as e:
|
|
||||||
debug(f'Exception:{e}')
|
|
||||||
debug('woa_msghandler stopped.................')
|
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
rf = RegisterFunction()
|
rf = RegisterFunction()
|
||||||
set_globalvariable()
|
set_globalvariable()
|
||||||
@ -81,15 +51,11 @@ def init():
|
|||||||
load_rag()
|
load_rag()
|
||||||
load_pricing()
|
load_pricing()
|
||||||
load_checklang()
|
load_checklang()
|
||||||
# load_skillagent()
|
|
||||||
# load_dagflow()
|
|
||||||
load_harnessed_agent()
|
load_harnessed_agent()
|
||||||
load_harnessed_reasoning()
|
load_harnessed_reasoning()
|
||||||
load_discount()
|
load_discount()
|
||||||
load_hermes_web_cli()
|
load_hermes_web_cli()
|
||||||
# load_woa()
|
|
||||||
load_smssend()
|
load_smssend()
|
||||||
# add_cleanupctx(run_zmq_proxy)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
webapp(init)
|
webapp(init)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user