File size: 1,579 Bytes
d445f2a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""

Run script for the Web Research Agent with error handling

"""
import os
import sys
import traceback

# Ensure assets directory exists
os.makedirs("assets", exist_ok=True)

try:
    # Try importing gradio first to check version and availability
    import gradio as gr
    print(f"Using Gradio version: {gr.__version__}")
    
    # Then run the main app
    from app import app
    
    # Launch the app with debugging enabled
    app.launch(share=False, debug=True)  # Enable debug mode to see error traces
    
except ImportError as e:
    print("Error: Missing required packages.")
    print(f"Details: {e}")
    print("\nPlease install the required packages:")
    print("pip install -r requirements.txt")
    sys.exit(1)
    
except Exception as e:
    print(f"Error: {e}")
    print("\nTraceback:")
    traceback.print_exc()
    
    # Special handling for common Gradio errors
    if "got an unexpected keyword argument" in str(e):
        print("\nThis appears to be an issue with Gradio version compatibility.")
        print("The app is trying to use features not available in your installed Gradio version.")
        print("\nTry updating Gradio:")
        print("pip install --upgrade gradio")
    elif "CrewOutput" in str(e) or "dict object" in str(e):
        print("\nThis appears to be an issue with CrewAI output format.")
        print("The app is having trouble processing CrewAI outputs.")
        print("\nTry updating CrewAI:")
        print("pip install --upgrade crewai crewai-tools")
    
    sys.exit(1)