diff --git a/backend/app/core/__pycache__/orchestrator.cpython-313.pyc b/backend/app/core/__pycache__/orchestrator.cpython-313.pyc index b4cae5e8..27d5be7d 100644 Binary files a/backend/app/core/__pycache__/orchestrator.cpython-313.pyc and b/backend/app/core/__pycache__/orchestrator.cpython-313.pyc differ diff --git a/backend/app/core/orchestrator.py b/backend/app/core/orchestrator.py index ff41cfc6..2fdda67c 100644 --- a/backend/app/core/orchestrator.py +++ b/backend/app/core/orchestrator.py @@ -109,7 +109,7 @@ async def execute_agents_concurrently(self, report_id: str, token_id: str) -> Di # Generate NLG outputs (placeholder for actual NLG generation) # In a real scenario, nlg_engine would process aggregated_data to produce text - nlg_outputs = await nlg_engine.generate_nlg_outputs(aggregated_data) # Assuming this method exists + nlg_sections = await nlg_engine.generate_nlg_outputs(aggregated_data) # Assuming this method exists # Prepare score_input for the summary engine score_input = { @@ -123,7 +123,7 @@ async def execute_agents_concurrently(self, report_id: str, token_id: str) -> Di scores = summary_engine.generate_scores(score_input) # Build final summary - final_summary = summary_engine.build_final_summary(nlg_outputs, scores) + final_summary = summary_engine.build_final_summary(nlg_sections, scores) # Update in_memory_reports if report_id in in_memory_reports: @@ -131,6 +131,7 @@ async def execute_agents_concurrently(self, report_id: str, token_id: str) -> Di "status": overall_status, "data": aggregated_data, "scores": scores, # Add scores to the report + "nlg_sections": nlg_sections, # Add NLG generated sections to the report "summary": final_summary # Add final summary to the report }) orchestrator_logger.info(f"Report {report_id} status updated to {overall_status}.") diff --git a/backend/app/services/nlg/__pycache__/__init__.cpython-313.pyc b/backend/app/services/nlg/__pycache__/__init__.cpython-313.pyc index 5c4c0905..c4e5f27d 100644 Binary files a/backend/app/services/nlg/__pycache__/__init__.cpython-313.pyc and b/backend/app/services/nlg/__pycache__/__init__.cpython-313.pyc differ diff --git a/backend/app/services/nlg/__pycache__/prompt_templates.cpython-313.pyc b/backend/app/services/nlg/__pycache__/prompt_templates.cpython-313.pyc index 28f0fe2e..2c988d98 100644 Binary files a/backend/app/services/nlg/__pycache__/prompt_templates.cpython-313.pyc and b/backend/app/services/nlg/__pycache__/prompt_templates.cpython-313.pyc differ diff --git a/backend/app/services/nlg/__pycache__/report_nlg_engine.cpython-313.pyc b/backend/app/services/nlg/__pycache__/report_nlg_engine.cpython-313.pyc index 7bc86931..41c075b5 100644 Binary files a/backend/app/services/nlg/__pycache__/report_nlg_engine.cpython-313.pyc and b/backend/app/services/nlg/__pycache__/report_nlg_engine.cpython-313.pyc differ diff --git a/backend/app/services/summary/__pycache__/report_summary_engine.cpython-313.pyc b/backend/app/services/summary/__pycache__/report_summary_engine.cpython-313.pyc index c5185484..892c3591 100644 Binary files a/backend/app/services/summary/__pycache__/report_summary_engine.cpython-313.pyc and b/backend/app/services/summary/__pycache__/report_summary_engine.cpython-313.pyc differ diff --git a/backend/logs/app.log b/backend/logs/app.log index 731c2dd6..c4c4e24e 100644 --- a/backend/logs/app.log +++ b/backend/logs/app.log @@ -7447,3 +7447,120 @@ Exception: Agent failed 2025-11-21 16:55:51,979 - services - WARNING - Report with id non_existent_report not found when attempting to retrieve data. 2025-11-21 16:55:51,979 - api - ERROR - Report with id non_existent_report not found or not completed for data request. 2025-11-21 16:55:51,979 - api - ERROR - ReportNotFoundException: Report not found or not completed +2025-11-22 08:47:46,348 - orchestrator - INFO - Registering agent: AgentOne +2025-11-22 08:47:46,349 - orchestrator - INFO - Registering agent: AgentTwo +2025-11-22 08:47:46,349 - orchestrator - INFO - Executing agents concurrently for report_id: test_report_id_success, token_id: test_token_id +2025-11-22 08:47:46,349 - orchestrator - INFO - Executing agents for report_id: test_report_id_success, token_id: test_token_id +2025-11-22 08:47:46,349 - orchestrator - INFO - Agent AgentOne completed for report test_report_id_success. +2025-11-22 08:47:46,349 - orchestrator - INFO - Agent AgentTwo completed for report test_report_id_success. +2025-11-22 08:47:46,349 - orchestrator - INFO - Aggregating results from executed agents. +2025-11-22 08:47:46,349 - orchestrator - INFO - Report test_report_id_success status updated to completed. +2025-11-22 08:47:46,352 - orchestrator - INFO - Registering agent: AgentOne +2025-11-22 08:47:46,352 - orchestrator - INFO - Registering agent: AgentFailing +2025-11-22 08:47:46,352 - orchestrator - INFO - Executing agents concurrently for report_id: test_report_id_failure, token_id: test_token_id +2025-11-22 08:47:46,352 - orchestrator - INFO - Executing agents for report_id: test_report_id_failure, token_id: test_token_id +2025-11-22 08:47:46,352 - orchestrator - INFO - Agent AgentOne completed for report test_report_id_failure. +2025-11-22 08:47:46,352 - orchestrator - ERROR - Agent AgentFailing failed for report test_report_id_failure +Traceback (most recent call last): + File "/home/repositories/LumintelAnalytics/ChainReport-API/backend/app/core/orchestrator.py", line 56, in execute_agents + result = await asyncio.wait_for(task, timeout=settings.AGENT_TIMEOUT) # Added timeout + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.13/asyncio/tasks.py", line 507, in wait_for + return await fut + ^^^^^^^^^ + File "/usr/lib/python3.13/unittest/mock.py", line 2321, in _execute_mock_call + raise effect +Exception: Agent failed +2025-11-22 08:47:46,356 - orchestrator - INFO - Aggregating results from executed agents. +2025-11-22 08:47:46,356 - orchestrator - ERROR - Report test_report_id_failure failed due to one or more agent failures. +2025-11-22 08:47:46,356 - orchestrator - INFO - Report test_report_id_failure status updated to failed. +2025-11-22 08:47:46,358 - orchestrator - INFO - Registering agent: a +2025-11-22 08:47:46,359 - orchestrator - WARNING - Configuration Error: ONCHAIN_METRICS_URL is missing. Skipping agent registration. +2025-11-22 08:47:46,359 - orchestrator - WARNING - Onchain Data Agent will not be registered due to invalid configuration. +2025-11-22 08:47:46,359 - orchestrator - INFO - Registering agent: social_sentiment_agent +2025-11-22 08:47:46,359 - orchestrator - INFO - Registering agent: team_documentation_agent +2025-11-22 08:47:46,359 - orchestrator - WARNING - Configuration Error: CODE_AUDIT_REPO_URL is missing. Skipping agent registration. +2025-11-22 08:47:46,359 - orchestrator - WARNING - Code/Audit Agent will not be registered due to invalid CODE_AUDIT_REPO_URL configuration. +2025-11-22 08:47:46,360 - orchestrator - INFO - Registering agent: dummy_agent +2025-11-22 08:47:46,360 - orchestrator - WARNING - Configuration Error: ONCHAIN_METRICS_URL is missing. Skipping agent registration. +2025-11-22 08:47:46,360 - orchestrator - WARNING - Onchain Data Agent will not be registered due to invalid configuration. +2025-11-22 08:47:46,360 - orchestrator - INFO - Registering agent: social_sentiment_agent +2025-11-22 08:47:46,360 - orchestrator - INFO - Registering agent: team_documentation_agent +2025-11-22 08:47:46,360 - orchestrator - WARNING - Configuration Error: CODE_AUDIT_REPO_URL is missing. Skipping agent registration. +2025-11-22 08:47:46,361 - orchestrator - WARNING - Code/Audit Agent will not be registered due to invalid CODE_AUDIT_REPO_URL configuration. +2025-11-22 08:47:46,381 - orchestrator - INFO - Registering agent: onchain_data_agent +2025-11-22 08:47:46,381 - orchestrator - INFO - Registering agent: social_sentiment_agent +2025-11-22 08:47:46,381 - orchestrator - INFO - Registering agent: team_documentation_agent +2025-11-22 08:47:46,381 - orchestrator - INFO - Registering agent: code_audit_agent +2025-11-22 08:47:46,381 - orchestrator - INFO - Executing agents concurrently for report_id: test_report_123, token_id: ethereum +2025-11-22 08:47:46,381 - orchestrator - INFO - Executing agents for report_id: test_report_123, token_id: ethereum +2025-11-22 08:47:46,381 - orchestrator - INFO - Calling Onchain Data Agent for report_id: test_report_123, token_id: ethereum +2025-11-22 08:47:46,381 - orchestrator - INFO - Calling Social Sentiment Agent for report_id: test_report_123, token_id: ethereum +2025-11-22 08:47:46,381 - orchestrator - INFO - Social Sentiment Agent completed for report test_report_123. +2025-11-22 08:47:46,381 - orchestrator - INFO - Calling Team and Documentation Agent for report_id: test_report_123, token_id: ethereum +2025-11-22 08:47:46,381 - orchestrator - INFO - Scraping team profiles for token ethereum from URLs: ['http://mock-team-profile.com'] +2025-11-22 08:47:46,383 - orchestrator - INFO - Calling Code/Audit Agent for report_id: test_report_123, token_id: ethereum +2025-11-22 08:47:46,397 - orchestrator - INFO - Fetching repository metrics for http://mock-code-audit.com/repo +2025-11-22 08:47:46,397 - orchestrator - INFO - Analyzing code activity for http://mock-code-audit.com/repo +2025-11-22 08:47:46,397 - orchestrator - INFO - Searching and summarizing audit reports for http://mock-code-audit.com/repo +2025-11-22 08:47:46,410 - orchestrator - INFO - Team profile scraping completed for token ethereum. +2025-11-22 08:47:46,410 - orchestrator - INFO - Analyzing whitepaper for token ethereum from source: mock whitepaper text +2025-11-22 08:47:46,410 - orchestrator - INFO - Agent onchain_data_agent completed for report test_report_123. +2025-11-22 08:47:46,410 - orchestrator - INFO - Agent social_sentiment_agent completed for report test_report_123. +2025-11-22 08:47:46,411 - orchestrator - INFO - Whitepaper analysis completed for token ethereum. +2025-11-22 08:47:46,411 - orchestrator - INFO - Agent team_documentation_agent completed for report test_report_123. +2025-11-22 08:47:46,411 - orchestrator - INFO - Agent code_audit_agent completed for report test_report_123. +2025-11-22 08:47:46,411 - orchestrator - INFO - Aggregating results from executed agents. +2025-11-22 08:47:54,033 - orchestrator - INFO - Report test_report_123 status updated to completed. +2025-11-22 08:47:54,048 - orchestrator - INFO - Registering agent: onchain_data_agent +2025-11-22 08:47:54,048 - orchestrator - INFO - Registering agent: social_sentiment_agent +2025-11-22 08:47:54,048 - orchestrator - INFO - Registering agent: team_documentation_agent +2025-11-22 08:47:54,048 - orchestrator - INFO - Registering agent: code_audit_agent +2025-11-22 08:47:54,048 - orchestrator - INFO - Executing agents concurrently for report_id: test_report_123, token_id: ethereum +2025-11-22 08:47:54,048 - orchestrator - INFO - Executing agents for report_id: test_report_123, token_id: ethereum +2025-11-22 08:47:54,049 - orchestrator - INFO - Calling Onchain Data Agent for report_id: test_report_123, token_id: ethereum +2025-11-22 08:47:54,049 - orchestrator - INFO - Calling Social Sentiment Agent for report_id: test_report_123, token_id: ethereum +2025-11-22 08:47:54,049 - orchestrator - INFO - Social Sentiment Agent completed for report test_report_123. +2025-11-22 08:47:54,049 - orchestrator - INFO - Calling Team and Documentation Agent for report_id: test_report_123, token_id: ethereum +2025-11-22 08:47:54,049 - orchestrator - INFO - Scraping team profiles for token ethereum from URLs: ['http://mock-team-profile.com'] +2025-11-22 08:47:54,049 - orchestrator - INFO - Calling Code/Audit Agent for report_id: test_report_123, token_id: ethereum +2025-11-22 08:47:54,061 - orchestrator - INFO - Fetching repository metrics for http://mock-code-audit.com/repo +2025-11-22 08:47:54,061 - orchestrator - INFO - Analyzing code activity for http://mock-code-audit.com/repo +2025-11-22 08:47:54,061 - orchestrator - INFO - Searching and summarizing audit reports for http://mock-code-audit.com/repo +2025-11-22 08:47:54,063 - orchestrator - INFO - Team profile scraping completed for token ethereum. +2025-11-22 08:47:54,063 - orchestrator - INFO - Analyzing whitepaper for token ethereum from source: mock whitepaper text +2025-11-22 08:47:54,063 - orchestrator - ERROR - Onchain metrics fetch timed out for report test_report_123 +2025-11-22 08:47:54,063 - orchestrator - INFO - Agent onchain_data_agent completed for report test_report_123. +2025-11-22 08:47:54,063 - orchestrator - INFO - Agent social_sentiment_agent completed for report test_report_123. +2025-11-22 08:47:54,064 - orchestrator - INFO - Whitepaper analysis completed for token ethereum. +2025-11-22 08:47:54,064 - orchestrator - INFO - Agent team_documentation_agent completed for report test_report_123. +2025-11-22 08:47:54,064 - orchestrator - INFO - Agent code_audit_agent completed for report test_report_123. +2025-11-22 08:47:54,064 - orchestrator - INFO - Aggregating results from executed agents. +2025-11-22 08:47:54,064 - orchestrator - ERROR - Report test_report_123 failed due to one or more agent failures. +2025-11-22 08:48:00,450 - orchestrator - INFO - Report test_report_123 status updated to failed. +2025-11-22 08:48:00,456 - orchestrator - INFO - Registering agent: onchain_data_agent +2025-11-22 08:48:00,456 - orchestrator - INFO - Registering agent: social_sentiment_agent +2025-11-22 08:48:00,456 - orchestrator - INFO - Registering agent: team_documentation_agent +2025-11-22 08:48:00,456 - orchestrator - INFO - Registering agent: code_audit_agent +2025-11-22 08:48:00,456 - orchestrator - INFO - Executing agents concurrently for report_id: test_report_123, token_id: ethereum +2025-11-22 08:48:00,456 - orchestrator - INFO - Executing agents for report_id: test_report_123, token_id: ethereum +2025-11-22 08:48:00,456 - orchestrator - INFO - Calling Onchain Data Agent for report_id: test_report_123, token_id: ethereum +2025-11-22 08:48:00,457 - orchestrator - INFO - Calling Social Sentiment Agent for report_id: test_report_123, token_id: ethereum +2025-11-22 08:48:00,457 - orchestrator - INFO - Social Sentiment Agent completed for report test_report_123. +2025-11-22 08:48:00,457 - orchestrator - INFO - Calling Team and Documentation Agent for report_id: test_report_123, token_id: ethereum +2025-11-22 08:48:00,457 - orchestrator - INFO - Scraping team profiles for token ethereum from URLs: ['http://mock-team-profile.com'] +2025-11-22 08:48:00,457 - orchestrator - INFO - Calling Code/Audit Agent for report_id: test_report_123, token_id: ethereum +2025-11-22 08:48:00,473 - orchestrator - INFO - Fetching repository metrics for http://mock-code-audit.com/repo +2025-11-22 08:48:00,474 - orchestrator - INFO - Analyzing code activity for http://mock-code-audit.com/repo +2025-11-22 08:48:00,474 - orchestrator - INFO - Searching and summarizing audit reports for http://mock-code-audit.com/repo +2025-11-22 08:48:00,475 - orchestrator - INFO - Team profile scraping completed for token ethereum. +2025-11-22 08:48:00,475 - orchestrator - INFO - Analyzing whitepaper for token ethereum from source: mock whitepaper text +2025-11-22 08:48:00,476 - orchestrator - ERROR - Tokenomics fetch failed for report test_report_123 +2025-11-22 08:48:00,476 - orchestrator - INFO - Agent onchain_data_agent completed for report test_report_123. +2025-11-22 08:48:00,476 - orchestrator - INFO - Agent social_sentiment_agent completed for report test_report_123. +2025-11-22 08:48:00,476 - orchestrator - INFO - Whitepaper analysis completed for token ethereum. +2025-11-22 08:48:00,476 - orchestrator - INFO - Agent team_documentation_agent completed for report test_report_123. +2025-11-22 08:48:00,476 - orchestrator - INFO - Agent code_audit_agent completed for report test_report_123. +2025-11-22 08:48:00,476 - orchestrator - INFO - Aggregating results from executed agents. +2025-11-22 08:48:00,476 - orchestrator - ERROR - Report test_report_123 failed due to one or more agent failures. +2025-11-22 08:48:05,319 - orchestrator - INFO - Report test_report_123 status updated to failed.