wu981526092 commited on
Commit
7d48c14
·
1 Parent(s): 9f8c703

Restore all AgentGraph high-level features

Browse files

- Fixed evaluation module dependency in methods/__init__.py
- Restored SlidingWindowMonitor, PromptReconstructor, testing, causal analysis
- Fixed shared models import in agentgraph/shared/__init__.py
- All advanced features now work without evaluation module dependency

agentgraph/__init__.py CHANGED
@@ -33,15 +33,15 @@ from .input import (
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 (
@@ -56,23 +56,23 @@ from .shared import *
56
  __version__ = "0.1.0"
57
 
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',
 
33
  display_trace_summary,
34
  preprocess_content_for_cost_optimization
35
  )
36
+ # NOTE: High-level functionality restored after fixing evaluation module dependency
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 (
 
56
  __version__ = "0.1.0"
57
 
58
  __all__ = [
59
+ # Core components - High-level functionality restored! 🚀
60
  'ChunkingService',
61
+ 'SlidingWindowMonitor', # Restored after fixing evaluation dependency
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 - Restored!
74
+ 'reconstruct_prompts_from_knowledge_graph',
75
+ 'enrich_reconstruction_graph',
76
 
77
  # Parser system
78
  'BaseTraceParser', 'LangSmithParser', 'ParsedMetadata',
agentgraph/methods/__init__.py CHANGED
@@ -3,29 +3,16 @@ Knowledge Extraction Methods Package
3
 
4
  This package contains all available knowledge extraction methods organized by type:
5
  - production: Production-ready methods using reference-based schemas
6
- - baseline: Baseline methods using direct-based schemas
7
  """
8
 
 
9
  from .production import multi_agent_knowledge_extractor
10
- from .baseline import (
11
- base_method,
12
- original_method,
13
- clustering_method,
14
- direct_llm_method,
15
- hybrid_method,
16
- pydantic_method,
17
- unified_method,
18
- # rule_based_method removed
19
- )
20
 
21
  __all__ = [
22
  "multi_agent_knowledge_extractor",
23
- "base_method",
24
- "original_method",
25
- "clustering_method",
26
- "direct_llm_method",
27
- "hybrid_method",
28
- "pydantic_method",
29
- "unified_method",
30
- # "rule_based_method" removed
31
  ]
 
3
 
4
  This package contains all available knowledge extraction methods organized by type:
5
  - production: Production-ready methods using reference-based schemas
6
+ - baseline: Baseline methods using direct-based schemas (avoid importing due to evaluation dependency)
7
  """
8
 
9
+ # Only import production methods to avoid evaluation module dependency
10
  from .production import multi_agent_knowledge_extractor
11
+
12
+ # NOTE: Baseline methods are temporarily not imported to avoid evaluation module dependency
13
+ # These can be imported individually if needed:
14
+ # from .baseline import original_method, clustering_method, etc.
 
 
 
 
 
 
15
 
16
  __all__ = [
17
  "multi_agent_knowledge_extractor",
 
 
 
 
 
 
 
 
18
  ]
agentgraph/shared/__init__.py CHANGED
@@ -7,4 +7,24 @@ Common utilities and models used across pipeline stages:
7
  - Cross-stage utilities
8
  """
9
 
10
- __all__ = []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  - Cross-stage utilities
8
  """
9
 
10
+ # Import models from reference-based schema (primary schema used by production methods)
11
+ from .models.reference_based.entity import Entity
12
+ from .models.reference_based.relation import Relation
13
+ from .models.reference_based.report import KnowledgeGraph
14
+ from .models.reference_based.content_reference import ContentReference
15
+ from .models.reference_based.failure import Failure
16
+
17
+ # Also make direct-based models available
18
+ from .models.direct_based import models as direct_models
19
+
20
+ __all__ = [
21
+ # Reference-based models (primary)
22
+ 'Entity',
23
+ 'Relation',
24
+ 'KnowledgeGraph',
25
+ 'ContentReference',
26
+ 'Failure',
27
+
28
+ # Direct-based models (alternative)
29
+ 'direct_models',
30
+ ]