determine 0.0.1__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.
- determine-0.0.1/.gitignore +9 -0
- determine-0.0.1/LICENSE +21 -0
- determine-0.0.1/PKG-INFO +70 -0
- determine-0.0.1/README.md +50 -0
- determine-0.0.1/pyproject.toml +40 -0
- determine-0.0.1/src/determine/__init__.py +13 -0
- determine-0.0.1/src/determine/context.py +25 -0
- determine-0.0.1/test_determine.py +15 -0
determine-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jack
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
determine-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: determine
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Context-aware primitives for AI-assisted decisions in Python.
|
|
5
|
+
Author: Jack
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: ai,decision,generation,inference,llm,procedural,reasoning
|
|
9
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# Determine
|
|
22
|
+
|
|
23
|
+
Determine is an experimental Python library for context-aware AI inference.
|
|
24
|
+
|
|
25
|
+
The goal is to make AI-powered decisions and procedural generation feel like
|
|
26
|
+
normal Python programming primitives.
|
|
27
|
+
|
|
28
|
+
## Planned usage
|
|
29
|
+
|
|
30
|
+
~~~python
|
|
31
|
+
import determine
|
|
32
|
+
|
|
33
|
+
preference = "Chinese"
|
|
34
|
+
|
|
35
|
+
food = determine.choose(
|
|
36
|
+
"What should the user eat?"
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
print(food)
|
|
40
|
+
~~~
|
|
41
|
+
|
|
42
|
+
Determine is designed to automatically understand relevant runtime variables
|
|
43
|
+
and surrounding program context.
|
|
44
|
+
|
|
45
|
+
## Current version
|
|
46
|
+
|
|
47
|
+
Version 0.0.1 contains the first building block of Determine:
|
|
48
|
+
runtime context capture.
|
|
49
|
+
|
|
50
|
+
~~~python
|
|
51
|
+
from determine import capture_context
|
|
52
|
+
|
|
53
|
+
name = "Jack"
|
|
54
|
+
score = 42
|
|
55
|
+
|
|
56
|
+
print(capture_context())
|
|
57
|
+
~~~
|
|
58
|
+
|
|
59
|
+
Future APIs are planned to include:
|
|
60
|
+
|
|
61
|
+
~~~python
|
|
62
|
+
determine.choose(...)
|
|
63
|
+
determine.decide(...)
|
|
64
|
+
determine.generate(...)
|
|
65
|
+
determine.number(...)
|
|
66
|
+
~~~
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
MIT
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Determine
|
|
2
|
+
|
|
3
|
+
Determine is an experimental Python library for context-aware AI inference.
|
|
4
|
+
|
|
5
|
+
The goal is to make AI-powered decisions and procedural generation feel like
|
|
6
|
+
normal Python programming primitives.
|
|
7
|
+
|
|
8
|
+
## Planned usage
|
|
9
|
+
|
|
10
|
+
~~~python
|
|
11
|
+
import determine
|
|
12
|
+
|
|
13
|
+
preference = "Chinese"
|
|
14
|
+
|
|
15
|
+
food = determine.choose(
|
|
16
|
+
"What should the user eat?"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
print(food)
|
|
20
|
+
~~~
|
|
21
|
+
|
|
22
|
+
Determine is designed to automatically understand relevant runtime variables
|
|
23
|
+
and surrounding program context.
|
|
24
|
+
|
|
25
|
+
## Current version
|
|
26
|
+
|
|
27
|
+
Version 0.0.1 contains the first building block of Determine:
|
|
28
|
+
runtime context capture.
|
|
29
|
+
|
|
30
|
+
~~~python
|
|
31
|
+
from determine import capture_context
|
|
32
|
+
|
|
33
|
+
name = "Jack"
|
|
34
|
+
score = 42
|
|
35
|
+
|
|
36
|
+
print(capture_context())
|
|
37
|
+
~~~
|
|
38
|
+
|
|
39
|
+
Future APIs are planned to include:
|
|
40
|
+
|
|
41
|
+
~~~python
|
|
42
|
+
determine.choose(...)
|
|
43
|
+
determine.decide(...)
|
|
44
|
+
determine.generate(...)
|
|
45
|
+
determine.number(...)
|
|
46
|
+
~~~
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
MIT
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "determine"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
description = "Context-aware primitives for AI-assisted decisions in Python."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
|
|
13
|
+
authors = [
|
|
14
|
+
{ name = "Jack" }
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
keywords = [
|
|
18
|
+
"ai",
|
|
19
|
+
"llm",
|
|
20
|
+
"inference",
|
|
21
|
+
"procedural",
|
|
22
|
+
"generation",
|
|
23
|
+
"decision",
|
|
24
|
+
"reasoning"
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
classifiers = [
|
|
28
|
+
"Development Status :: 2 - Pre-Alpha",
|
|
29
|
+
"Intended Audience :: Developers",
|
|
30
|
+
"License :: OSI Approved :: MIT License",
|
|
31
|
+
"Programming Language :: Python :: 3",
|
|
32
|
+
"Programming Language :: Python :: 3.9",
|
|
33
|
+
"Programming Language :: Python :: 3.10",
|
|
34
|
+
"Programming Language :: Python :: 3.11",
|
|
35
|
+
"Programming Language :: Python :: 3.12",
|
|
36
|
+
"Programming Language :: Python :: 3.13"
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[tool.hatch.build.targets.wheel]
|
|
40
|
+
packages = ["src/determine"]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import inspect
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def capture_context(include_private=False):
|
|
5
|
+
"""
|
|
6
|
+
Capture variables from the caller's current Python scope.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
frame = inspect.currentframe()
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
caller = frame.f_back
|
|
13
|
+
variables = dict(caller.f_locals)
|
|
14
|
+
|
|
15
|
+
if not include_private:
|
|
16
|
+
variables = {
|
|
17
|
+
name: value
|
|
18
|
+
for name, value in variables.items()
|
|
19
|
+
if not name.startswith("_")
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return variables
|
|
23
|
+
|
|
24
|
+
finally:
|
|
25
|
+
del frame
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from determine import capture_context
|
|
2
|
+
|
|
3
|
+
food = "Chinese"
|
|
4
|
+
hungry = True
|
|
5
|
+
|
|
6
|
+
context = capture_context()
|
|
7
|
+
|
|
8
|
+
print("Captured context:")
|
|
9
|
+
print(context)
|
|
10
|
+
|
|
11
|
+
assert context["food"] == "Chinese"
|
|
12
|
+
assert context["hungry"] is True
|
|
13
|
+
|
|
14
|
+
print()
|
|
15
|
+
print("Determine works!")
|