Test / app.py
Khanmx99's picture
Update app.py
e6c347f verified
Raw History Blame Contribute Delete
749 Bytes
import streamlit as st
import datetime
st.title("Simple AI Agent")
command = st.text_input("Enter your command:")
if command:
cmd = command.lower()
if cmd == "quit":
st.write("Goodbye!")
elif "time" in cmd:
st.write("Current time is:", datetime.datetime.now().strftime("%H:%M:%S"))
elif cmd.startswith("add"):
parts = cmd.split()
if len(parts) == 3:
try:
result = int(parts[1]) + int(parts[2])
st.write("Result:", result)
except ValueError:
st.write("Please provide valid numbers after 'add'.")
else:
st.write("Format: add number1 number2")
else:
st.write("Sorry, I don't understand.")