Spaces:
Sleeping
Sleeping
Update agent_langchain.py
Browse files- agent_langchain.py +2 -2
agent_langchain.py
CHANGED
|
@@ -66,13 +66,13 @@ def classify_ticket(text):
|
|
| 66 |
# ==============================================================
|
| 67 |
# 🧭 ROUTING FUNCTION (Space 2)
|
| 68 |
# ==============================================================
|
| 69 |
-
def call_routing(text, retries=3, delay=
|
| 70 |
"""Call Space 2 routing endpoint and get department only."""
|
| 71 |
url = ROUTING_URL if ROUTING_URL else f"{SPACE_URL}/route"
|
| 72 |
|
| 73 |
for attempt in range(retries):
|
| 74 |
try:
|
| 75 |
-
resp = requests.post(url, json={"text": text}, timeout=
|
| 76 |
resp.raise_for_status()
|
| 77 |
data = resp.json()
|
| 78 |
return data.get("department", "General IT")
|
|
|
|
| 66 |
# ==============================================================
|
| 67 |
# 🧭 ROUTING FUNCTION (Space 2)
|
| 68 |
# ==============================================================
|
| 69 |
+
def call_routing(text, retries=3, delay=5):
|
| 70 |
"""Call Space 2 routing endpoint and get department only."""
|
| 71 |
url = ROUTING_URL if ROUTING_URL else f"{SPACE_URL}/route"
|
| 72 |
|
| 73 |
for attempt in range(retries):
|
| 74 |
try:
|
| 75 |
+
resp = requests.post(url, json={"text": text}, timeout=30)
|
| 76 |
resp.raise_for_status()
|
| 77 |
data = resp.json()
|
| 78 |
return data.get("department", "General IT")
|