-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_workflow.py
More file actions
57 lines (47 loc) · 1.99 KB
/
test_workflow.py
File metadata and controls
57 lines (47 loc) · 1.99 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# test_workflow.py
import logging
import sys
from src.agent_tools.llamaindex_comprehensive_workflow import ComprehensiveAnalysisWorkflow
from src.agent_tools.context_manager import ContextManager
# Set up logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()
# Test the workflow directly
try:
print('Testing comprehensive workflow...')
import asyncio
from pathlib import Path
async def test_workflow():
repo_path = '/Users/ash/Documents/ash_projects/triage.flow'
context_manager = ContextManager(None, None)
workflow = ComprehensiveAnalysisWorkflow(
session_id='test',
repo_path=repo_path,
context_manager=context_manager
)
from src.agent_tools.llamaindex_comprehensive_workflow import AnalysisRequest
request = AnalysisRequest(
query='Analyze security vulnerabilities',
focus_areas=['security', 'dependencies'],
session_id='test',
repo_path=repo_path
)
result = await workflow.run(request=request)
print('Workflow completed successfully!')
print('Result type:', type(result))
print('Result keys:', list(result.keys()) if isinstance(result, dict) else 'Not a dict')
# Print some key sections to verify the structure
if isinstance(result, dict):
if 'analysis_metadata' in result:
print('Analysis metadata keys:', list(result['analysis_metadata'].keys()))
if 'security_analysis' in result:
print('Security findings count:', result['security_analysis'].get('findings_count', 0))
if 'summary' in result:
print('Summary preview:', result['summary'][:200] + '...' if len(result['summary']) > 200 else result['summary'])
return result
result = asyncio.run(test_workflow())
print('Test completed')
except Exception as e:
print(f'Error: {e}')
import traceback
traceback.print_exc()