pre-reasoning 2.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pre_reasoning/__init__.py +61 -0
- pre_reasoning/checkpoints/__init__.py +1 -0
- pre_reasoning/checkpoints/pre-reasoning-3m-v2.5.safetensors +0 -0
- pre_reasoning/cli.py +9 -0
- pre_reasoning/heuristic.py +744 -0
- pre_reasoning/inference.py +1326 -0
- pre_reasoning/pre_reasoning_v2_5.py +630 -0
- pre_reasoning-2.5.0.dist-info/METADATA +139 -0
- pre_reasoning-2.5.0.dist-info/RECORD +13 -0
- pre_reasoning-2.5.0.dist-info/WHEEL +5 -0
- pre_reasoning-2.5.0.dist-info/entry_points.txt +2 -0
- pre_reasoning-2.5.0.dist-info/licenses/LICENSE +21 -0
- pre_reasoning-2.5.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""Public package API for Pre-Reasoning."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Optional
|
|
6
|
+
|
|
7
|
+
from .pre_reasoning_v2_5 import ReasoningEngineV25
|
|
8
|
+
|
|
9
|
+
ReasoningEngine = ReasoningEngineV25
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"ReasoningEngineV25",
|
|
13
|
+
"ReasoningEngine",
|
|
14
|
+
"analyze",
|
|
15
|
+
"pulse",
|
|
16
|
+
"get_engine",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_engine(
|
|
21
|
+
*,
|
|
22
|
+
checkpoint_path: Optional[str] = None,
|
|
23
|
+
device: str = "auto",
|
|
24
|
+
) -> ReasoningEngineV25:
|
|
25
|
+
"""Create a reasoning engine.
|
|
26
|
+
|
|
27
|
+
The package-level default is auto mode: use neural perception when the
|
|
28
|
+
optional dependencies are installed, otherwise fall back to deterministic
|
|
29
|
+
graph reasoning without torch.
|
|
30
|
+
"""
|
|
31
|
+
return ReasoningEngineV25(
|
|
32
|
+
checkpoint_path=checkpoint_path,
|
|
33
|
+
device=device,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def analyze(
|
|
38
|
+
text: str,
|
|
39
|
+
*,
|
|
40
|
+
checkpoint_path: Optional[str] = None,
|
|
41
|
+
device: str = "auto",
|
|
42
|
+
) -> dict:
|
|
43
|
+
"""Analyze problem text and return a structural trace result."""
|
|
44
|
+
return get_engine(
|
|
45
|
+
checkpoint_path=checkpoint_path,
|
|
46
|
+
device=device,
|
|
47
|
+
).analyze(text)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def pulse(
|
|
51
|
+
original_problem: str,
|
|
52
|
+
response: str,
|
|
53
|
+
*,
|
|
54
|
+
checkpoint_path: Optional[str] = None,
|
|
55
|
+
device: str = "auto",
|
|
56
|
+
) -> dict:
|
|
57
|
+
"""Check whether a draft response addresses detected root blockers."""
|
|
58
|
+
return get_engine(
|
|
59
|
+
checkpoint_path=checkpoint_path,
|
|
60
|
+
device=device,
|
|
61
|
+
).pulse(original_problem, response)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Bundled weights for optional neural perception."""
|
|
Binary file
|