File size: 699 Bytes
dd252fb
 
41e9d40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dd252fb
 
41e9d40
dd252fb
41e9d40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import gradio as gr

# A simple agent function
def simple_agent(user_input):
    if "hello" in user_input.lower():
        return "Hi there! I'm your AI agent 🤖. How can I help you today?"
    elif "help" in user_input.lower():
        return "Sure! I can help you with AI, coding, or general questions."
    else:
        return "I'm not sure how to respond. Try saying 'hello' or 'help'."

# Build a Gradio interface
iface = gr.Interface(
    fn=simple_agent,
    inputs="text",
    outputs="text",
    title="Beginner AI Agent",
    description="Type something to interact with a basic AI agent built using Gradio and Python!"
)

# Launch the app
if __name__ == "__main__":
    iface.launch()