File size: 608 Bytes
3454130
128c031
deafbd7
d88a433
 
 
 
 
 
 
 
 
 
 
 
128c031
d88a433
 
 
 
 
deafbd7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from smolagents import CodeAgent

import gradio as gr
from app import get_weather  # Ensure this function is correctly imported from the main script

def weather_interface(city):
    return get_weather(city)

# Define Gradio UI components
with gr.Blocks() as demo:
    gr.Markdown("# Weather Information App")
    city = gr.Textbox(label="Enter City Name")
    get_weather_button = gr.Button("Get Weather")
    output = gr.Textbox(label="Weather Details")
    
    get_weather_button.click(weather_interface, inputs=[city], outputs=output)

if __name__ == "__main__":
    demo.launch()