88except :
99 print ("Please ask the agent install python-telegram-bot to use telegram module." )
1010 sys .exit (1 )
11- import mykey
11+ from sidercall import mykeys
1212
1313agent = GeneraticAgent ()
1414agent .verbose = False
15- ALLOWED = set (getattr ( mykey , 'tg_allowed_users' , []))
15+ ALLOWED = set (mykeys . get ( 'tg_allowed_users' , []))
1616
1717_TAG_PATS = [r'<' + t + r'>.*?</' + t + r'>' for t in ('thinking' , 'summary' , 'tool_use' )]
1818_TAG_PATS .append (r'<file_content>.*?</file_content>' )
@@ -124,7 +124,7 @@ async def cmd_llm(update, ctx):
124124 sys .stdout = sys .stderr = _logf
125125 print ('[NEW] New process starting, the above are history infos ...' )
126126 threading .Thread (target = agent .run , daemon = True ).start ()
127- proxy = vars ( mykey ) .get ('proxy' , 'http://127.0.0.1:2082' )
127+ proxy = mykeys .get ('proxy' , 'http://127.0.0.1:2082' )
128128 print ('proxy:' , proxy )
129129
130130 async def _error_handler (update , context : ContextTypes .DEFAULT_TYPE ):
@@ -136,7 +136,7 @@ async def _error_handler(update, context: ContextTypes.DEFAULT_TYPE):
136136 # Recreate request and app objects on each restart to avoid stale connections
137137 request = HTTPXRequest (proxy = proxy , read_timeout = 30 , write_timeout = 30 , connect_timeout = 30 , pool_timeout = 30 )
138138 app = (ApplicationBuilder ()
139- .token (mykey . tg_bot_token )
139+ .token (mykeys [ ' tg_bot_token' ] )
140140 .request (request )
141141 .get_updates_request (request )
142142 .build ())
0 commit comments