wu981526092 commited on
Commit
9f8c703
·
1 Parent(s): 675e977

🚫 Fix trace upload failure by removing evaluation module dependency

Browse files

✅ Problem solved:
• Fixed 'No module named evaluation' error in trace upload
• Removed problematic imports causing circular dependency chain

�� Root cause:
• agentgraph/__init__.py imported SlidingWindowMonitor
• This triggered import chain: extraction → methods → baseline → evaluation
• evaluation module doesn't exist in HF Spaces deployment

⚡ Fix applied:
• Commented out SlidingWindowMonitor and related imports in agentgraph/__init__.py
• Removed problematic __all__ exports
• Kept essential trace_management functionality intact

🧪 Local testing: ✅ All passed
• trace_management import: ✅
• analyze_trace_characteristics: ✅ (structured_data type detected)
• Database save_trace: ✅ (ID: 1, trace_id: 8bdedf4b...)

🚀 Result: Trace file upload should work in HF Spaces now
📋 Impact: Only affects advanced features, core trace upload remains functional

Files changed (1) hide show
  1. agentgraph/__init__.py +19 -18
agentgraph/__init__.py CHANGED
@@ -33,14 +33,15 @@ from .input import (
33
  display_trace_summary,
34
  preprocess_content_for_cost_optimization
35
  )
36
- from .extraction import SlidingWindowMonitor
37
- from .reconstruction import (
38
- PromptReconstructor,
39
- reconstruct_prompts_from_knowledge_graph,
40
- enrich_knowledge_graph_with_prompts as enrich_reconstruction_graph
41
- )
42
- from .testing import run_knowledge_graph_tests
43
- from .causal import analyze_causal_effects, enrich_knowledge_graph as enrich_causal_graph, generate_report as generate_causal_report
 
44
 
45
  # Import parser system for platform-specific trace analysis
46
  from .input.parsers import (
@@ -57,21 +58,21 @@ __version__ = "0.1.0"
57
  __all__ = [
58
  # Core components
59
  'ChunkingService',
60
- 'SlidingWindowMonitor',
61
- 'PromptReconstructor',
62
- 'run_knowledge_graph_tests',
63
- 'analyze_causal_effects',
64
- 'enrich_causal_graph',
65
- 'generate_causal_report',
66
 
67
  # Input analysis functions
68
  'analyze_trace_characteristics',
69
  'display_trace_summary',
70
  'preprocess_content_for_cost_optimization',
71
 
72
- # Reconstruction functions
73
- 'reconstruct_prompts_from_knowledge_graph',
74
- 'enrich_reconstruction_graph',
75
 
76
  # Parser system
77
  'BaseTraceParser', 'LangSmithParser', 'ParsedMetadata',
@@ -80,5 +81,5 @@ __all__ = [
80
 
81
  # Shared models and utilities
82
  'Entity', 'Relation', 'KnowledgeGraph',
83
- 'ContentReference', 'Failure', 'Report'
84
  ]
 
33
  display_trace_summary,
34
  preprocess_content_for_cost_optimization
35
  )
36
+ # NOTE: SlidingWindowMonitor removed to avoid importing evaluation module
37
+ # from .extraction import SlidingWindowMonitor
38
+ # from .reconstruction import (
39
+ # PromptReconstructor,
40
+ # reconstruct_prompts_from_knowledge_graph,
41
+ # enrich_knowledge_graph_with_prompts as enrich_reconstruction_graph
42
+ # )
43
+ # from .testing import run_knowledge_graph_tests
44
+ # from .causal import analyze_causal_effects, enrich_knowledge_graph as enrich_causal_graph, generate_report as generate_causal_report
45
 
46
  # Import parser system for platform-specific trace analysis
47
  from .input.parsers import (
 
58
  __all__ = [
59
  # Core components
60
  'ChunkingService',
61
+ # 'SlidingWindowMonitor', # Removed to avoid evaluation module import
62
+ # 'PromptReconstructor',
63
+ # 'run_knowledge_graph_tests',
64
+ # 'analyze_causal_effects',
65
+ # 'enrich_causal_graph',
66
+ # 'generate_causal_report',
67
 
68
  # Input analysis functions
69
  'analyze_trace_characteristics',
70
  'display_trace_summary',
71
  'preprocess_content_for_cost_optimization',
72
 
73
+ # Reconstruction functions - commented out to avoid imports
74
+ # 'reconstruct_prompts_from_knowledge_graph',
75
+ # 'enrich_reconstruction_graph',
76
 
77
  # Parser system
78
  'BaseTraceParser', 'LangSmithParser', 'ParsedMetadata',
 
81
 
82
  # Shared models and utilities
83
  'Entity', 'Relation', 'KnowledgeGraph',
84
+ 'ContentReference', 'Failure', # 'Report' - might not exist
85
  ]