jev-typed-decision 0.1.0__tar.gz
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.
- jev_typed_decision-0.1.0/PKG-INFO +45 -0
- jev_typed_decision-0.1.0/README.md +29 -0
- jev_typed_decision-0.1.0/jev_typed_decision.egg-info/PKG-INFO +45 -0
- jev_typed_decision-0.1.0/jev_typed_decision.egg-info/SOURCES.txt +7 -0
- jev_typed_decision-0.1.0/jev_typed_decision.egg-info/dependency_links.txt +1 -0
- jev_typed_decision-0.1.0/jev_typed_decision.egg-info/top_level.txt +1 -0
- jev_typed_decision-0.1.0/jev_typed_decision.py +47 -0
- jev_typed_decision-0.1.0/pyproject.toml +23 -0
- jev_typed_decision-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jev-typed-decision
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Typed decision records for small local models: parse, verify and route confidence instead of prose. Reference notes: https://jev001.org/
|
|
5
|
+
Author: Jev001 maintainers
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://jev001.org/
|
|
8
|
+
Project-URL: Documentation, https://jev001.org/what-is-jev/
|
|
9
|
+
Project-URL: Guide, https://jev001.org/jev-api/
|
|
10
|
+
Project-URL: Examples, https://jev001.org/jev-use-cases/
|
|
11
|
+
Keywords: llm,decision,confidence,routing,typed-output
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
14
|
+
Requires-Python: >=3.9
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# jev-typed-decision
|
|
18
|
+
|
|
19
|
+
Small models write convincing prose. Convincing prose is not a confidence
|
|
20
|
+
signal. This package keeps a **typed decision record** instead: the answer, a
|
|
21
|
+
numeric confidence, the evidence it leaned on, and what to do when confidence
|
|
22
|
+
is low.
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from jev_typed_decision import record, needs_human
|
|
26
|
+
|
|
27
|
+
rec = record("route to human", 0.42, evidence=["eval-2026-09"])
|
|
28
|
+
needs_human(rec) # True -> escalate instead of acting
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Why
|
|
32
|
+
|
|
33
|
+
Reading the *shape* of a decision beats reading the *sound* of the answer.
|
|
34
|
+
Details, background and worked examples:
|
|
35
|
+
|
|
36
|
+
- [What Jev is](https://jev001.org/what-is-jev/)
|
|
37
|
+
- [Jev API notes](https://jev001.org/jev-api/)
|
|
38
|
+
- [Run Laya locally](https://jev001.org/run-laya-locally/)
|
|
39
|
+
- [Use cases](https://jev001.org/jev-use-cases/)
|
|
40
|
+
- [Home](https://jev001.org/)
|
|
41
|
+
|
|
42
|
+
## Scope
|
|
43
|
+
|
|
44
|
+
Reference helper, stdlib only, no runtime dependencies. Confidence clamping is
|
|
45
|
+
deliberately blunt; calibrate per project.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# jev-typed-decision
|
|
2
|
+
|
|
3
|
+
Small models write convincing prose. Convincing prose is not a confidence
|
|
4
|
+
signal. This package keeps a **typed decision record** instead: the answer, a
|
|
5
|
+
numeric confidence, the evidence it leaned on, and what to do when confidence
|
|
6
|
+
is low.
|
|
7
|
+
|
|
8
|
+
```python
|
|
9
|
+
from jev_typed_decision import record, needs_human
|
|
10
|
+
|
|
11
|
+
rec = record("route to human", 0.42, evidence=["eval-2026-09"])
|
|
12
|
+
needs_human(rec) # True -> escalate instead of acting
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Why
|
|
16
|
+
|
|
17
|
+
Reading the *shape* of a decision beats reading the *sound* of the answer.
|
|
18
|
+
Details, background and worked examples:
|
|
19
|
+
|
|
20
|
+
- [What Jev is](https://jev001.org/what-is-jev/)
|
|
21
|
+
- [Jev API notes](https://jev001.org/jev-api/)
|
|
22
|
+
- [Run Laya locally](https://jev001.org/run-laya-locally/)
|
|
23
|
+
- [Use cases](https://jev001.org/jev-use-cases/)
|
|
24
|
+
- [Home](https://jev001.org/)
|
|
25
|
+
|
|
26
|
+
## Scope
|
|
27
|
+
|
|
28
|
+
Reference helper, stdlib only, no runtime dependencies. Confidence clamping is
|
|
29
|
+
deliberately blunt; calibrate per project.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jev-typed-decision
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Typed decision records for small local models: parse, verify and route confidence instead of prose. Reference notes: https://jev001.org/
|
|
5
|
+
Author: Jev001 maintainers
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://jev001.org/
|
|
8
|
+
Project-URL: Documentation, https://jev001.org/what-is-jev/
|
|
9
|
+
Project-URL: Guide, https://jev001.org/jev-api/
|
|
10
|
+
Project-URL: Examples, https://jev001.org/jev-use-cases/
|
|
11
|
+
Keywords: llm,decision,confidence,routing,typed-output
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
14
|
+
Requires-Python: >=3.9
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# jev-typed-decision
|
|
18
|
+
|
|
19
|
+
Small models write convincing prose. Convincing prose is not a confidence
|
|
20
|
+
signal. This package keeps a **typed decision record** instead: the answer, a
|
|
21
|
+
numeric confidence, the evidence it leaned on, and what to do when confidence
|
|
22
|
+
is low.
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from jev_typed_decision import record, needs_human
|
|
26
|
+
|
|
27
|
+
rec = record("route to human", 0.42, evidence=["eval-2026-09"])
|
|
28
|
+
needs_human(rec) # True -> escalate instead of acting
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Why
|
|
32
|
+
|
|
33
|
+
Reading the *shape* of a decision beats reading the *sound* of the answer.
|
|
34
|
+
Details, background and worked examples:
|
|
35
|
+
|
|
36
|
+
- [What Jev is](https://jev001.org/what-is-jev/)
|
|
37
|
+
- [Jev API notes](https://jev001.org/jev-api/)
|
|
38
|
+
- [Run Laya locally](https://jev001.org/run-laya-locally/)
|
|
39
|
+
- [Use cases](https://jev001.org/jev-use-cases/)
|
|
40
|
+
- [Home](https://jev001.org/)
|
|
41
|
+
|
|
42
|
+
## Scope
|
|
43
|
+
|
|
44
|
+
Reference helper, stdlib only, no runtime dependencies. Confidence clamping is
|
|
45
|
+
deliberately blunt; calibrate per project.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
jev_typed_decision
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Tiny helper: keep a typed decision record instead of scraping model prose.
|
|
2
|
+
|
|
3
|
+
Notes and background: https://jev001.org/
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
__version__ = "0.1.0"
|
|
7
|
+
|
|
8
|
+
FIELDS = ("answer", "confidence", "evidence", "fallback")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def record(answer, confidence, evidence=None, fallback=None):
|
|
12
|
+
"""Build a validated decision record.
|
|
13
|
+
|
|
14
|
+
confidence is a float in [0, 1]; anything outside is clamped and flagged.
|
|
15
|
+
"""
|
|
16
|
+
if not isinstance(answer, str) or not answer.strip():
|
|
17
|
+
raise ValueError("answer must be a non-empty string")
|
|
18
|
+
try:
|
|
19
|
+
confidence = float(confidence)
|
|
20
|
+
except (TypeError, ValueError):
|
|
21
|
+
raise ValueError("confidence must be a number")
|
|
22
|
+
clamped = min(1.0, max(0.0, confidence))
|
|
23
|
+
return {
|
|
24
|
+
"answer": answer.strip(),
|
|
25
|
+
"confidence": clamped,
|
|
26
|
+
"clamped": clamped != confidence,
|
|
27
|
+
"evidence": list(evidence or []),
|
|
28
|
+
"fallback": fallback,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def needs_human(rec, threshold=0.6):
|
|
33
|
+
"""Route low-confidence records to a human instead of acting on them."""
|
|
34
|
+
return rec["confidence"] < threshold
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
if __name__ == "__main__":
|
|
38
|
+
r = record(" ship it ", 1.4, evidence=["eval-2026-09"])
|
|
39
|
+
assert r["confidence"] == 1.0 and r["clamped"] is True
|
|
40
|
+
assert needs_human(record("maybe", 0.31)) is True
|
|
41
|
+
assert needs_human(record("sure", 0.9)) is False
|
|
42
|
+
try:
|
|
43
|
+
record("", 0.5)
|
|
44
|
+
raise AssertionError("empty answer must raise")
|
|
45
|
+
except ValueError:
|
|
46
|
+
pass
|
|
47
|
+
print("self-check ok", r)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "jev-typed-decision"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Typed decision records for small local models: parse, verify and route confidence instead of prose. Reference notes: https://jev001.org/"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [{name = "Jev001 maintainers"}]
|
|
13
|
+
keywords = ["llm", "decision", "confidence", "routing", "typed-output"]
|
|
14
|
+
classifiers = ["Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Artificial Intelligence"]
|
|
15
|
+
|
|
16
|
+
[project.urls]
|
|
17
|
+
Homepage = "https://jev001.org/"
|
|
18
|
+
Documentation = "https://jev001.org/what-is-jev/"
|
|
19
|
+
Guide = "https://jev001.org/jev-api/"
|
|
20
|
+
Examples = "https://jev001.org/jev-use-cases/"
|
|
21
|
+
|
|
22
|
+
[tool.setuptools]
|
|
23
|
+
py-modules = ["jev_typed_decision"]
|