import gradio as gr def gradio_analyze(ticker, stock_data, headlines_text): headlines = [h.strip() for h in headlines_text.split('\n') if h.strip()] result = full_stockai_analysis(ticker, '', stock_data, headlines) return result['report'] gr.Interface( fn=gradio_analyze, inputs=[ gr.Textbox(label='Ticker (e.g. NVDA)'), gr.Textbox(label='Stock Data', lines=8), gr.Textbox(label='News Headlines (one per line)', lines=5) ], outputs=gr.Textbox(label='Investment Report', lines=20), title='StockAI — Financial Analyzer' ).launch()