Update app.py
Browse files
app.py
CHANGED
|
@@ -906,37 +906,40 @@ with gr.Blocks(title="Dashboard Narrator - Powered by OpenRouter.ai", theme=gr.t
|
|
| 906 |
- Support for PNG and JPG image analysis
|
| 907 |
- Enhanced with Claude Sonnet 4 and Gemini 2.5 Flash models
|
| 908 |
- Multi-format dashboard analysis capabilities
|
| 909 |
-
- Improved file download functionality
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 910 |
""")
|
| 911 |
with gr.Row():
|
| 912 |
with gr.Column(scale=1):
|
| 913 |
api_key = gr.Textbox(
|
| 914 |
-
label="OpenRouter API Key",
|
| 915 |
placeholder="Enter your OpenRouter API key...",
|
| 916 |
-
type="password"
|
| 917 |
-
info="Required - Get your API key from OpenRouter.ai"
|
| 918 |
)
|
| 919 |
refresh_btn = gr.Button("🔄 Refresh Available Models", size="sm")
|
| 920 |
|
| 921 |
model_choice = gr.Dropdown(
|
| 922 |
choices=["custom"] + OPENROUTER_MODELS,
|
| 923 |
value=DEFAULT_MODEL,
|
| 924 |
-
label="Select Model"
|
| 925 |
-
info="Choose an AI model for analysis"
|
| 926 |
)
|
| 927 |
|
| 928 |
custom_model = gr.Textbox(
|
| 929 |
label="Custom Model ID",
|
| 930 |
placeholder="Enter custom model ID (e.g., anthropic/claude-3-opus:latest)...",
|
| 931 |
-
visible=False
|
| 932 |
-
info="Only shown when 'custom' is selected above"
|
| 933 |
)
|
| 934 |
|
| 935 |
language = gr.Dropdown(
|
| 936 |
choices=["Italiano", "English", "Français", "Español", "Deutsch"],
|
| 937 |
value="English",
|
| 938 |
-
label="Report Language"
|
| 939 |
-
info="Language for the generated reports"
|
| 940 |
)
|
| 941 |
|
| 942 |
num_sections = gr.Slider(
|
|
@@ -944,21 +947,18 @@ with gr.Blocks(title="Dashboard Narrator - Powered by OpenRouter.ai", theme=gr.t
|
|
| 944 |
maximum=10,
|
| 945 |
value=4,
|
| 946 |
step=1,
|
| 947 |
-
label="
|
| 948 |
-
info="How many sections to divide each dashboard into for analysis"
|
| 949 |
)
|
| 950 |
|
| 951 |
goal = gr.Textbox(
|
| 952 |
-
label="Analysis Goal (
|
| 953 |
-
placeholder="E.g., Analyze Q1 2024 sales KPIs..."
|
| 954 |
-
info="Specify what you want to focus on in the analysis"
|
| 955 |
)
|
| 956 |
|
| 957 |
files = gr.File(
|
| 958 |
label="Upload Dashboards (PDF, PNG, JPG)",
|
| 959 |
file_types=[".pdf", ".png", ".jpg", ".jpeg"],
|
| 960 |
-
file_count="multiple"
|
| 961 |
-
info="Upload one or more dashboard files for analysis"
|
| 962 |
)
|
| 963 |
|
| 964 |
analyze_btn = gr.Button("🔍 Analyze Dashboards", variant="primary", size="lg")
|
|
@@ -969,14 +969,12 @@ with gr.Blocks(title="Dashboard Narrator - Powered by OpenRouter.ai", theme=gr.t
|
|
| 969 |
with gr.Tab("Download Files"):
|
| 970 |
output_files = gr.File(
|
| 971 |
label="Download Generated Reports",
|
| 972 |
-
file_count="multiple"
|
| 973 |
-
info="Generated markdown and PDF files will appear here after analysis"
|
| 974 |
)
|
| 975 |
output_status = gr.Textbox(
|
| 976 |
-
label="Status",
|
| 977 |
placeholder="Upload dashboards and press Analyze to begin...",
|
| 978 |
-
interactive=False
|
| 979 |
-
info="Analysis progress and status updates"
|
| 980 |
)
|
| 981 |
|
| 982 |
# Handle model dropdown change
|
|
|
|
| 906 |
- Support for PNG and JPG image analysis
|
| 907 |
- Enhanced with Claude Sonnet 4 and Gemini 2.5 Flash models
|
| 908 |
- Multi-format dashboard analysis capabilities
|
| 909 |
+
- Improved file download functionality<br><br>
|
| 910 |
+
**Instructions:**
|
| 911 |
+
1. Enter your OpenRouter API key (get one at OpenRouter.ai)
|
| 912 |
+
2. Choose an AI model for analysis
|
| 913 |
+
3. Select your preferred report language
|
| 914 |
+
4. Upload one or more dashboard files (PDF, PNG, JPG)
|
| 915 |
+
5. Optionally specify analysis goals
|
| 916 |
+
6. Click "Analyze Dashboards" to begin
|
| 917 |
""")
|
| 918 |
with gr.Row():
|
| 919 |
with gr.Column(scale=1):
|
| 920 |
api_key = gr.Textbox(
|
| 921 |
+
label="OpenRouter API Key (Required)",
|
| 922 |
placeholder="Enter your OpenRouter API key...",
|
| 923 |
+
type="password"
|
|
|
|
| 924 |
)
|
| 925 |
refresh_btn = gr.Button("🔄 Refresh Available Models", size="sm")
|
| 926 |
|
| 927 |
model_choice = gr.Dropdown(
|
| 928 |
choices=["custom"] + OPENROUTER_MODELS,
|
| 929 |
value=DEFAULT_MODEL,
|
| 930 |
+
label="Select AI Model"
|
|
|
|
| 931 |
)
|
| 932 |
|
| 933 |
custom_model = gr.Textbox(
|
| 934 |
label="Custom Model ID",
|
| 935 |
placeholder="Enter custom model ID (e.g., anthropic/claude-3-opus:latest)...",
|
| 936 |
+
visible=False
|
|
|
|
| 937 |
)
|
| 938 |
|
| 939 |
language = gr.Dropdown(
|
| 940 |
choices=["Italiano", "English", "Français", "Español", "Deutsch"],
|
| 941 |
value="English",
|
| 942 |
+
label="Report Language"
|
|
|
|
| 943 |
)
|
| 944 |
|
| 945 |
num_sections = gr.Slider(
|
|
|
|
| 947 |
maximum=10,
|
| 948 |
value=4,
|
| 949 |
step=1,
|
| 950 |
+
label="Vertical Sections per Dashboard"
|
|
|
|
| 951 |
)
|
| 952 |
|
| 953 |
goal = gr.Textbox(
|
| 954 |
+
label="Analysis Goal (Optional)",
|
| 955 |
+
placeholder="E.g., Analyze Q1 2024 sales KPIs..."
|
|
|
|
| 956 |
)
|
| 957 |
|
| 958 |
files = gr.File(
|
| 959 |
label="Upload Dashboards (PDF, PNG, JPG)",
|
| 960 |
file_types=[".pdf", ".png", ".jpg", ".jpeg"],
|
| 961 |
+
file_count="multiple"
|
|
|
|
| 962 |
)
|
| 963 |
|
| 964 |
analyze_btn = gr.Button("🔍 Analyze Dashboards", variant="primary", size="lg")
|
|
|
|
| 969 |
with gr.Tab("Download Files"):
|
| 970 |
output_files = gr.File(
|
| 971 |
label="Download Generated Reports",
|
| 972 |
+
file_count="multiple"
|
|
|
|
| 973 |
)
|
| 974 |
output_status = gr.Textbox(
|
| 975 |
+
label="Status & Progress",
|
| 976 |
placeholder="Upload dashboards and press Analyze to begin...",
|
| 977 |
+
interactive=False
|
|
|
|
| 978 |
)
|
| 979 |
|
| 980 |
# Handle model dropdown change
|