Spaces:
Build error
Build error
Refactor app.py to comment out global question_counter and related logic, simplifying the agent's question handling. This change prepares for potential future enhancements while maintaining current functionality.
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ import requests
|
|
9 |
# from main import main
|
10 |
from main_v2 import main
|
11 |
|
12 |
-
global question_counter
|
13 |
-
question_counter = 0
|
14 |
|
15 |
# (Keep Constants as is)
|
16 |
# --- Constants ---
|
@@ -26,11 +26,11 @@ class BasicAgent:
|
|
26 |
def __call__(self, question: str) -> str:
|
27 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
28 |
|
29 |
-
global question_counter
|
30 |
-
question_counter += 1
|
31 |
|
32 |
-
if question_counter > 1:
|
33 |
-
return "This is a default answer."
|
34 |
|
35 |
# fixed_answer = "This is a default answer."
|
36 |
# print(f"Agent returning fixed answer: {fixed_answer}")
|
|
|
9 |
# from main import main
|
10 |
from main_v2 import main
|
11 |
|
12 |
+
# global question_counter
|
13 |
+
# question_counter = 0
|
14 |
|
15 |
# (Keep Constants as is)
|
16 |
# --- Constants ---
|
|
|
26 |
def __call__(self, question: str) -> str:
|
27 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
28 |
|
29 |
+
# global question_counter
|
30 |
+
# question_counter += 1
|
31 |
|
32 |
+
# if question_counter > 1:
|
33 |
+
# return "This is a default answer."
|
34 |
|
35 |
# fixed_answer = "This is a default answer."
|
36 |
# print(f"Agent returning fixed answer: {fixed_answer}")
|