Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ import subprocess
|
|
| 7 |
from duckduckgo_search import DDGS
|
| 8 |
from bs4 import BeautifulSoup
|
| 9 |
|
| 10 |
-
# Gemini API Key -> Hugging Face Space ke Secrets mein 'GEMINI_API_KEY' naam se save
|
| 11 |
GEMINI_API_KEY = os.environ.get("GEMINI_API_KEY")
|
| 12 |
GEMINI_URL = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key={GEMINI_API_KEY}"
|
| 13 |
|
|
@@ -29,7 +29,7 @@ def read_webpage(url: str) -> str:
|
|
| 29 |
try:
|
| 30 |
resp = requests.get(url, timeout=10, headers={"User-Agent": "Mozilla/5.0"})
|
| 31 |
soup = BeautifulSoup(resp.text, 'html.parser')
|
| 32 |
-
text = ' '.join(soup.stripped_strings)[:3000]
|
| 33 |
return text
|
| 34 |
except Exception as e:
|
| 35 |
return f"Could not read webpage: {str(e)}"
|
|
@@ -163,7 +163,7 @@ def run_agent_loop(message, history=[]):
|
|
| 163 |
"contents": contents,
|
| 164 |
"tools": GEMINI_TOOLS,
|
| 165 |
"systemInstruction": {
|
| 166 |
-
"parts": [{"text": "You are a master developer agent
|
| 167 |
}
|
| 168 |
}
|
| 169 |
|
|
@@ -199,6 +199,6 @@ def run_agent_loop(message, history=[]):
|
|
| 199 |
return f"Agent Logic Pipeline Error: {str(e)}"
|
| 200 |
|
| 201 |
if __name__ == "__main__":
|
| 202 |
-
print("Starting
|
| 203 |
-
#
|
| 204 |
-
|
|
|
|
| 7 |
from duckduckgo_search import DDGS
|
| 8 |
from bs4 import BeautifulSoup
|
| 9 |
|
| 10 |
+
# Gemini API Key -> Hugging Face Space ke Secrets mein 'GEMINI_API_KEY' naam se save karein
|
| 11 |
GEMINI_API_KEY = os.environ.get("GEMINI_API_KEY")
|
| 12 |
GEMINI_URL = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key={GEMINI_API_KEY}"
|
| 13 |
|
|
|
|
| 29 |
try:
|
| 30 |
resp = requests.get(url, timeout=10, headers={"User-Agent": "Mozilla/5.0"})
|
| 31 |
soup = BeautifulSoup(resp.text, 'html.parser')
|
| 32 |
+
text = ' '.join(soup.stripped_strings)[:3000]
|
| 33 |
return text
|
| 34 |
except Exception as e:
|
| 35 |
return f"Could not read webpage: {str(e)}"
|
|
|
|
| 163 |
"contents": contents,
|
| 164 |
"tools": GEMINI_TOOLS,
|
| 165 |
"systemInstruction": {
|
| 166 |
+
"parts": [{"text": "You are a master developer agent inside the environment. You can execute tools instantly to compile APK paths."}]
|
| 167 |
}
|
| 168 |
}
|
| 169 |
|
|
|
|
| 199 |
return f"Agent Logic Pipeline Error: {str(e)}"
|
| 200 |
|
| 201 |
if __name__ == "__main__":
|
| 202 |
+
print("Starting Antigravity Web Module on main port 7860...")
|
| 203 |
+
# Pure Python antigravity tool integration redirection
|
| 204 |
+
import antigravity
|