measmonysuon commited on
Commit
668c19d
·
verified ·
1 Parent(s): b42abb3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -12
app.py CHANGED
@@ -37,18 +37,10 @@ def handle_update():
37
 
38
  if message_text:
39
  try:
40
- # Forward message to Gradio and get the response
41
- async def forward_message():
42
- async with httpx.AsyncClient(proxies=PROXY_URL) as client:
43
- response = await client.post('http://localhost:7860/gradio', json={'message': message_text})
44
- if response.status_code == 200:
45
- response_text = response.json().get('response', 'Sorry, I cannot process this request.')
46
- else:
47
- response_text = 'Error occurred while processing your request.'
48
- await bot_send_message(chat_id, response_text)
49
-
50
- asyncio.run(forward_message())
51
- logger.info(f"Response sent to chat_id {chat_id}")
52
 
53
  except Exception as e:
54
  logger.error(f"Error during processing: {e}")
 
37
 
38
  if message_text:
39
  try:
40
+ # Send a static response
41
+ static_response = "This is a static response for testing purposes."
42
+ asyncio.run(bot_send_message(chat_id, static_response))
43
+ logger.info(f"Static response sent to chat_id {chat_id}")
 
 
 
 
 
 
 
 
44
 
45
  except Exception as e:
46
  logger.error(f"Error during processing: {e}")