Spaces:
Sleeping
Sleeping
File size: 890 Bytes
2628a0b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | """
Quick test script to debug a single question without launching Gradio.
Usage: python test_agent.py
"""
import os
import json
from dotenv import load_dotenv
load_dotenv()
from app import BasicAgent
from tools.file_handler import prefetch_file
agent = BasicAgent()
# --- Edit these to test any question ---
task_id = "test-task-id" # replace with real task_id if needed
question = 'If we reverse the word "tfel", what is the antonym of the result?'
# ----------------------------------------
file_content = prefetch_file(task_id)
if file_content:
full_question = f"{question}\n\n[Attached file content]:\n{file_content}"
print(f"[File found and attached, length={len(file_content)}]")
else:
full_question = question
print("[No file attachment]")
print(f"\nQuestion: {full_question[:200]}\n")
answer = agent(full_question)
print(f"\n=== Final Answer ===\n{answer}")
|