Spaces:
Running
Running
| import sys | |
| import os | |
| sys.path.insert(0, os.path.abspath("backend")) | |
| from agents.auditor import audit_final_document | |
| import json | |
| from dotenv import load_dotenv | |
| # Load env file from backend directory | |
| load_dotenv(os.path.join(os.path.abspath("backend"), ".env")) | |
| document = ( | |
| """ | |
| # Streszczenie Projektu | |
| Wniosek dotyczy wdrożenia innowacyjnej platformy AI dla przemysłu. | |
| Cel: automatyzacja procesów. | |
| Budżet: 100 000 PLN. | |
| Harmonogram: 12 miesięcy. | |
| ## Potencjał Wnioskodawcy | |
| Firma posiada odpowiednie zasoby techniczne i kadrowe. | |
| Doświadczenie z AI i cloud computing. | |
| ## Budżet i koszty | |
| Koszty kwalifikowalne to 80 000 PLN. | |
| Dofinansowanie: 50 000 PLN. | |
| """ | |
| * 10 | |
| ) # make it long enough | |
| try: | |
| result = audit_final_document( | |
| project_id="test_id_123", | |
| program_name="KPO", | |
| content=document, | |
| is_external_audit=False, | |
| ) | |
| if hasattr(result, "model_dump"): | |
| print(json.dumps(result.model_dump(), indent=2)) | |
| elif hasattr(result, "dict"): | |
| print(json.dumps(result.dict(), indent=2)) | |
| else: | |
| print(result) | |
| except Exception as e: | |
| print(f"Error: {e}") | |
| import traceback | |
| traceback.print_exc() | |