diff --git a/app/sage.py b/app/sage.py index f4de507..90b7aa9 100644 --- a/app/sage.py +++ b/app/sage.py @@ -1,10 +1,11 @@ import os, sys +import json import asyncio import argparse from appPublic.log import MyLogger, info, debug, warning from appPublic.folderUtils import ProgramPath from appPublic.jsonConfig import getConfig -from appPublic.zmqapi import run_proxy +from appPublic.zmqapi import run_proxy, zmq_subscribe from appPublic.registerfunction import RegisterFunction from bricks_for_python.init import load_pybricks from ahserver.webapp import webapp @@ -28,6 +29,7 @@ from global_func import set_globalvariable from unipay.init import load_unipay from platformbiz.init import load_platformbiz from accounting.init import load_accounting +from woa.init import load_woa from ext import * from rf import * __version__ = '0.0.1' @@ -35,9 +37,30 @@ __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(): rf = RegisterFunction() set_globalvariable() @@ -57,6 +80,8 @@ def init(): load_checklang() load_skillagent() load_dagflow() + load_discount() + load_woa() add_cleanupctx(run_zmq_proxy) if __name__ == '__main__': diff --git a/build.sh b/build.sh index 8510563..fd42b87 100755 --- a/build.sh +++ b/build.sh @@ -15,7 +15,7 @@ cd bricks/bricks ./build.sh cd $cdir/wwwroot ln -s $cdir/pkgs/bricks/dist $dir/wwwroot/bricks -for m in apppublic sqlor ahserver bricks-for-python xls2ddl checklang, skillagent +for m in apppublic sqlor ahserver bricks-for-python xls2ddl checklang, skillagent dagflow discount do echo "install $m module..." cd $cdir/pkgs @@ -23,7 +23,7 @@ do cd $m $cdir/py3/bin/pip install . done -for m in appbase rbac accounting llmage platformbiz msp cpcc unipay filemgr dapi uapi rag charge pricing, dagflow discount +for m in appbase rbac accounting llmage platformbiz msp cpcc unipay filemgr dapi uapi rag charge pricing dagflow wechat-office-account discount do echo "install $m module..." cd $cdir/pkgs diff --git a/conf/config.json b/conf/config.json index 107ec3d..344f71f 100755 --- a/conf/config.json +++ b/conf/config.json @@ -1,5 +1,7 @@ { "password_key":"!@#$%^&*(*&^%$QWERTYUIqwertyui234567", + "logopath": "$[workdir]$/conf/logo.png", + "woa_handler_id":"woa_subscribe_type", "logger":{ "name":"sage", "levelname":"clientinfo", diff --git a/skills/clm/README.md b/skills/clm/README.md new file mode 100644 index 0000000..aefba89 --- /dev/null +++ b/skills/clm/README.md @@ -0,0 +1,39 @@ +合同生命周期skills合集 + +合同生命周期管理中要用到以下skills + +| 生命周期阶段 | 可能的 Skill 方向 | 示例触发词 | +| -------------------- | ----------------------- | ----------------------------------------- | +| **合同模板生成** | 生成标准合同草案 | "Draft contract", "Generate NDA template" | +| **合同审阅分析** | (已有示例 Skill 可参考) 合同风险检查 | "Review this contract", "List risks" | +| **条款提取** | 从合同中提取关键条款/字段 | "Extract dates, parties, term" | +| **版本比较 & redlining** | 比较两个版本差异,给出红线建议 | "Compare versions, highlight changes" | +| **义务追踪** | 识别并追踪合同义务 | "List obligations and deadlines" | +| **续约提醒 & 到期管理** | 解析日期并生成提醒工作流 | "Notify me 30 days before expiry" | +| **合规性检查** | 检查合同符合内部政策或法规标准 | "Check compliance with GDPR" | + +这些都可以作为单独 Skill 来创建,或者组合成一个 “合同生命周期管理 Skill 套件”。每个 Skill 都需定义 SKILL.md 且描述具体用途 + +. 合同审查 / Contract Review Skill + +📌 用途:帮助分析合同、提取关键条款、识别风险点 + +社区中已经有开发者分享了 开源合同审查 Skill +例如一个专注于 NDA、SaaS 或供应商合同风险分析的 Skill,可以直接下载并放到 Claude Code 的 ~/.claude/skills/... 目录下使用。 + +这个 Skill 是基于 Agent Skills 标准 编写的 Markdown(SKILL.md),Claude 会根据合同分析的任务自动触发。 + +👉 适合阶段:合同审阅、风险分析、市场标准对比 (通常是生命周期管理中的“分析与审核”步骤) + + +合同管理agent制定合同管理的流程,在适当的时候调用适当的skill来完成合同生命周期管理 + + +1. 合同原子化技能(Skills)分类 + +你可以将这些 Skill 看作是给 AI 戴上的“专业眼镜”: +技能名称 核心功能 (Skill Logic) 常用场景 +条款提取器 自动识别合同中的主体、金额、有效期、管辖地,输出结构化 JSON 数据。 合同台账自动导入 +红线审查 (Redlining) 根据预设的规则(如“违约金不超10%”),自动修改违约条款。 供应商合同初审 +条款对齐 对比同一合同的两个版本,识别对方偷偷修改的细微词汇(如“应”改为“可”)。 合同谈判回传比对 +合规性评分 根据所在行业法律(如 GDPR、数据安全法)给出合规分值及整改建议。 跨境贸易合规审计 diff --git a/skills/pingpang/SKILL.md b/skills/pingpang/SKILL.md new file mode 100644 index 0000000..018b833 --- /dev/null +++ b/skills/pingpang/SKILL.md @@ -0,0 +1,12 @@ +--- +name: pingpang +description: 测试函数方式的skill +--- +# pingpang +一个简单的乒乓测试技能,用于测试函数方式的技能脚本能够正常执行 + +## 乒乓测试 +``` +CALL: {"function": "pingpang", "params":{"prompt":用户输入文本}} +``` + diff --git a/skills/video-generate/SKILL.md b/skills/video-generate/SKILL.md new file mode 100644 index 0000000..6bc959f --- /dev/null +++ b/skills/video-generate/SKILL.md @@ -0,0 +1,33 @@ +--- +name: video-generate +description: 根据用户输入调用视频生成大模型来生成视频 +--- +# 视频生成 +根据用户输入,用视频生成模型生成视频,支持文生视频,图生视频和参考生视频 + +缺省使用vidu的视频生成模型,用户可以在输入中明确说明使用哪家的生成工具,目前可选的厂家有: +序号|厂家|供应商id | +----+-----+----------| +1 | 阿里(通义万相)| 6fadgewjraOyvxC_EkHou| +2 | 豆包(火山云) |Cy-zrc4DgLIFuA0KMQzlw | +3 | vidu(生数) | Bu3Z6OXANehbkD6OK5NJb | + +没有明确说明就用vidu +错峰生成:许多厂商为平衡负荷,推出错峰生成能力,利用价格优势引导用户将不急的任务设置为错峰生成 + +## 文生视频 +用用户输入的剔除选择厂家的内容后的文本作为文生视频的输入文本来生成视频,使用方式: +``` +CALL:{ "function": "text2video", "params":{"off_peak":逻辑值,错峰生成,缺省为否,"prompt":剔除参数文本后的用户输入文本,"providerid": 识别的厂家id} +``` + +## 图生视频 +如果没有图像输入,改用文生视频,如果输入了多于等于两个图像,只使用最后的两个图像文件, 图像支持给定公网可访问的url + +前一个输入端图像为first_frame, 后一个输入端图像文件为tail_frame, tail_frame可以为空, 输入文本剔除选择厂家的内容为prompt + +使用格式 +``` +CALL: {"function": "image2video", "params":{"逻辑值,错峰生成,缺省为否, "prompt":剔除参数文本后的用户输入文本,"first_frame":前面图像文件的url,"end_frame":后面图像的url,"providerid": 识别的厂家id}} +``` + diff --git a/wwwroot/i18n/en/i18n.json b/wwwroot/i18n/en/i18n.json index f6b7d8b..a9595bf 100644 --- a/wwwroot/i18n/en/i18n.json +++ b/wwwroot/i18n/en/i18n.json @@ -2,5 +2,78 @@ "en":"Engish", "zh":"中文", "jp":"日本语", - "ko":"韩语" + "ko":"韩语", + "启用日期": "Enabled date", + "失效日期": "Expired date", + "大语言模型": "LLMS", + "体验": "Experience", + "3D生成": "3D generate", + "AI搜索": "AI search", + "图像理解": "Visual understanding", + "密码": "Password", + "数字人": "Digital human", + "文图生视频": "Text image to video", + "文本分类": "Text classification", + "文生图": "Text to graghic", + "文生文": "Text to Text", + "文生语音": "Text to Speech", + "语言翻译": "Language transation", + "语音识别": "Audio Speech Recognize", + "音乐生成": "Music generate", + "充值": "Recharge", + "地址": "Address", + "帐务": "Accounting", + "平台运营": "Platform Business", + "我": "Me", + "我的角色": "My roles", + "手机": "Cell Phone", + "用户": "User", + "用户名": "User name", + "用户状态": "User Status", + "用户角色": "User roles", + "签退": "Logout", + "邮件地址": "Mail address", + "重置密码": "Reset password", + "主页": "home", + "模型广场": "llms", + "私有知识库": "my rags", + "关于我们": "About us", + "用户功能": "User functions", + "© 2024 版权所有, 开元云(北京)科技有限公司": "©2024 Open Computing AI", + "上位系统": "Up Application", + "下位系统": "Down Application", + "下位系统apikey": "Down App key", + "下位系统接口": "Down API", + "产品管理": "Product Mgr", + "供应协议": "Supply Agreement", + "供应商模型列表": "Llms by Supplier", + "元境平台": "YuanJing Platform", + "分销协议": "Distribution Agreement", + "套餐管理": "Package Mgr", + "套餐选择": "Package Options", + "定价管理": "Pricing Mgr", + "定价类型": "Pricing type", + "定价项目": "Pricing program", + "我的知识库": "My Rags", + "接口输入输出": "API input", + "接口集": "API set", + "服务目录": "Service catelog", + "服务管理": "Service Mgr", + "服务选择": "Service Options", + "服务配置": "Service Config", + "模型": "LLM maintain", + "模型列表": "LLM list", + "模型用量": "Llm Usage", + "模型管理": "LLm Mgr", + "模型类型": "Llm type", + "添加供应商": "Add supplier", + "爬取配置": "Crawle config", + "用户管理": "User Mgr", + "知识库加持大模型": "Rags based LLM", + "知识库管理": "Rags Mgr", + "知识获取": "Knowledge acquistion", + "网上知识源": "Knowledge resource on network", + "设备组": "Device group", + "配置": "Configuration", + "进入主菜单": "call main menu" } diff --git a/wwwroot/menu.ui b/wwwroot/menu.ui index ac85b63..40b9b55 100644 --- a/wwwroot/menu.ui +++ b/wwwroot/menu.ui @@ -10,6 +10,11 @@ "label":"主页", "url":"{{entire_url('public')}}" }, + { + "name":"agent", + "label":"智能体", + "url":"{{entire_url('skillagent')}}" + }, { "name":"pricing", "label":"定价管理", diff --git a/wwwroot/public/about/index.ui b/wwwroot/public/about/index.ui index 248f430..9e7882e 100644 --- a/wwwroot/public/about/index.ui +++ b/wwwroot/public/about/index.ui @@ -8,7 +8,7 @@ "widgettype":"MdWidget", "options":{ "width":"100%", - "md_url":"{{entire_url('index.md')}}" + "md_url":"{{entire_url('index_')}}{{params_kw._lang}}.md" } } ] diff --git a/wwwroot/public/about/index_en.md b/wwwroot/public/about/index_en.md new file mode 100644 index 0000000..e73bb31 --- /dev/null +++ b/wwwroot/public/about/index_en.md @@ -0,0 +1,20 @@ +# Who We Are +We are a young company established less than five years ago. Our primary focus is building and serving the computing power ecosystem. Starting from providing a resource trading platform for both supply and demand sides of computing power, we further offer technical services and talent training. Going one step further, we provide a large model service platform, delivering advanced market-leading model products directly to end customers, as well as industry-specific and functional applications built on large models. + +# Our Products +* **High-quality computing products** + 1. Bare-metal servers + 2. Cloud-based computing power + 3. Containerized computing power +* Cloud resources +* Network resources +* Online technical services +* Large model services +* Industry-specific large model applications +* Functional large model applications + +# Contact Us +* **Address:** Room 1015, Fuli Center, Chaoyang District, Beijing +* **Phone:** 4006150805     010-65917875 +* **Email:** open-computing@kaiyuancloud.cn + diff --git a/wwwroot/public/about/index_zh.md b/wwwroot/public/about/index_zh.md new file mode 100644 index 0000000..1236815 --- /dev/null +++ b/wwwroot/public/about/index_zh.md @@ -0,0 +1,19 @@ +# 我们是谁 +我们是一家成立不到5年的年轻的公司,主营方向是算力生态的建设与服务,从为算力供需双方提供资源交易平台,再到为算力供需双方提供技术服务,人才培训等服务,再近一步提供大模型服务平台,直接为最终客户提供市场上先进的模型产品,以及基于大模型打造的行业应用以及功能行的大模型应用。 + +# 我们的产品 +* 优质的算力产品 +1. 裸金属服务器 +2. 云化算力 +3. 容器化算力 +* 云资源 +* 网络资源 +* 在线技术服务 +* 大模型服务 +* 行业大模型应用 +* 功能性大模型应用 + +# 联系我们 +* 地址:北京市朝阳区富力中心1015室 +* 电话:4006150805 010-65917875 +* 邮箱:open-computing@kaiyuancloud.cn diff --git a/wwwroot/public/index.ui b/wwwroot/public/index.ui index 1616fef..91d8f97 100644 --- a/wwwroot/public/index.ui +++ b/wwwroot/public/index.ui @@ -29,6 +29,17 @@ } } }, + { + "name":"agent", + "label":"智能体", + "refresh":true, + "content":{ + "widgettype":"urlwidget", + "options":{ + "url":"{{entire_url('/skillagent')}}" + } + } + }, { "name":"rag", "label":"私有知识库", @@ -40,6 +51,7 @@ } } }, + { "name":"about", "label":"关于我们",