From b807c1efba00e65c5328a7921ad80be26aba1e7e Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 3 Aug 2024 17:27:14 +0800 Subject: [PATCH] bugfix --- app/README.md | 0 app/__pycache__/asyncproxy.cpython-310.pyc | Bin 0 -> 1573 bytes app/__pycache__/const.cpython-310.pyc | Bin 0 -> 135 bytes app/__pycache__/ext.cpython-310.pyc | Bin 0 -> 9175 bytes app/__pycache__/llm_client.cpython-310.pyc | Bin 0 -> 8513 bytes app/__pycache__/rf.cpython-310.pyc | Bin 0 -> 2343 bytes app/__pycache__/streamproxy.cpython-310.pyc | Bin 0 -> 7284 bytes app/__pycache__/syncproxy.cpython-310.pyc | Bin 0 -> 2006 bytes app/asr.py | 34 +++++++ app/asr_engine.py | 31 +++++++ app/sensevoice/__init__.py | 0 app/sensevoice/load_model.py | 22 +++++ app/whisper/__init__.py | 0 app/whisper/generate.dspy | 4 + app/whisper/load_model.py | 45 +++++++++ app/whisper/requirements.txt | 2 + conf/config.json | 86 ++++++++++++++++++ plugins/README.md | 15 +++ plugins/__pycache__/auth.cpython-310.pyc | Bin 0 -> 467 bytes plugins/__pycache__/plugin.cpython-310.pyc | Bin 0 -> 2543 bytes .../__pycache__/wechat_agent.cpython-310.pyc | Bin 0 -> 551 bytes plugins/auth.py | 9 ++ plugins/plugin.py | 56 ++++++++++++ plugins/wechat_agent.py | 11 +++ requirements.txt | 2 + 25 files changed, 317 insertions(+) create mode 100644 app/README.md create mode 100644 app/__pycache__/asyncproxy.cpython-310.pyc create mode 100644 app/__pycache__/const.cpython-310.pyc create mode 100644 app/__pycache__/ext.cpython-310.pyc create mode 100644 app/__pycache__/llm_client.cpython-310.pyc create mode 100644 app/__pycache__/rf.cpython-310.pyc create mode 100644 app/__pycache__/streamproxy.cpython-310.pyc create mode 100644 app/__pycache__/syncproxy.cpython-310.pyc create mode 100644 app/asr.py create mode 100644 app/asr_engine.py create mode 100644 app/sensevoice/__init__.py create mode 100644 app/sensevoice/load_model.py create mode 100644 app/whisper/__init__.py create mode 100644 app/whisper/generate.dspy create mode 100644 app/whisper/load_model.py create mode 100644 app/whisper/requirements.txt create mode 100755 conf/config.json create mode 100644 plugins/README.md create mode 100644 plugins/__pycache__/auth.cpython-310.pyc create mode 100644 plugins/__pycache__/plugin.cpython-310.pyc create mode 100644 plugins/__pycache__/wechat_agent.cpython-310.pyc create mode 100644 plugins/auth.py create mode 100644 plugins/plugin.py create mode 100644 plugins/wechat_agent.py create mode 100644 requirements.txt diff --git a/app/README.md b/app/README.md new file mode 100644 index 0000000..e69de29 diff --git a/app/__pycache__/asyncproxy.cpython-310.pyc b/app/__pycache__/asyncproxy.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c7e6666a10f02859dbd18c106e264f11da1dab13 GIT binary patch literal 1573 zcmZuxOK%%D5GMDn)vn}+>Nb7Bmj*CkM3+7;agm@kng)eqL_rS*g2h&(qm}n%a<{Pr zF3{HQu|J?N0!YXHjvo6Dcq@A9t!D!TI^XaNwZ^C zT+GHwy*>;O9>C-SAQYWog1`hO#uYj-i3z4G89wB*eEiyk3CPvh2Br)1cbNPJBlIH{ zXo{wIVJy+t;O8SGP-F^YYBh@5ja4}dcd4`P;VFNA{_Ou6onA33DXUFj0P;{}mZa)Wmi!E5&UY!Yh z2EtyvMXV*}@nZy*m1GlVX*5oP8duA1f|kaY=y}k1!h>~hiG{1V&Jy28=LH};8tK1A z`oh0Ob~M)_uK?NA$nO6jyKBf_H46M{0`PiAbcF#vg_?IY57C0YqxpXIcC%5vbBUVG z>JAA+aBYxKI6!+M1lkvUpc|rhZM^a?p>D+H^j#4MM{I~t^b>Suus;dPt?IqS`=Sr= z^~mNgPMeuV-I-5}Gn3uGnI9-=b%S6D@(6{pb@WW4d9a%o)h?l@NluA0YnDnUqt&D! z(mH-JdM4cojR|F3+TX`%O{JB`8Bh{ev2@Cq#TlPluDi7*3yBhQAT-LANNKes7AzV_lDqpz+nln0MsugJWr3qT;sfg2LPG$J?aCH3S zXml7o9z8jd{-dfYzep3BSJEz70za40^P2KXT2l^Q*rd)%F1s&TQqf3zv$riRPSaC% zSDm77YD;nIElW(8qXczr5>Fs^Go2Y+N-vwWNnp^QkaTZTBE3}}q^(oKLbYs6;5O8C zY29y#eFEB>-60vyvh!g%8}j%C9mZujj8%7m^jysDl{2swjpH^2H1hm z$6MILmgagOIUw~wH!yle0QwEQ^9J>Cpg*0`|YuxLrZNf1!!RW2kA|z4*&oF literal 0 HcmV?d00001 diff --git a/app/__pycache__/const.cpython-310.pyc b/app/__pycache__/const.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a7e7c96fed617d2b5f4aa2066cd6a179e1ce189d GIT binary patch literal 135 zcmd1j<>g`kf)9?ZX?#HXF^Gc<7=auIATH(r5-AK(3@MDk44O>0Sc((VQ~fjX_8fQ9j}YSpdf(lbKjC!URDa16Ecb2>cr$zd`*5GQywyI6?ryB699~)vF}O z=|R1E%YFM@&b>9=LLsZ*clDjOH~LR1%70K{`e&fY;(XY1K^uAUQRJIJ>S^@7MdL9xA1Uuc)=rS@Wd zv0bj0+Xw0g+Dr8%(VhtowwLS6BA*QowO8sZBA*Kmw~y41hIPP0Sa$$jjT^4^iR6t;3-o2xnep_(J38g_y`!JfRU*3Yn$>=-+aT-7r$_F3)mQn;hM)^_xP30>nP+t>j&PosLLCh z9*Xwri?4LML0Hw2LbK0T8xb1OcQeUHe%lM9M!OeA9F*BrzZw1Nddq7@RVy+4&PF#e znYZ5GOziCj?@%ApBkkPLunQ-)saJ!QAwsmsXKk{B>{B4oT_NjuBU%`S_sb}<0*BO zDRu2lWkY2u)9yNTo$1WLO&QE&7T)HYilNjkoS>cLUw-+j`@$u;;yP*o*XW5v~&a!q-lu2uEK4EsHgCywj-9Y1p2L~r|k)kuuc z3pV&+jFA`(z8NOkjqL}xDA#QUjWBfG2g>`0&$IJ8?VIO&JLf~()%ixRciy`d)p|R8 z1s%(@3R+HC&8mZg)2ptHrfWj%#y`r_b}r)y^GIT)rGO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GRRbr={!iAp;^ zRFxqwGmaJ0yDc`3-at%mn&t32PK{O~oH=g*p z%g;475T==_Tm6W-S7qIM7Djvb&3}0K2Y>V)v69Tb`-k6qNV}Y|1hhqR{4V493E@8x zMiC)5=r$GT!eZ7v`kra8C8h`+CtAcGk{|StOvnQZ;b90e1kWb-1U_71HMe~hZ6$Vd z%kww4B4AlRf)ixp^EZX49%xAx6i_9EdK0@VzHEo$_z-9OK8EFgL&;xJGAD-itG-yq z2Wb0=Fu@2lP2x<(`_?1=4%);a{P>;U`SG2k0OwuI(GeM~Hq%diM<0&PEZl6<#PDBZK zfpP>au-x%9{f-a){L-rQn~zKyc>4be8~sj`!k)ZDJxzowVYNsClbkePQXkVjlO%SU zvP?E0$u=exOQ_(&j0hW4r6Q?TDOeicAX6s)MM7|gxDoy*L^0tnk*lCCaW25#;Oq7! u+@KPY8%@wk{*~~qr1`u?btSEsQ@-jv>m0K((tXCi5NO$gRUqd#tNt&6#^lEU literal 0 HcmV?d00001 diff --git a/app/__pycache__/llm_client.cpython-310.pyc b/app/__pycache__/llm_client.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5dd2ca4a19e2314567b3ed619c5779efb1e4e181 GIT binary patch literal 8513 zcmeHMOOG7ab*@{luC9L0gF}&ecqB`TI-togmYGD-D3nRslHm*)4I$cXE0vzE8csL+ z#alI`rd@4Q8VX({asqpkKo-ygWWxXfvdJphIlm!`y9)vYP*w??)xehXeYd)&r-xLm z0Lmgjs!^xzH}L%XYwvGut{TR_Fmv>=k-3OB{#%gH2t~)JXJ1hl zI&aoZe9ey4wd=NEoz-!=Zr#;syOZmBbx)_APQL5c{cfRN=oah6ZmC}Cmh0tirC!nX zZl~H^s4pO$3%&bBeevr?m=FE?M(FRE^(EvAVG+4vw6tf{mys`pW#r2`e**bRmIwEV zP;3~r>c^P1v0f7@Kaj0n5=8Gbk+JSZoA~&bTg~L^W;<#oHCOqsC&}Parxo=QReJNv z#K8&`tsSH5-qNcI~WSJzeXu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M*-@U%Ng4oUkltdL&=p-CH{)2NQ>co|be*0NNT()pW)XAyqx zz*oVT9FI9q#Z6e?1xjn+bh?@{atk`IqO>j}63C?si7q9&H0bgHB%+ee?1Ijml4L+} z+Y}BPiVNANKq*?54wJVLJ%KvaK@d9RkyobvC(u8U|ChCDqN$63@_YP#2{e$0XbapM zLxVt|JBQ&n7<%S*(73MaMH)xKRD=bYKsCsY3c?RCoSz1vBU{H6yl9GoDFe^M1`I?C z!kp$az0ikRtZ8vnrqnW=;MQmxSbs?zUgn*{%UocXs<7xN3Rk)`rCfRc%`#QS;9@p9 vany$1!JOB-Hptkh&p*|F2XbxqEDvsm@~vP8*HGmR4_99ENaehT>kIz^Cq6cj literal 0 HcmV?d00001 diff --git a/app/__pycache__/streamproxy.cpython-310.pyc b/app/__pycache__/streamproxy.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bac737b3c5bc687f107777d18ed3dc032629c797 GIT binary patch literal 7284 zcma)BNs}DMb*{`>x_X_S1sGt!WeAcGn}z|wk|-O-(Bd+bNRa~s1`)7YluJFG)id3w zUXWD{U|Q7@prOJMj*ulCX)14ex+IISDV#-ty$~OHRt;EW}Vx;XuiMD zT;O~mTI?@1m-?rgr~0Rxr~Avz<^GxGnf}@4S#I~EmHxTrIpm9~^pVwk=9`u(tI9`~ zs_e<;vr24Qjp}DuyS32}ra02wK@x-y+9=rf!!3MDZ+F|t^{rmmP8yymeJe>uZ$;g3 zkeKSt_01dCH#XOUTkHRL>qzmv&FdSc@}%|6cQ=kSzVq(;>t^mru-F3dCG6- z?f9+X;9jU{qQd=_9&`uW#_0|^L*s^854CYsxHaB3ep`2wZo3tkBGwv?lJ0PTA?i27 z?QWce`knEhO?7QSJIf!5uaEaFyz!ez5-Y`l?a7}lOhqDQG8Hp>-`W>5N6CG0+mbjW z2fsaASew=rD_*%Tghjva;8mz=*c(Rbt3WQwpwxc+E-0+>$R_j zgZ5B`#?fI*8Bc{&YDgnH10y=0TKX9*5ugA z!S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2!Tw%%H#*$?;&5U5S$BU=2iMe( z@9ixRKe=~*S1(-?yN3^VZ#~d8+;>-qp#Zi1ounuCkNUhPJC1hGV=+huC)!E|$3ty% zx?@t`+%xQ7Qb|JGnohxR+P;u}iH_f(NSDJ^9w5)mBtsaS{JK)f^+y`uNv$nFwK zlyzyL#w(+=fo3aXPW#F%ozg8m>6A6;UXaq49y68IuRS-IrEEZ3xqy!H0A1xgH-7Rj zC?%86rGM#Pk+QD*ejO#0t!m0uo^qJ?gH!1)0~xTI3P8$0shLbeHdJsy%K)rts^E&2 zO}TX0g0`%@E2^5z{}F5~my~(AqL${?mMzs#^&7+@<#M?Kv{mr84ZhVuW?8MM)|EBW zyQ)@Um*6H*%}1mQ5^`<)D`m8!nSD0koZq1d_@G7qumm zjEfsc3lOk+=m2y+=0ZkjleYTBZ~$2_%JKrOidmss=a39MO4BT2Neq_ipjtWR9A~wu zlT*Rk?mSzx2|??uX{+GraitS)x;8U*q$v|CIPvBY)$T0f+MUH)w2{F$?P;%&F_;(2 znWAZgYsbkTDIg$HTT{bL`9$gf%!!VZln>&J&)CstU7xW}1Mmv&O!+TFd<3JvUf*I{ zeWUQW{l7 z$lViihkRWxp&ncs%IuqvDcD;#$(g4Ns5*47V~f{7N_+sITX0>fTXHmxzU5;$-^Xz} z;@ZM!bu6)U%}V>4ifMEz*g?uW0PjO9JOB&)YJ=yKm;d9%;#~sm7&_cMinJd^*^rG= z90yT!Hj2}VB5ut$Ur>k#BX$s$0Z?H94;&02#&1s7I_u(Xq`wQG>u}fLL7ASIzyRtt zoZ`XgC{22sr|<;yrccW>BLoJtN)X&qxCp30;PEaBvg_xf%9O^xd%`^vShTA=YT&4e iu!PV;K)e6XA?@9);_xAqdQza&)GPWH+>Jv?U9?iHz;U*K`&ZkP0HDX2UxcTOX2XKBW+>; literal 0 HcmV?d00001 diff --git a/plugins/__pycache__/plugin.cpython-310.pyc b/plugins/__pycache__/plugin.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000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XkpCQ-G_^-Z&Zg;oCjBD$I!pftv_RiD literal 0 HcmV?d00001 diff --git a/plugins/__pycache__/wechat_agent.cpython-310.pyc b/plugins/__pycache__/wechat_agent.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5e1b7f884ca4e0a0bfd4e35296992102b8c5028a GIT binary patch literal 551 zcmZ8f&2GXl3{KKg(gG8jc!o*6&=;7dX+PR&3~9GsP}+o2NNGt62#MQv-COL!3+!QX z-D$6|%jT4gp*gbs*^R&0R`X8BLm>BWuj3pe^lpMs6*ge%7$X?q*Xj&m2T8`l>@mQQY~{gbE}nowC97K#b>zElUG-%>6(-DO2FTt+gD`|DiIgi>Z0 z-TO=P!#b4p?~|EezngvIr)*LRwGyhI{O(Daz0@yioYXTMnYQ7h=UL8|Qe40ffXXfy NirRR8C~+(ge*=H|hDiVb literal 0 HcmV?d00001 diff --git a/plugins/auth.py b/plugins/auth.py new file mode 100644 index 0000000..8fbdebe --- /dev/null +++ b/plugins/auth.py @@ -0,0 +1,9 @@ +from appPublic.log import info +from ahserver.auth_api import AuthAPI +from sqlor.dbpools import DBPools + +async def checkUserPermission(self, user, path): + info(f'checkUserPermission():{user} access to {path} ..') + return True + +AuthAPI.checkUserPermission = checkUserPermission diff --git a/plugins/plugin.py b/plugins/plugin.py new file mode 100644 index 0000000..ff7b9c1 --- /dev/null +++ b/plugins/plugin.py @@ -0,0 +1,56 @@ +import sys +from ahserver.serverenv import ServerEnv +from appPublic.dictObject import DictObject +import time +import jwt + +def generate_zhipuai_token(apikey: str, exp_seconds: int=86400): + try: + id, secret = apikey.split(".") + except Exception as e: + raise Exception("invalid apikey", e) + + payload = { + "api_key": id, + "exp": int(round(time.time() * 1000)) + exp_seconds * 1000, + "timestamp": int(round(time.time() * 1000)), + } + + return jwt.encode( + payload, + secret, + algorithm="HS256", + headers={"alg": "HS256", "sign_type": "SIGN"}, + ) + +async def get_llm_user_apikey(apiname, user): + if apiname == 'qianwen': + return DictObject(apikey='sk-ca5dfeb58d494f32a9cf1e9f064370c8') + + if apiname=='baiduqianfan': + return DictObject(apikey='SjAN4GHU07LuB8ZYOIstB31G', + secretkey='QbakADoGJsM2qjUzIogTkBZruToxYAve') + if apiname=='baichuanai': + return DictObject(apikey='sk-f1fca6335df32d13c096e5f2e72821db') + if apiname=='deepseek': + return DictObject(apikey='sk-a6a2d5eca1b7419b95f2c263c362be1e') + + if apiname == 'minimax': + return DictObject(apikey='eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJHcm91cE5hbWUiOiJtb3FpbmcgeXUiLCJVc2VyTmFtZSI6Im1vcWluZyB5dSIsIkFjY291bnQiOiIiLCJTdWJqZWN0SUQiOiIxNzY4NTM3NjQ1ODMyNDg3NjAyIiwiUGhvbmUiOiIxMzgwMTAxNTI5MiIsIkdyb3VwSUQiOiIxNzY4NTM3NjQ1ODI4MjkyOTMwIiwiUGFnZU5hbWUiOiIiLCJNYWlsIjoiIiwiQ3JlYXRlVGltZSI6IjIwMjQtMDQtMTAgMTg6MDA6NTMiLCJpc3MiOiJtaW5pbWF4In0.VaRRHr9XMUSYhZOKVS2PRZv6Y9VCaW4JX2ks4QZX3aFr_emjnDbGv5HfNskf54piflEAeTMW4Qw1nG7bqhYea7N5LKHGf0YpesPGSoqxwyZUR4oaJNNVUsSe6eiLbdYSDO2wMb_hV5xyawh-lYe1reBKWaPVuOjfTrDhxzA0IBmzl-jAQhL8-kIZet2uX-p3NjxElpo_zjmVV_hA1BJEvTwuAk8ka-1SBZmXciMhBi1fJG4jcqoHCCN_JHJ7pgjKr5bk2Zw5qCqiU2Ecsc-kPIEK1SI5EYoLszT43UpJ8_wV4Pm07UBCn3vktAa0fjKDSUArPkBoYWSkgKDMWlmxig', groupid='1768537645828292930') + if apiname == 'zhipuai': + return DictObject(token=generate_zhipuai_token('ffd0affcb6b5f9368f517c09c75a6817.jp9DdpcgwdxXvDiT')) + if apiname == 'moonshot': + return DictObject(apikey='sk-fHOyIKC2mlIDfGwUQV6SwjwVJkjBJgkNWYv82yt3OdpYh592') + if apiname == 'openai': + return DictObject(apikey='sk-proj-gFbYlxVnhmfqf8MXhX42T3BlbkFJprO7jXabkwtjmrNeH77Z') + if apiname == 'doubao': + return DictObject(apikey='a2fddeaa-c31c-4cbe-aacb-732318408dac') + + if apiname == 'tianqi': + return DictObject(apikey='94b72c37e62e49f796502d29955447ab', secretkey='afcac498e0a74302bec06d22dcdff213') + + print(f'{user=} not have apikey for {apiname=}') + return DictObject() + +g = ServerEnv() +g.get_llm_user_apikey = get_llm_user_apikey diff --git a/plugins/wechat_agent.py b/plugins/wechat_agent.py new file mode 100644 index 0000000..7c0be83 --- /dev/null +++ b/plugins/wechat_agent.py @@ -0,0 +1,11 @@ +import itchat +from appPublic.worker import awaitify +from appPublic.dictObject import DictObject +from appPublic.background import Background +from ahserver.globalEnv import GlobalEnv + +def wechat_login(login_callback, qr_callback): + Background(itchat.login, login_callback=login_callback, + qr_callback=qr_callback) +g = GlobalEnv() +g.wechat_login = wechat_login diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..4076923 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +openai-whisper +