ShankarC commited on
Commit
9ef3849
·
verified ·
1 Parent(s): 6013991

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -17
app.py CHANGED
@@ -1,20 +1,9 @@
1
- import os
2
  import gradio as gr
3
- from google import genai
4
 
5
- def analyze_stock(ticker):
6
- api_key = os.getenv("GOOGLE_GEMINI_API_KEY")
7
- if not api_key:
8
- return "API key not found. Please add it in Space secrets."
 
9
 
10
- client = genai.Client(api_key=api_key)
11
-
12
- prompt = f"Analyze stock {ticker}"
13
- response = client.models.generate_content(
14
- model="gemini-2.5-flash-preview-05-20",
15
- contents=prompt
16
- )
17
- return response.text
18
-
19
- iface = gr.Interface(fn=analyze_stock, inputs="text", outputs="text")
20
- iface.launch()
 
 
1
  import gradio as gr
 
2
 
3
+ with gr.Blocks() as demo:
4
+ gr.Markdown("<span style='background-color:red; color:blue; font-weight:bold; padding:5px; border-radius:4px;'>My Label</span>")
5
+ with gr.Row():
6
+ txt1 = gr.Textbox(label="Input 1")
7
+ txt2 = gr.Textbox(label="Input 2")
8
 
9
+ demo.launch()