2 Star 0 Fork 5

anolis/python-tone-agent

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.py 838 Bytes
一键复制 编辑 原始数据 按行查看 历史
付勇 提交于 2024-01-10 11:29 +08:00 . feat: v1.1.1
# coding: utf-8
import urllib3
from sanic import Sanic
from urllib3.exceptions import InsecureRequestWarning
from app import init_app, prompt_info
from core.common.enum import AgentMode
from core.common.log import logger
from conf import SERVICE_CONFIG
from core.scheduler import run_scheduler_forever, run_by_threaded
# 忽略InsecureRequestWarning警告
urllib3.disable_warnings(InsecureRequestWarning)
def main():
app: Sanic = init_app()
logger.info(prompt_info)
if SERVICE_CONFIG.get('mode') == AgentMode.ACTIVE:
run_by_threaded(run_scheduler_forever)
app.run(
host='0.0.0.0',
port=app.config.get('APP_PORT'),
# workers=app.config.get('WORKS_NUM'),
# auto_reload=True,
single_process=True
)
if __name__ == '__main__':
main()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/anolis/python-tone-agent.git
git@gitee.com:anolis/python-tone-agent.git
anolis
python-tone-agent
python-tone-agent
master

搜索帮助