Spaces:
Runtime error
Runtime error
Cascade Bot
commited on
Commit
·
c7d9c30
1
Parent(s):
bb8cb0c
Fixed circular imports by moving StrategyResult to base
Browse files- reasoning/__init__.py +39 -15
- reasoning/unified_engine.py +1 -13
reasoning/__init__.py
CHANGED
|
@@ -26,45 +26,69 @@ Learning & Adaptation:
|
|
| 26 |
16. Monetization Strategies
|
| 27 |
"""
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
from .multimodal import MultiModalReasoning
|
| 31 |
from .bayesian import BayesianReasoning
|
| 32 |
from .quantum import QuantumReasoning
|
| 33 |
from .neurosymbolic import NeurosymbolicReasoning
|
| 34 |
from .emergent import EmergentReasoning
|
| 35 |
-
from .meta_learning import MetaLearningStrategy
|
| 36 |
-
from .chain_of_thought import ChainOfThoughtStrategy
|
| 37 |
-
from .tree_of_thoughts import TreeOfThoughtsStrategy
|
| 38 |
-
from .recursive import RecursiveReasoning
|
| 39 |
-
from .analogical import AnalogicalReasoning
|
| 40 |
from .specialized import SpecializedReasoning
|
| 41 |
-
|
|
|
|
| 42 |
from .market_analysis import MarketAnalysisStrategy
|
| 43 |
from .portfolio_optimization import PortfolioOptimizationStrategy
|
| 44 |
from .venture_strategies import VentureStrategy
|
| 45 |
from .monetization import MonetizationStrategy
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
__all__ = [
|
|
|
|
| 49 |
'ReasoningStrategy',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
'MultiModalReasoning',
|
| 51 |
'BayesianReasoning',
|
| 52 |
'QuantumReasoning',
|
| 53 |
'NeurosymbolicReasoning',
|
| 54 |
'EmergentReasoning',
|
| 55 |
-
'MetaLearningStrategy',
|
| 56 |
-
'ChainOfThoughtStrategy',
|
| 57 |
-
'TreeOfThoughtsStrategy',
|
| 58 |
-
'RecursiveReasoning',
|
| 59 |
-
'AnalogicalReasoning',
|
| 60 |
'SpecializedReasoning',
|
| 61 |
-
|
|
|
|
| 62 |
'MarketAnalysisStrategy',
|
| 63 |
'PortfolioOptimizationStrategy',
|
| 64 |
'VentureStrategy',
|
| 65 |
'MonetizationStrategy',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
'UnifiedReasoningEngine',
|
| 67 |
'StrategyType',
|
| 68 |
-
'StrategyResult',
|
| 69 |
'UnifiedResult'
|
| 70 |
]
|
|
|
|
| 26 |
16. Monetization Strategies
|
| 27 |
"""
|
| 28 |
|
| 29 |
+
# Base types and classes
|
| 30 |
+
from .base import ReasoningStrategy, StrategyResult
|
| 31 |
+
|
| 32 |
+
# Core reasoning strategies
|
| 33 |
+
from .chain_of_thought import ChainOfThoughtStrategy
|
| 34 |
+
from .tree_of_thoughts import TreeOfThoughtsStrategy
|
| 35 |
+
from .recursive import RecursiveReasoning
|
| 36 |
+
from .analogical import AnalogicalReasoning
|
| 37 |
+
from .meta_learning import MetaLearningStrategy
|
| 38 |
+
from .local_llm import LocalLLMStrategy
|
| 39 |
+
|
| 40 |
+
# Advanced reasoning strategies
|
| 41 |
from .multimodal import MultiModalReasoning
|
| 42 |
from .bayesian import BayesianReasoning
|
| 43 |
from .quantum import QuantumReasoning
|
| 44 |
from .neurosymbolic import NeurosymbolicReasoning
|
| 45 |
from .emergent import EmergentReasoning
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
from .specialized import SpecializedReasoning
|
| 47 |
+
|
| 48 |
+
# Domain-specific strategies
|
| 49 |
from .market_analysis import MarketAnalysisStrategy
|
| 50 |
from .portfolio_optimization import PortfolioOptimizationStrategy
|
| 51 |
from .venture_strategies import VentureStrategy
|
| 52 |
from .monetization import MonetizationStrategy
|
| 53 |
+
|
| 54 |
+
# Model integrations
|
| 55 |
+
from .groq_strategy import GroqStrategy
|
| 56 |
+
|
| 57 |
+
# Unified engine
|
| 58 |
+
from .unified_engine import UnifiedReasoningEngine, StrategyType, UnifiedResult
|
| 59 |
|
| 60 |
__all__ = [
|
| 61 |
+
# Base types
|
| 62 |
'ReasoningStrategy',
|
| 63 |
+
'StrategyResult',
|
| 64 |
+
|
| 65 |
+
# Core reasoning
|
| 66 |
+
'ChainOfThoughtStrategy',
|
| 67 |
+
'TreeOfThoughtsStrategy',
|
| 68 |
+
'RecursiveReasoning',
|
| 69 |
+
'AnalogicalReasoning',
|
| 70 |
+
'MetaLearningStrategy',
|
| 71 |
+
'LocalLLMStrategy',
|
| 72 |
+
|
| 73 |
+
# Advanced reasoning
|
| 74 |
'MultiModalReasoning',
|
| 75 |
'BayesianReasoning',
|
| 76 |
'QuantumReasoning',
|
| 77 |
'NeurosymbolicReasoning',
|
| 78 |
'EmergentReasoning',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
'SpecializedReasoning',
|
| 80 |
+
|
| 81 |
+
# Domain-specific
|
| 82 |
'MarketAnalysisStrategy',
|
| 83 |
'PortfolioOptimizationStrategy',
|
| 84 |
'VentureStrategy',
|
| 85 |
'MonetizationStrategy',
|
| 86 |
+
|
| 87 |
+
# Model integrations
|
| 88 |
+
'GroqStrategy',
|
| 89 |
+
|
| 90 |
+
# Unified engine
|
| 91 |
'UnifiedReasoningEngine',
|
| 92 |
'StrategyType',
|
|
|
|
| 93 |
'UnifiedResult'
|
| 94 |
]
|
reasoning/unified_engine.py
CHANGED
|
@@ -10,7 +10,7 @@ import asyncio
|
|
| 10 |
from collections import defaultdict
|
| 11 |
import numpy as np
|
| 12 |
|
| 13 |
-
from .base import ReasoningStrategy
|
| 14 |
from .groq_strategy import GroqStrategy
|
| 15 |
from .chain_of_thought import ChainOfThoughtStrategy
|
| 16 |
from .tree_of_thoughts import TreeOfThoughtsStrategy
|
|
@@ -60,18 +60,6 @@ class StrategyType(str, Enum):
|
|
| 60 |
VENTURE = "venture"
|
| 61 |
VENTURE_TYPE = "venture_type"
|
| 62 |
|
| 63 |
-
@dataclass
|
| 64 |
-
class StrategyResult:
|
| 65 |
-
"""Result from a reasoning strategy."""
|
| 66 |
-
strategy_type: StrategyType
|
| 67 |
-
success: bool
|
| 68 |
-
answer: Optional[str]
|
| 69 |
-
confidence: float
|
| 70 |
-
reasoning_trace: List[Dict[str, Any]]
|
| 71 |
-
metadata: Dict[str, Any]
|
| 72 |
-
performance_metrics: Dict[str, Any]
|
| 73 |
-
timestamp: datetime = field(default_factory=datetime.now)
|
| 74 |
-
|
| 75 |
@dataclass
|
| 76 |
class UnifiedResult:
|
| 77 |
"""Combined result from multiple strategies."""
|
|
|
|
| 10 |
from collections import defaultdict
|
| 11 |
import numpy as np
|
| 12 |
|
| 13 |
+
from .base import ReasoningStrategy, StrategyResult
|
| 14 |
from .groq_strategy import GroqStrategy
|
| 15 |
from .chain_of_thought import ChainOfThoughtStrategy
|
| 16 |
from .tree_of_thoughts import TreeOfThoughtsStrategy
|
|
|
|
| 60 |
VENTURE = "venture"
|
| 61 |
VENTURE_TYPE = "venture_type"
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
@dataclass
|
| 64 |
class UnifiedResult:
|
| 65 |
"""Combined result from multiple strategies."""
|