""" DemandScape Suite โ€” Unified Gradio App ======================================= Four products, one app, one API key: ๐Ÿ“Š DemandScape โ€” Probabilistic demand forecasting across scenarios ๐Ÿค PartnerScape โ€” Partner win-rate, bookings & effectiveness prediction ๐ŸŽฏ DealScape โ€” Opportunity win-rate, pipeline health & SHAP explainability ๐Ÿ›ก๏ธ ObjectionScape โ€” Objection classification, severity & deal-outcome prediction All inference is routed through the fly.dev orchestrator (FLYIO_ENDPOINT env var). A single DemandScape Suite API key authenticates every product โ€” no HuggingFace token needed in the front-end. """ import os import gradio as gr # โ”€โ”€ Product modules โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ import demandscape import dealscape import objectionscape import partnerscape # --------------------------------------------------------------------------- # Configuration # --------------------------------------------------------------------------- FLYIO_ENDPOINT = os.getenv( "FLYIO_ENDPOINT", "https://demandscape-orchestrator.fly.dev/v1/infer", ) # --------------------------------------------------------------------------- # Custom CSS (shared across all tabs) # --------------------------------------------------------------------------- custom_css = """ /* โ”€โ”€ Suite header โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ .suite-title { text-align: center; font-size: 42px; font-weight: bold; color: #1f77b4; margin-bottom: 6px; } .suite-subtitle { text-align: center; font-size: 20px; color: #555; margin-bottom: 22px; } /* โ”€โ”€ API-key notice banner โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ .api-key-notice { background: linear-gradient(135deg, #fff3cd, #ffeaa7); border: 2px solid #f39c12; border-radius: 10px; padding: 16px 22px; margin: 12px 0 16px 0; font-size: 15px; text-align: center; } /* โ”€โ”€ Table header wrapping fix โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ */ table thead th { white-space: normal !important; height: auto !important; min-height: 50px !important; vertical-align: middle !important; padding: 8px !important; line-height: 1.4 !important; } table td { white-space: nowrap !important; padding: 8px !important; } """ # --------------------------------------------------------------------------- # Build the unified app # --------------------------------------------------------------------------- with gr.Blocks(title="DemandScape Suite", css=custom_css) as demo: # โ”€โ”€ Suite header โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ with gr.Row(): with gr.Column(scale=1): gr.Markdown("### Consultant: Diskover Analytics") gr.Image("Diskover Analytics.png", label="", show_label=False, height=100) with gr.Column(scale=2): gr.HTML('
DemandScape Suite
') gr.HTML( '
' "Demand ยท Partners ยท Deals ยท Objections โ€” one platform, one key." "
" ) with gr.Column(scale=1): gr.Markdown("### Client: CancerSoft") gr.Image("CancerSoft Logo.png", label="", show_label=False, height=100) gr.Markdown("---") # โ”€โ”€ API-key notice โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ gr.HTML( '
' "๐Ÿ”‘ Demo Access โ€” API Key Required
" "Request your free demo key by emailing " '' "info@diskoverdiagnostics.com" "
" ) # โ”€โ”€ Shared API key โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ with gr.Row(): api_key_input = gr.Textbox( label="๐Ÿ”‘ DemandScape Suite API Key", placeholder="ds_partner_xxxxxxxxx โ€” used by all four products", type="password", scale=3, ) gr.Markdown("---") # โ”€โ”€ Product tabs โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ with gr.Tabs(): with gr.Tab("๐Ÿ“Š DemandScape"): demandscape.build_tab(api_key_input, FLYIO_ENDPOINT) with gr.Tab("๐Ÿค PartnerScape"): partnerscape.build_tab(api_key_input, FLYIO_ENDPOINT) with gr.Tab("๐ŸŽฏ DealScape"): dealscape.build_tab(api_key_input, FLYIO_ENDPOINT) with gr.Tab("๐Ÿ›ก๏ธ ObjectionScape"): objectionscape.build_tab(api_key_input, FLYIO_ENDPOINT) # โ”€โ”€ Footer โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ gr.Markdown( """ --- ### ๐Ÿ” About DemandScape Suite | Product | What it does | |---|---| | ๐Ÿ“Š **DemandScape** | Probabilistic demand forecasts across price, promo, supply & competitor scenarios | | ๐Ÿค **PartnerScape** | Partner win-rate, bookings value & effectiveness score prediction | | ๐ŸŽฏ **DealScape** | Opportunity win-rate, expected bookings, pipeline health & SHAP explainability | | ๐Ÿ›ก๏ธ **ObjectionScape** | Objection classification, severity scoring, time-to-close & win/loss prediction | All products route through the **DemandScape Orchestrator** (`demandscape-orchestrator.fly.dev`) and are authenticated with a single Partner API Key. ๐Ÿ“ง Support: [info@diskoverdiagnostics.com](mailto:info@diskoverdiagnostics.com) """ ) # --------------------------------------------------------------------------- if __name__ == "__main__": demo.launch(share=False)