Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def gradio_analyze(ticker, stock_data, headlines_text):
|
| 4 |
+
headlines = [h.strip() for h in headlines_text.split('\n') if h.strip()]
|
| 5 |
+
result = full_stockai_analysis(ticker, '', stock_data, headlines)
|
| 6 |
+
return result['report']
|
| 7 |
+
|
| 8 |
+
gr.Interface(
|
| 9 |
+
fn=gradio_analyze,
|
| 10 |
+
inputs=[
|
| 11 |
+
gr.Textbox(label='Ticker (e.g. NVDA)'),
|
| 12 |
+
gr.Textbox(label='Stock Data', lines=8),
|
| 13 |
+
gr.Textbox(label='News Headlines (one per line)', lines=5)
|
| 14 |
+
],
|
| 15 |
+
outputs=gr.Textbox(label='Investment Report', lines=20),
|
| 16 |
+
title='StockAI — Financial Analyzer'
|
| 17 |
+
).launch()
|