Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -64,7 +64,6 @@ class BasicAgent:
|
|
| 64 |
model_id="gpt-4o",
|
| 65 |
api_base="https://api.openai.com/v1",
|
| 66 |
api_key=os.environ["OPENAI_API_KEY"],
|
| 67 |
-
system_prompt=prompt
|
| 68 |
)
|
| 69 |
|
| 70 |
self.agent = CodeAgent(
|
|
@@ -73,6 +72,8 @@ class BasicAgent:
|
|
| 73 |
)
|
| 74 |
def __call__(self, question: str) -> str:
|
| 75 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 76 |
-
|
|
|
|
|
|
|
| 77 |
print(f"Agent returning fixed answer: {fixed_answer}")
|
| 78 |
return fixed_answer
|
|
|
|
| 64 |
model_id="gpt-4o",
|
| 65 |
api_base="https://api.openai.com/v1",
|
| 66 |
api_key=os.environ["OPENAI_API_KEY"],
|
|
|
|
| 67 |
)
|
| 68 |
|
| 69 |
self.agent = CodeAgent(
|
|
|
|
| 72 |
)
|
| 73 |
def __call__(self, question: str) -> str:
|
| 74 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 75 |
+
# Prepend the prompt to the question with a clear separator
|
| 76 |
+
full_input = prompt + "\n\nQuestion: " + question
|
| 77 |
+
fixed_answer = self.agent.run(full_input)
|
| 78 |
print(f"Agent returning fixed answer: {fixed_answer}")
|
| 79 |
return fixed_answer
|