Spaces:
Runtime error
Runtime error
Rivalcoder
commited on
Commit
·
ab7c6b9
1
Parent(s):
539d951
Add Areas
Browse files
llm.py
CHANGED
@@ -90,25 +90,25 @@ def query_gemini(questions, contexts, max_retries=3):
|
|
90 |
if not content.startswith("ERROR"):
|
91 |
webresults += f"\n\nRetrieved from {link}:\n{content}"
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
#
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
|
113 |
# Prompt building
|
114 |
t0 = time.perf_counter()
|
|
|
90 |
if not content.startswith("ERROR"):
|
91 |
webresults += f"\n\nRetrieved from {link}:\n{content}"
|
92 |
|
93 |
+
payload = {
|
94 |
+
"questions": questions,
|
95 |
+
"contexts": contexts,
|
96 |
+
"previousResults":"Search Result Datas from The Ai Agent With RealTime Data Access"
|
97 |
+
}
|
98 |
+
|
99 |
+
# Send to your webhook agent
|
100 |
+
webhook_url = "https://hook.us2.make.com/wnsitnljjvqyk2p1d2htl5v1o8hrcodk"
|
101 |
+
|
102 |
+
try:
|
103 |
+
resp = requests.post(webhook_url, json=payload, timeout=30)
|
104 |
+
resp.raise_for_status()
|
105 |
+
print("Webhook raw response:", resp.text) # Debug print to see what you actually got back
|
106 |
+
webhook_response = resp.json() # This will fail if resp.text is not valid JSON
|
107 |
+
enriched_context = webhook_response.get("enriched_context", "")
|
108 |
+
|
109 |
+
except Exception as e:
|
110 |
+
print(f"Webhook call failed: {e}")
|
111 |
+
enriched_context = "\n\n".join(contexts)
|
112 |
|
113 |
# Prompt building
|
114 |
t0 = time.perf_counter()
|