LiamKhoaLe commited on
Commit
c67b4e7
·
1 Parent(s): 52b4ed7
Files changed (4) hide show
  1. .gitignore +2 -1
  2. app.py +3 -2
  3. mcp.py +6 -0
  4. reasoning.py +1 -1
.gitignore CHANGED
@@ -1,2 +1,3 @@
1
  .env
2
- .setup.txt
 
 
1
  .env
2
+ .setup.txt
3
+ __pycache__/
app.py CHANGED
@@ -27,9 +27,10 @@ if __name__ == "__main__":
27
 
28
  # Check Gemini MCP availability
29
  if MCP_AVAILABLE:
30
- logger.info("Gemini MCP is available for translation, summarization, document parsing, and transcription")
31
  else:
32
- logger.warning("Gemini MCP not available - translation, summarization, document parsing, and transcription features will be limited")
 
33
 
34
  logger.info("Model preloading complete!")
35
  demo = create_demo()
 
27
 
28
  # Check Gemini MCP availability
29
  if MCP_AVAILABLE:
30
+ logger.info("Gemini MCP is available for translation, summarization, document parsing, and transcription")
31
  else:
32
+ logger.info("ℹ️ Gemini MCP not available - app will use fallback methods (direct API calls)")
33
+ logger.info(" This is normal and the app will continue to work. MCP is optional.")
34
 
35
  logger.info("Model preloading complete!")
36
  demo = create_demo()
mcp.py CHANGED
@@ -23,6 +23,12 @@ try:
23
  )
24
  except ImportError as e:
25
  logger.warning(f"MCP SDK not available: {e}")
 
 
 
 
 
 
26
  MCP_AVAILABLE = False
27
  MCP_CLIENT_INFO = None
28
 
 
23
  )
24
  except ImportError as e:
25
  logger.warning(f"MCP SDK not available: {e}")
26
+ logger.info("The app will continue to work with fallback functionality (direct API calls)")
27
+ MCP_AVAILABLE = False
28
+ MCP_CLIENT_INFO = None
29
+ except Exception as e:
30
+ logger.error(f"Unexpected error initializing MCP: {e}")
31
+ logger.info("The app will continue to work with fallback functionality")
32
  MCP_AVAILABLE = False
33
  MCP_CLIENT_INFO = None
34
 
reasoning.py CHANGED
@@ -65,7 +65,7 @@ Respond in JSON format:
65
  def autonomous_reasoning(query: str, history: list) -> dict:
66
  """Autonomous reasoning: Analyze query complexity, intent, and information needs"""
67
  if not MCP_AVAILABLE:
68
- logger.warning("⚠️ Gemini MCP not available for reasoning, using fallback")
69
  return {
70
  "query_type": "general_info",
71
  "complexity": "moderate",
 
65
  def autonomous_reasoning(query: str, history: list) -> dict:
66
  """Autonomous reasoning: Analyze query complexity, intent, and information needs"""
67
  if not MCP_AVAILABLE:
68
+ logger.info("ℹ️ Gemini MCP not available for reasoning, using fallback (app will continue to work normally)")
69
  return {
70
  "query_type": "general_info",
71
  "complexity": "moderate",