agent2 / app.py
smithaneka's picture
Update app.py
41e9d40 verified
Raw History Blame Contribute Delete
699 Bytes
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()