Spaces:
Sleeping
Sleeping
Update src/agent.py
Browse files- src/agent.py +4 -4
src/agent.py
CHANGED
|
@@ -90,17 +90,17 @@ class BasicAgent():
|
|
| 90 |
self.max_retries = 3
|
| 91 |
self.base_delay = 5
|
| 92 |
|
| 93 |
-
def run(self, question: str,
|
| 94 |
final_answer = None
|
| 95 |
retry_count = 0
|
| 96 |
|
| 97 |
question = f"Question: {question}"
|
| 98 |
-
|
| 99 |
-
print(f"Starting Agent with question text: {question}, {
|
| 100 |
while True:
|
| 101 |
try:
|
| 102 |
# Run the agent
|
| 103 |
-
steps = self.agent.run(question,
|
| 104 |
|
| 105 |
# If steps is a string, convert it to a single-item list
|
| 106 |
if isinstance(steps, str):
|
|
|
|
| 90 |
self.max_retries = 3
|
| 91 |
self.base_delay = 5
|
| 92 |
|
| 93 |
+
def run(self, question: str, file_content: str = ""):
|
| 94 |
final_answer = None
|
| 95 |
retry_count = 0
|
| 96 |
|
| 97 |
question = f"Question: {question}"
|
| 98 |
+
context = f"Story content:\n{file_content}"
|
| 99 |
+
print(f"Starting Agent with question text: {question}, {file_content}")
|
| 100 |
while True:
|
| 101 |
try:
|
| 102 |
# Run the agent
|
| 103 |
+
steps = self.agent.run(question, context)
|
| 104 |
|
| 105 |
# If steps is a string, convert it to a single-item list
|
| 106 |
if isinstance(steps, str):
|