Spaces:
Sleeping
Sleeping
Delete app.py
Browse files
app.py
DELETED
|
@@ -1,51 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
import streamlit as st
|
| 3 |
-
import requests
|
| 4 |
-
from dotenv import load_dotenv
|
| 5 |
-
|
| 6 |
-
# Load API keys
|
| 7 |
-
load_dotenv()
|
| 8 |
-
SKYVERN_API = os.getenv("SKYVERN_API_KEY")
|
| 9 |
-
GEMINI_API = os.getenv("GEMINI_API_KEY")
|
| 10 |
-
|
| 11 |
-
st.set_page_config(page_title="AI Automation Assistant", page_icon="🤖", layout="wide")
|
| 12 |
-
st.title("🤖 Universal AI Automation Assistant")
|
| 13 |
-
|
| 14 |
-
# User input
|
| 15 |
-
task = st.text_input("What do you want me to do?", placeholder="Example: Order me a pizza, check my flight, apply for admission...")
|
| 16 |
-
|
| 17 |
-
if st.button("Run Task"):
|
| 18 |
-
if not task.strip():
|
| 19 |
-
st.warning("Please enter a task.")
|
| 20 |
-
else:
|
| 21 |
-
st.write("⏳ Sending task to AI...")
|
| 22 |
-
|
| 23 |
-
try:
|
| 24 |
-
# Example Skyvern call
|
| 25 |
-
skyvern_response = requests.post(
|
| 26 |
-
"https://api.skyvern.com/tasks",
|
| 27 |
-
headers={"Authorization": f"Bearer {SKYVERN_API}"},
|
| 28 |
-
json={"task": task}
|
| 29 |
-
)
|
| 30 |
-
|
| 31 |
-
if skyvern_response.status_code == 200:
|
| 32 |
-
st.success("✅ Skyvern executed the automation task!")
|
| 33 |
-
st.json(skyvern_response.json())
|
| 34 |
-
else:
|
| 35 |
-
st.error(f"Skyvern error: {skyvern_response.text}")
|
| 36 |
-
|
| 37 |
-
# Example Gemini call (for reasoning / natural language)
|
| 38 |
-
gemini_response = requests.post(
|
| 39 |
-
"https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=" + GEMINI_API,
|
| 40 |
-
json={"contents": [{"parts": [{"text": task}]}]}
|
| 41 |
-
)
|
| 42 |
-
|
| 43 |
-
if gemini_response.status_code == 200:
|
| 44 |
-
reply = gemini_response.json()["candidates"][0]["content"]["parts"][0]["text"]
|
| 45 |
-
st.write("🤖 Gemini reasoning:")
|
| 46 |
-
st.info(reply)
|
| 47 |
-
else:
|
| 48 |
-
st.error(f"Gemini error: {gemini_response.text}")
|
| 49 |
-
|
| 50 |
-
except Exception as e:
|
| 51 |
-
st.error(f"Something went wrong: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|