Download app.py from Khanmx99/Test: direct link, hf CLI and curl.
- Browser
- Download file 749 Bytes
-
https://huggingface.co/spaces/Khanmx99/Test/resolve/main/app.py
- Command line
-
hf download hf://spaces/Khanmx99/Test/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Khanmx99/Test/resolve/main/app.py
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.") | |