dotpromptz 0.1.2__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.
- dotpromptz-0.1.2/.gitignore +32 -0
- dotpromptz-0.1.2/CHANGELOG.md +167 -0
- dotpromptz-0.1.2/LICENSE +201 -0
- dotpromptz-0.1.2/PKG-INFO +104 -0
- dotpromptz-0.1.2/README.md +73 -0
- dotpromptz-0.1.2/pyproject.toml +71 -0
- dotpromptz-0.1.2/src/dotpromptz/__init__.py +29 -0
- dotpromptz-0.1.2/src/dotpromptz/adapters/__init__.py +4 -0
- dotpromptz-0.1.2/src/dotpromptz/adapters/openai.py +150 -0
- dotpromptz-0.1.2/src/dotpromptz/dotprompt.py +591 -0
- dotpromptz-0.1.2/src/dotpromptz/errors.py +42 -0
- dotpromptz-0.1.2/src/dotpromptz/helpers.py +233 -0
- dotpromptz-0.1.2/src/dotpromptz/models.py +36 -0
- dotpromptz-0.1.2/src/dotpromptz/parse.py +545 -0
- dotpromptz-0.1.2/src/dotpromptz/picoschema.py +387 -0
- dotpromptz-0.1.2/src/dotpromptz/py.typed +0 -0
- dotpromptz-0.1.2/src/dotpromptz/resolvers.py +206 -0
- dotpromptz-0.1.2/src/dotpromptz/stores/__init__.py +59 -0
- dotpromptz-0.1.2/src/dotpromptz/stores/_dir_async.py +546 -0
- dotpromptz-0.1.2/src/dotpromptz/stores/_dir_sync.py +536 -0
- dotpromptz-0.1.2/src/dotpromptz/stores/_io.py +278 -0
- dotpromptz-0.1.2/src/dotpromptz/stores/_testutils.py +160 -0
- dotpromptz-0.1.2/src/dotpromptz/stores/_typing.py +81 -0
- dotpromptz-0.1.2/src/dotpromptz/typing.py +916 -0
- dotpromptz-0.1.2/src/dotpromptz/util.py +73 -0
- dotpromptz-0.1.2/tests/dotpromptz/dotprompt_test.py +563 -0
- dotpromptz-0.1.2/tests/dotpromptz/helpers_test.py +177 -0
- dotpromptz-0.1.2/tests/dotpromptz/models_test.py +43 -0
- dotpromptz-0.1.2/tests/dotpromptz/parse_test.py +769 -0
- dotpromptz-0.1.2/tests/dotpromptz/picoschema_test.py +344 -0
- dotpromptz-0.1.2/tests/dotpromptz/resolvers_test.py +256 -0
- dotpromptz-0.1.2/tests/dotpromptz/spec_test.py +473 -0
- dotpromptz-0.1.2/tests/dotpromptz/stores/dir_async_test.py +371 -0
- dotpromptz-0.1.2/tests/dotpromptz/stores/dir_sync_test.py +353 -0
- dotpromptz-0.1.2/tests/dotpromptz/util_test.py +143 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
*$py.class
|
|
2
|
+
*.egg
|
|
3
|
+
*.egg-info/
|
|
4
|
+
*.py[cod]
|
|
5
|
+
*.so
|
|
6
|
+
.DS_Store
|
|
7
|
+
.Python
|
|
8
|
+
.cache/
|
|
9
|
+
.coverage
|
|
10
|
+
.eggs/
|
|
11
|
+
.genkit
|
|
12
|
+
.idea/
|
|
13
|
+
.installed.cfg
|
|
14
|
+
.mypy_cache/
|
|
15
|
+
.pytest_cache/
|
|
16
|
+
.ruff_cache/
|
|
17
|
+
.venv
|
|
18
|
+
ENV/
|
|
19
|
+
__pycache__/
|
|
20
|
+
build/
|
|
21
|
+
develop-eggs/
|
|
22
|
+
dist/
|
|
23
|
+
downloads/
|
|
24
|
+
eggs/
|
|
25
|
+
lib/
|
|
26
|
+
lib64/
|
|
27
|
+
parts/
|
|
28
|
+
sdist/
|
|
29
|
+
site/
|
|
30
|
+
var/
|
|
31
|
+
venv/
|
|
32
|
+
wheels/
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.2](https://github.com/google/dotprompt/compare/dotpromptz-0.1.1...dotpromptz-0.1.2) (2025-10-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add implementation of helpers and util modules; move interfaces into dotpromptz project ([#73](https://github.com/google/dotprompt/issues/73)) ([8c7aea1](https://github.com/google/dotprompt/commit/8c7aea1faffaf823d01b132e55cb175a4fca5ccb))
|
|
9
|
+
* add stub spec_test.py and script to monitor tests. ([#138](https://github.com/google/dotprompt/issues/138)) ([65966e9](https://github.com/google/dotprompt/commit/65966e9bfc077e85d0b83d04d0384150470dbfd3))
|
|
10
|
+
* **go/parse:** parse.go implementation [#62](https://github.com/google/dotprompt/issues/62) ([#87](https://github.com/google/dotprompt/issues/87)) ([d5dc13c](https://github.com/google/dotprompt/commit/d5dc13c0bf0437875a3b133511ffed474a8b3bf9))
|
|
11
|
+
* parseDocument python ([#80](https://github.com/google/dotprompt/issues/80)) ([82ebc36](https://github.com/google/dotprompt/commit/82ebc3672e8de051dfbdd92968ed3f84c79a247f))
|
|
12
|
+
* partial test runner implementation now loads tests ([#139](https://github.com/google/dotprompt/issues/139)) ([b09dd2f](https://github.com/google/dotprompt/commit/b09dd2f9b8029317ce484d6f32d5a3fb89f5f7e1))
|
|
13
|
+
* Port JS types to Python ([#65](https://github.com/google/dotprompt/issues/65)) ([edcb037](https://github.com/google/dotprompt/commit/edcb03765f3cb6e5743d107a35cf255a60ab0369))
|
|
14
|
+
* **py/dotprompt:** render and compile implementations ([#263](https://github.com/google/dotprompt/issues/263)) ([961d0db](https://github.com/google/dotprompt/commit/961d0dbbd9c2ce522252bc3d92f6dde4b7fe9cc1))
|
|
15
|
+
* **py/dotpromptz:** _resolve_metadata for dotprompt ([#226](https://github.com/google/dotprompt/issues/226)) ([cfcc87b](https://github.com/google/dotprompt/commit/cfcc87b57e49785c2356b03fbc5b7bf773472683))
|
|
16
|
+
* **py/dotpromptz:** add initial Dotprompt._resolve_json_schema implementation ([#217](https://github.com/google/dotprompt/issues/217)) ([0b62136](https://github.com/google/dotprompt/commit/0b621363a394c6b5c0fac6a957098eccff6891ca))
|
|
17
|
+
* **py/dotpromptz:** add initial Dotprompt._resolve_partials implementation ([#215](https://github.com/google/dotprompt/issues/215)) ([03a161c](https://github.com/google/dotprompt/commit/03a161c3440a680bc0df472f35efa155fe0d5151))
|
|
18
|
+
* **py/dotpromptz:** add initial Dotprompt._resolve_tools implementation and raise ValueError when resolver is None ([#214](https://github.com/google/dotprompt/issues/214)) ([57caf5d](https://github.com/google/dotprompt/commit/57caf5d9a9f4fe720c67f99fd10439d5ebe434dc))
|
|
19
|
+
* **py/dotpromptz:** add resolve_json_schema and test case for ResolverCallable that returns an asyncio.Future ([#211](https://github.com/google/dotprompt/issues/211)) ([7bbe80d](https://github.com/google/dotprompt/commit/7bbe80d6a1d9dc18c4d1baacfccf2f33fc8b7e26))
|
|
20
|
+
* **py/dotpromptz:** add resolvers module ([#207](https://github.com/google/dotprompt/issues/207)) ([826f257](https://github.com/google/dotprompt/commit/826f2572e710cebd0138bd757d2bef2e4898d730))
|
|
21
|
+
* **py/dotpromptz:** because the Picoschema parser can resolve schemas at runtime, we make it an async implementation ([#220](https://github.com/google/dotprompt/issues/220)) ([ae285a8](https://github.com/google/dotprompt/commit/ae285a88f3502e0a02c85d04c49c2e2e6ef88766))
|
|
22
|
+
* **py/dotpromptz:** configure handlebars to not escape by default ([#163](https://github.com/google/dotprompt/issues/163)) ([f7c33e1](https://github.com/google/dotprompt/commit/f7c33e1303476fd473e803f930ac1e1f9e1d87c9))
|
|
23
|
+
* **py/dotpromptz:** construct test-specific dotprompt instance with partials and partial resolver set up ([#275](https://github.com/google/dotprompt/issues/275)) ([0af9a64](https://github.com/google/dotprompt/commit/0af9a64acf50278bdffda337e19c66fbb97e43a3))
|
|
24
|
+
* **py/dotpromptz:** directory-based async and sync implementations of PromptStore and PromptStoreWritable ([#164](https://github.com/google/dotprompt/issues/164)) ([ac92fbf](https://github.com/google/dotprompt/commit/ac92fbf3af7ac3207102c94c20d294d8c54b9dd4))
|
|
25
|
+
* **py/dotpromptz:** Dotprompt.{render|compile} with CompileRenderer stub ([#248](https://github.com/google/dotprompt/issues/248)) ([61c578c](https://github.com/google/dotprompt/commit/61c578cf43ac490f8076306a8e2b5eb0ae15f385))
|
|
26
|
+
* **py/dotpromptz:** implement helpers in terms of the rust implementation of handlebars-rust and fix go flakiness ([#115](https://github.com/google/dotprompt/issues/115)) ([314c0b5](https://github.com/google/dotprompt/commit/314c0b5182aaad25bf4cfccb8207faa60f63256f))
|
|
27
|
+
* **py/dotpromptz:** initial bits of Dotprompt class ([#148](https://github.com/google/dotprompt/issues/148)) ([90f7838](https://github.com/google/dotprompt/commit/90f78384a958d41d78dee48497a78dfde11f4476))
|
|
28
|
+
* **py/dotpromptz:** render_metadata implementation and associated tests ([#229](https://github.com/google/dotprompt/issues/229)) ([e66dc45](https://github.com/google/dotprompt/commit/e66dc453c718222e1633be951923a35335296dd5))
|
|
29
|
+
* **py/dotpromptz:** simpler spec test runner harness ([#266](https://github.com/google/dotprompt/issues/266)) ([89378bf](https://github.com/google/dotprompt/commit/89378bfded004f3b246c90f6474c2fb972037956))
|
|
30
|
+
* **py/dotpromptz:** test harness that creates suites and test case methods dynamically ([#279](https://github.com/google/dotprompt/issues/279)) ([1dc2bda](https://github.com/google/dotprompt/commit/1dc2bdac5de513cb41d32905d20069ab29307a72))
|
|
31
|
+
* **py/dotpromptz:** translate render_metadata for dotprompt.py from ts ([#227](https://github.com/google/dotprompt/issues/227)) ([ae1919b](https://github.com/google/dotprompt/commit/ae1919b3457824241c734fdf8328f61279fb6710))
|
|
32
|
+
* **py/dotpromptz:** use async picoschema_to_json_schema in dotprompt._render_picoschema ([#221](https://github.com/google/dotprompt/issues/221)) ([072d95d](https://github.com/google/dotprompt/commit/072d95deb01d9b09a7f60d9f6b3fb53a8067e497))
|
|
33
|
+
* **py:** add SafeString implementation that works with js2py ([#104](https://github.com/google/dotprompt/issues/104)) ([1ebeca3](https://github.com/google/dotprompt/commit/1ebeca3976faf2dc91d8d7f4a74c218824aac353))
|
|
34
|
+
* **py:** fix picoschema spec test ([#303](https://github.com/google/dotprompt/issues/303)) ([73439c1](https://github.com/google/dotprompt/commit/73439c183f557d7bb67b9cbc060e5602c219fc68))
|
|
35
|
+
* **py:** implement identify_partials in terms of regexps since we do not have an AST to walk [#90](https://github.com/google/dotprompt/issues/90) ([#150](https://github.com/google/dotprompt/issues/150)) ([f802275](https://github.com/google/dotprompt/commit/f8022755d7eef716bbb54dd08a2c3a061250d393))
|
|
36
|
+
* **py:** implementation of parse.py; refactor parse.ts and update tests. ([#79](https://github.com/google/dotprompt/issues/79)) ([47e7245](https://github.com/google/dotprompt/commit/47e7245c0aae710b102178019d1f3449c2f1af66))
|
|
37
|
+
* **py:** local variables support workaround ([#318](https://github.com/google/dotprompt/issues/318)) ([d09598b](https://github.com/google/dotprompt/commit/d09598b969d5dbeaed3ca4136e903b4a2dc80531))
|
|
38
|
+
* python implementations of helpers ([#129](https://github.com/google/dotprompt/issues/129)) ([79c6ef3](https://github.com/google/dotprompt/commit/79c6ef3e9cc472fed3a832c00a1515ceef0981da))
|
|
39
|
+
* python: implement spec test logic ([#285](https://github.com/google/dotprompt/issues/285)) ([944f1fe](https://github.com/google/dotprompt/commit/944f1fee3e0e1f4f8bcd3c9bc4f6104ffbe17f2c))
|
|
40
|
+
* python: picoschema support ISSUE: [#36](https://github.com/google/dotprompt/issues/36) CHANGELOG: - [x] Port relevant functionality - [x] Add tests ([#95](https://github.com/google/dotprompt/issues/95)) ([0da188c](https://github.com/google/dotprompt/commit/0da188c52540f041309e39fa6bc798eaf7fd7a81))
|
|
41
|
+
* **python:** add OpenAI adapter implementation for dotprompt [#38](https://github.com/google/dotprompt/issues/38) ([#97](https://github.com/google/dotprompt/issues/97)) ([d171f87](https://github.com/google/dotprompt/commit/d171f8792ecf08f446e18ea3bbd5309cafa1d8a3))
|
|
42
|
+
* **python:** support lower versions of python (>=3.10) ([#187](https://github.com/google/dotprompt/issues/187)) ([4240f9d](https://github.com/google/dotprompt/commit/4240f9d720891e350f9116aa4401ce6ea7fac5a3))
|
|
43
|
+
* **py:** utility function to unquote a string literal coming from js2py handlebars helpers ([#107](https://github.com/google/dotprompt/issues/107)) ([b3672ca](https://github.com/google/dotprompt/commit/b3672ca6192de4895585b28b8bbd301f8294090f))
|
|
44
|
+
* **py:** utility to remove undefined fields from dicts/lists recursively ([#105](https://github.com/google/dotprompt/issues/105)) ([d25c911](https://github.com/google/dotprompt/commit/d25c911bc1e84e5691b961a4c38a8bcd73c80aa0))
|
|
45
|
+
* use the HEAD version of addlicense ([#280](https://github.com/google/dotprompt/issues/280)) ([bdf0d36](https://github.com/google/dotprompt/commit/bdf0d36a430a363de4163f48394546cba884eaaf))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Bug Fixes
|
|
49
|
+
|
|
50
|
+
* change project name for pypi publish ([#200](https://github.com/google/dotprompt/issues/200)) ([2c07132](https://github.com/google/dotprompt/commit/2c0713264fb2c30bdc43f1bd9e51d416f96d1b7e))
|
|
51
|
+
* **docs:** add documentation explaining yaml spec test format and revert typo ([#267](https://github.com/google/dotprompt/issues/267)) ([20cd71b](https://github.com/google/dotprompt/commit/20cd71bd68c9ec28de7264a72d495ff636e62cff))
|
|
52
|
+
* **docs:** update docs for helpers.py functions ([#118](https://github.com/google/dotprompt/issues/118)) ([40f74d4](https://github.com/google/dotprompt/commit/40f74d4cf75a47d8b7f9f85801a1bb5969bae082))
|
|
53
|
+
* **docs:** update helper docs ([#132](https://github.com/google/dotprompt/issues/132)) ([9b84245](https://github.com/google/dotprompt/commit/9b842459e8faa5f4afe7d389deb6c351ab1271be))
|
|
54
|
+
* **go,py:** type fixes and ensure we build/lint the go code in hooks and ci ([#83](https://github.com/google/dotprompt/issues/83)) ([19a8257](https://github.com/google/dotprompt/commit/19a8257f4f73b776229d5324a0366fd9a79c20aa))
|
|
55
|
+
* **helpers:** use ctx instead of hash to get the fn and inverse ([#131](https://github.com/google/dotprompt/issues/131)) ([8749d1f](https://github.com/google/dotprompt/commit/8749d1f78ee754742ae7fcc9247854021178bdbc))
|
|
56
|
+
* **js:** clean up redundant call to register helpers that have already been registered ([#261](https://github.com/google/dotprompt/issues/261)) ([84e3c0c](https://github.com/google/dotprompt/commit/84e3c0cfd8da3b0292eebb2fe8a771fe41d09038))
|
|
57
|
+
* **license:** use the full license header in source code ([#142](https://github.com/google/dotprompt/issues/142)) ([64894ef](https://github.com/google/dotprompt/commit/64894ef898876b861c6c244d522f634cd8fcc842))
|
|
58
|
+
* **py/dotpromptz:** add todo about caching resolved schema for later ([#223](https://github.com/google/dotprompt/issues/223)) ([728dbaa](https://github.com/google/dotprompt/commit/728dbaaef1d0569148426a97242edd1f8064cdbe))
|
|
59
|
+
* **py/dotpromptz:** add unit tests for resolver and fix sync resolver error handling ([#208](https://github.com/google/dotprompt/issues/208)) ([5e04e28](https://github.com/google/dotprompt/commit/5e04e28c99eff0f83c9c8a15df5ef56ff3ebd85f))
|
|
60
|
+
* **py/dotpromptz:** address compatibility with python 3.10 and add tox configuration for parallelized tests ([#188](https://github.com/google/dotprompt/issues/188)) ([d2ba21f](https://github.com/google/dotprompt/commit/d2ba21ff3e54f4ca4328b7e574bb6492699095bc))
|
|
61
|
+
* **py/dotpromptz:** dotprompt.define_tool takes just a tool def ([#224](https://github.com/google/dotprompt/issues/224)) ([72039fc](https://github.com/google/dotprompt/commit/72039fc689d82344bfc1300345059340603404bc))
|
|
62
|
+
* **py/dotpromptz:** ensure parser handles {CR, CRLF, LF} line endings ([#256](https://github.com/google/dotprompt/issues/256)) ([18cff7a](https://github.com/google/dotprompt/commit/18cff7af50860c46fb37a2fa9c373bd410f11701))
|
|
63
|
+
* **py/dotpromptz:** fix broken picoschema parser tests ([#232](https://github.com/google/dotprompt/issues/232)) ([4d154aa](https://github.com/google/dotprompt/commit/4d154aaae99f2f31500d86ed6191a05298700b91))
|
|
64
|
+
* **py/dotpromptz:** fix pydantic warnings and tabulate the various types in typing.py ([#196](https://github.com/google/dotprompt/issues/196)) ([24dcfdd](https://github.com/google/dotprompt/commit/24dcfdd320884452ee48fca859619b400fe61327))
|
|
65
|
+
* **py/dotpromptz:** make resolver concrete in resolve, resolve_tool, and resolve_partial ([#210](https://github.com/google/dotprompt/issues/210)) ([3730190](https://github.com/google/dotprompt/commit/37301903c8f26f1b8363ad1f2d515a6df19303e2))
|
|
66
|
+
* **py/dotpromptz:** register initial helpers and partials correctly ([#260](https://github.com/google/dotprompt/issues/260)) ([0752865](https://github.com/google/dotprompt/commit/0752865b415c6cc90c87e3113b537632a52e3423))
|
|
67
|
+
* **py/dotpromptz:** registering partials and start rendering some specs ([#269](https://github.com/google/dotprompt/issues/269)) ([aff3c4b](https://github.com/google/dotprompt/commit/aff3c4b9ee548e61268ca070f6660d51c860619d))
|
|
68
|
+
* **py/dotpromptz:** remove stray reference to inspect.isasyncgenfunction since we dont deal with those as resolvers ([#216](https://github.com/google/dotprompt/issues/216)) ([c300515](https://github.com/google/dotprompt/commit/c3005159aea0af906e3f704d03fd5859a9540d4f))
|
|
69
|
+
* **py/dotpromptz:** remove unused Options type from dotprompt.py and fix typo ([#213](https://github.com/google/dotprompt/issues/213)) ([ae59431](https://github.com/google/dotprompt/commit/ae5943179e77aa6fa775d092254d8adf21b06eb2))
|
|
70
|
+
* **py/dotpromptz:** some lint and add docstrings ([#235](https://github.com/google/dotprompt/issues/235)) ([2e1c893](https://github.com/google/dotprompt/commit/2e1c893bbbe7c29480d67e2d693db90e9bef9b1b))
|
|
71
|
+
* **py/handlebarrz:** helpers support in handlebarrz ([#291](https://github.com/google/dotprompt/issues/291)) ([d5d66a3](https://github.com/google/dotprompt/commit/d5d66a35858a068c2995b82fe54b62f0be4d057f))
|
|
72
|
+
* **py/spec_test:** hex-encoded SHA-256 digest rather than base64-encoded SHA-256 digest for module IDs ([#140](https://github.com/google/dotprompt/issues/140)) ([796c644](https://github.com/google/dotprompt/commit/796c6442a3c1836de2170c466966382a0577a940))
|
|
73
|
+
* **py:** lint reporting missing docstrings in test files ([#199](https://github.com/google/dotprompt/issues/199)) ([4d91514](https://github.com/google/dotprompt/commit/4d9151468ddd13f334454701daae42d5717d4dcf))
|
|
74
|
+
* **py:** metadata purpose support ([#296](https://github.com/google/dotprompt/issues/296)) ([4a0f436](https://github.com/google/dotprompt/commit/4a0f436f1420f738d4fb46a4e5f41129929fb0fd))
|
|
75
|
+
* remove spurious role type `assistant` ([#169](https://github.com/google/dotprompt/issues/169)) ([1b5142c](https://github.com/google/dotprompt/commit/1b5142c4a7ad20ef722d438cefa0b93a82d7adbb))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### Documentation
|
|
79
|
+
|
|
80
|
+
* add initial mkdocs documentation for eng [#43](https://github.com/google/dotprompt/issues/43) ([#44](https://github.com/google/dotprompt/issues/44)) ([31be336](https://github.com/google/dotprompt/commit/31be336d14899acf7ea1cefb4b782f5b2d1c31d1))
|
|
81
|
+
* **py/dotpromptz:** document awaitable type hierarchy as ASCII diagram in comments to make code readable ([#212](https://github.com/google/dotprompt/issues/212)) ([0926749](https://github.com/google/dotprompt/commit/0926749e72d17264b8078151b10f616a906cfd66))
|
|
82
|
+
* **py:** add docstring to parse.py and dotprompt.py modules. ([#246](https://github.com/google/dotprompt/issues/246)) ([c9d53bb](https://github.com/google/dotprompt/commit/c9d53bb3cad96f9d8ef5778ada93ee65276afa09))
|
|
83
|
+
* **py:** add documentation for the resolvers module ([#209](https://github.com/google/dotprompt/issues/209)) ([04b6691](https://github.com/google/dotprompt/commit/04b6691227ef5b01ebf5261d4846a3ba7e723ab2))
|
|
84
|
+
* **py:** ascii diagrams to explain the relationships between the types for easy visualization ([#197](https://github.com/google/dotprompt/issues/197)) ([6d775c4](https://github.com/google/dotprompt/commit/6d775c4bf1301c63d111b0d45db53dba61117555))
|
|
85
|
+
|
|
86
|
+
## [0.1.1](https://github.com/google/dotprompt/compare/dotpromptz-v0.1.0...dotpromptz-0.1.1) (2025-10-24)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Features
|
|
90
|
+
|
|
91
|
+
* add implementation of helpers and util modules; move interfaces into dotpromptz project ([#73](https://github.com/google/dotprompt/issues/73)) ([8c7aea1](https://github.com/google/dotprompt/commit/8c7aea1faffaf823d01b132e55cb175a4fca5ccb))
|
|
92
|
+
* add stub spec_test.py and script to monitor tests. ([#138](https://github.com/google/dotprompt/issues/138)) ([65966e9](https://github.com/google/dotprompt/commit/65966e9bfc077e85d0b83d04d0384150470dbfd3))
|
|
93
|
+
* **go/parse:** parse.go implementation [#62](https://github.com/google/dotprompt/issues/62) ([#87](https://github.com/google/dotprompt/issues/87)) ([d5dc13c](https://github.com/google/dotprompt/commit/d5dc13c0bf0437875a3b133511ffed474a8b3bf9))
|
|
94
|
+
* parseDocument python ([#80](https://github.com/google/dotprompt/issues/80)) ([82ebc36](https://github.com/google/dotprompt/commit/82ebc3672e8de051dfbdd92968ed3f84c79a247f))
|
|
95
|
+
* partial test runner implementation now loads tests ([#139](https://github.com/google/dotprompt/issues/139)) ([b09dd2f](https://github.com/google/dotprompt/commit/b09dd2f9b8029317ce484d6f32d5a3fb89f5f7e1))
|
|
96
|
+
* Port JS types to Python ([#65](https://github.com/google/dotprompt/issues/65)) ([edcb037](https://github.com/google/dotprompt/commit/edcb03765f3cb6e5743d107a35cf255a60ab0369))
|
|
97
|
+
* **py/dotprompt:** render and compile implementations ([#263](https://github.com/google/dotprompt/issues/263)) ([961d0db](https://github.com/google/dotprompt/commit/961d0dbbd9c2ce522252bc3d92f6dde4b7fe9cc1))
|
|
98
|
+
* **py/dotpromptz:** _resolve_metadata for dotprompt ([#226](https://github.com/google/dotprompt/issues/226)) ([cfcc87b](https://github.com/google/dotprompt/commit/cfcc87b57e49785c2356b03fbc5b7bf773472683))
|
|
99
|
+
* **py/dotpromptz:** add initial Dotprompt._resolve_json_schema implementation ([#217](https://github.com/google/dotprompt/issues/217)) ([0b62136](https://github.com/google/dotprompt/commit/0b621363a394c6b5c0fac6a957098eccff6891ca))
|
|
100
|
+
* **py/dotpromptz:** add initial Dotprompt._resolve_partials implementation ([#215](https://github.com/google/dotprompt/issues/215)) ([03a161c](https://github.com/google/dotprompt/commit/03a161c3440a680bc0df472f35efa155fe0d5151))
|
|
101
|
+
* **py/dotpromptz:** add initial Dotprompt._resolve_tools implementation and raise ValueError when resolver is None ([#214](https://github.com/google/dotprompt/issues/214)) ([57caf5d](https://github.com/google/dotprompt/commit/57caf5d9a9f4fe720c67f99fd10439d5ebe434dc))
|
|
102
|
+
* **py/dotpromptz:** add resolve_json_schema and test case for ResolverCallable that returns an asyncio.Future ([#211](https://github.com/google/dotprompt/issues/211)) ([7bbe80d](https://github.com/google/dotprompt/commit/7bbe80d6a1d9dc18c4d1baacfccf2f33fc8b7e26))
|
|
103
|
+
* **py/dotpromptz:** add resolvers module ([#207](https://github.com/google/dotprompt/issues/207)) ([826f257](https://github.com/google/dotprompt/commit/826f2572e710cebd0138bd757d2bef2e4898d730))
|
|
104
|
+
* **py/dotpromptz:** because the Picoschema parser can resolve schemas at runtime, we make it an async implementation ([#220](https://github.com/google/dotprompt/issues/220)) ([ae285a8](https://github.com/google/dotprompt/commit/ae285a88f3502e0a02c85d04c49c2e2e6ef88766))
|
|
105
|
+
* **py/dotpromptz:** configure handlebars to not escape by default ([#163](https://github.com/google/dotprompt/issues/163)) ([f7c33e1](https://github.com/google/dotprompt/commit/f7c33e1303476fd473e803f930ac1e1f9e1d87c9))
|
|
106
|
+
* **py/dotpromptz:** construct test-specific dotprompt instance with partials and partial resolver set up ([#275](https://github.com/google/dotprompt/issues/275)) ([0af9a64](https://github.com/google/dotprompt/commit/0af9a64acf50278bdffda337e19c66fbb97e43a3))
|
|
107
|
+
* **py/dotpromptz:** directory-based async and sync implementations of PromptStore and PromptStoreWritable ([#164](https://github.com/google/dotprompt/issues/164)) ([ac92fbf](https://github.com/google/dotprompt/commit/ac92fbf3af7ac3207102c94c20d294d8c54b9dd4))
|
|
108
|
+
* **py/dotpromptz:** Dotprompt.{render|compile} with CompileRenderer stub ([#248](https://github.com/google/dotprompt/issues/248)) ([61c578c](https://github.com/google/dotprompt/commit/61c578cf43ac490f8076306a8e2b5eb0ae15f385))
|
|
109
|
+
* **py/dotpromptz:** implement helpers in terms of the rust implementation of handlebars-rust and fix go flakiness ([#115](https://github.com/google/dotprompt/issues/115)) ([314c0b5](https://github.com/google/dotprompt/commit/314c0b5182aaad25bf4cfccb8207faa60f63256f))
|
|
110
|
+
* **py/dotpromptz:** initial bits of Dotprompt class ([#148](https://github.com/google/dotprompt/issues/148)) ([90f7838](https://github.com/google/dotprompt/commit/90f78384a958d41d78dee48497a78dfde11f4476))
|
|
111
|
+
* **py/dotpromptz:** render_metadata implementation and associated tests ([#229](https://github.com/google/dotprompt/issues/229)) ([e66dc45](https://github.com/google/dotprompt/commit/e66dc453c718222e1633be951923a35335296dd5))
|
|
112
|
+
* **py/dotpromptz:** simpler spec test runner harness ([#266](https://github.com/google/dotprompt/issues/266)) ([89378bf](https://github.com/google/dotprompt/commit/89378bfded004f3b246c90f6474c2fb972037956))
|
|
113
|
+
* **py/dotpromptz:** test harness that creates suites and test case methods dynamically ([#279](https://github.com/google/dotprompt/issues/279)) ([1dc2bda](https://github.com/google/dotprompt/commit/1dc2bdac5de513cb41d32905d20069ab29307a72))
|
|
114
|
+
* **py/dotpromptz:** translate render_metadata for dotprompt.py from ts ([#227](https://github.com/google/dotprompt/issues/227)) ([ae1919b](https://github.com/google/dotprompt/commit/ae1919b3457824241c734fdf8328f61279fb6710))
|
|
115
|
+
* **py/dotpromptz:** use async picoschema_to_json_schema in dotprompt._render_picoschema ([#221](https://github.com/google/dotprompt/issues/221)) ([072d95d](https://github.com/google/dotprompt/commit/072d95deb01d9b09a7f60d9f6b3fb53a8067e497))
|
|
116
|
+
* **py:** add SafeString implementation that works with js2py ([#104](https://github.com/google/dotprompt/issues/104)) ([1ebeca3](https://github.com/google/dotprompt/commit/1ebeca3976faf2dc91d8d7f4a74c218824aac353))
|
|
117
|
+
* **py:** fix picoschema spec test ([#303](https://github.com/google/dotprompt/issues/303)) ([73439c1](https://github.com/google/dotprompt/commit/73439c183f557d7bb67b9cbc060e5602c219fc68))
|
|
118
|
+
* **py:** implement identify_partials in terms of regexps since we do not have an AST to walk [#90](https://github.com/google/dotprompt/issues/90) ([#150](https://github.com/google/dotprompt/issues/150)) ([f802275](https://github.com/google/dotprompt/commit/f8022755d7eef716bbb54dd08a2c3a061250d393))
|
|
119
|
+
* **py:** implementation of parse.py; refactor parse.ts and update tests. ([#79](https://github.com/google/dotprompt/issues/79)) ([47e7245](https://github.com/google/dotprompt/commit/47e7245c0aae710b102178019d1f3449c2f1af66))
|
|
120
|
+
* **py:** local variables support workaround ([#318](https://github.com/google/dotprompt/issues/318)) ([d09598b](https://github.com/google/dotprompt/commit/d09598b969d5dbeaed3ca4136e903b4a2dc80531))
|
|
121
|
+
* python implementations of helpers ([#129](https://github.com/google/dotprompt/issues/129)) ([79c6ef3](https://github.com/google/dotprompt/commit/79c6ef3e9cc472fed3a832c00a1515ceef0981da))
|
|
122
|
+
* python: implement spec test logic ([#285](https://github.com/google/dotprompt/issues/285)) ([944f1fe](https://github.com/google/dotprompt/commit/944f1fee3e0e1f4f8bcd3c9bc4f6104ffbe17f2c))
|
|
123
|
+
* python: picoschema support ISSUE: [#36](https://github.com/google/dotprompt/issues/36) CHANGELOG: - [x] Port relevant functionality - [x] Add tests ([#95](https://github.com/google/dotprompt/issues/95)) ([0da188c](https://github.com/google/dotprompt/commit/0da188c52540f041309e39fa6bc798eaf7fd7a81))
|
|
124
|
+
* **python:** add OpenAI adapter implementation for dotprompt [#38](https://github.com/google/dotprompt/issues/38) ([#97](https://github.com/google/dotprompt/issues/97)) ([d171f87](https://github.com/google/dotprompt/commit/d171f8792ecf08f446e18ea3bbd5309cafa1d8a3))
|
|
125
|
+
* **python:** support lower versions of python (>=3.10) ([#187](https://github.com/google/dotprompt/issues/187)) ([4240f9d](https://github.com/google/dotprompt/commit/4240f9d720891e350f9116aa4401ce6ea7fac5a3))
|
|
126
|
+
* **py:** utility function to unquote a string literal coming from js2py handlebars helpers ([#107](https://github.com/google/dotprompt/issues/107)) ([b3672ca](https://github.com/google/dotprompt/commit/b3672ca6192de4895585b28b8bbd301f8294090f))
|
|
127
|
+
* **py:** utility to remove undefined fields from dicts/lists recursively ([#105](https://github.com/google/dotprompt/issues/105)) ([d25c911](https://github.com/google/dotprompt/commit/d25c911bc1e84e5691b961a4c38a8bcd73c80aa0))
|
|
128
|
+
* use the HEAD version of addlicense ([#280](https://github.com/google/dotprompt/issues/280)) ([bdf0d36](https://github.com/google/dotprompt/commit/bdf0d36a430a363de4163f48394546cba884eaaf))
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
### Bug Fixes
|
|
132
|
+
|
|
133
|
+
* change project name for pypi publish ([#200](https://github.com/google/dotprompt/issues/200)) ([2c07132](https://github.com/google/dotprompt/commit/2c0713264fb2c30bdc43f1bd9e51d416f96d1b7e))
|
|
134
|
+
* **docs:** add documentation explaining yaml spec test format and revert typo ([#267](https://github.com/google/dotprompt/issues/267)) ([20cd71b](https://github.com/google/dotprompt/commit/20cd71bd68c9ec28de7264a72d495ff636e62cff))
|
|
135
|
+
* **docs:** update docs for helpers.py functions ([#118](https://github.com/google/dotprompt/issues/118)) ([40f74d4](https://github.com/google/dotprompt/commit/40f74d4cf75a47d8b7f9f85801a1bb5969bae082))
|
|
136
|
+
* **docs:** update helper docs ([#132](https://github.com/google/dotprompt/issues/132)) ([9b84245](https://github.com/google/dotprompt/commit/9b842459e8faa5f4afe7d389deb6c351ab1271be))
|
|
137
|
+
* **go,py:** type fixes and ensure we build/lint the go code in hooks and ci ([#83](https://github.com/google/dotprompt/issues/83)) ([19a8257](https://github.com/google/dotprompt/commit/19a8257f4f73b776229d5324a0366fd9a79c20aa))
|
|
138
|
+
* **helpers:** use ctx instead of hash to get the fn and inverse ([#131](https://github.com/google/dotprompt/issues/131)) ([8749d1f](https://github.com/google/dotprompt/commit/8749d1f78ee754742ae7fcc9247854021178bdbc))
|
|
139
|
+
* **js:** clean up redundant call to register helpers that have already been registered ([#261](https://github.com/google/dotprompt/issues/261)) ([84e3c0c](https://github.com/google/dotprompt/commit/84e3c0cfd8da3b0292eebb2fe8a771fe41d09038))
|
|
140
|
+
* **license:** use the full license header in source code ([#142](https://github.com/google/dotprompt/issues/142)) ([64894ef](https://github.com/google/dotprompt/commit/64894ef898876b861c6c244d522f634cd8fcc842))
|
|
141
|
+
* **py/dotpromptz:** add todo about caching resolved schema for later ([#223](https://github.com/google/dotprompt/issues/223)) ([728dbaa](https://github.com/google/dotprompt/commit/728dbaaef1d0569148426a97242edd1f8064cdbe))
|
|
142
|
+
* **py/dotpromptz:** add unit tests for resolver and fix sync resolver error handling ([#208](https://github.com/google/dotprompt/issues/208)) ([5e04e28](https://github.com/google/dotprompt/commit/5e04e28c99eff0f83c9c8a15df5ef56ff3ebd85f))
|
|
143
|
+
* **py/dotpromptz:** address compatibility with python 3.10 and add tox configuration for parallelized tests ([#188](https://github.com/google/dotprompt/issues/188)) ([d2ba21f](https://github.com/google/dotprompt/commit/d2ba21ff3e54f4ca4328b7e574bb6492699095bc))
|
|
144
|
+
* **py/dotpromptz:** dotprompt.define_tool takes just a tool def ([#224](https://github.com/google/dotprompt/issues/224)) ([72039fc](https://github.com/google/dotprompt/commit/72039fc689d82344bfc1300345059340603404bc))
|
|
145
|
+
* **py/dotpromptz:** ensure parser handles {CR, CRLF, LF} line endings ([#256](https://github.com/google/dotprompt/issues/256)) ([18cff7a](https://github.com/google/dotprompt/commit/18cff7af50860c46fb37a2fa9c373bd410f11701))
|
|
146
|
+
* **py/dotpromptz:** fix broken picoschema parser tests ([#232](https://github.com/google/dotprompt/issues/232)) ([4d154aa](https://github.com/google/dotprompt/commit/4d154aaae99f2f31500d86ed6191a05298700b91))
|
|
147
|
+
* **py/dotpromptz:** fix pydantic warnings and tabulate the various types in typing.py ([#196](https://github.com/google/dotprompt/issues/196)) ([24dcfdd](https://github.com/google/dotprompt/commit/24dcfdd320884452ee48fca859619b400fe61327))
|
|
148
|
+
* **py/dotpromptz:** make resolver concrete in resolve, resolve_tool, and resolve_partial ([#210](https://github.com/google/dotprompt/issues/210)) ([3730190](https://github.com/google/dotprompt/commit/37301903c8f26f1b8363ad1f2d515a6df19303e2))
|
|
149
|
+
* **py/dotpromptz:** register initial helpers and partials correctly ([#260](https://github.com/google/dotprompt/issues/260)) ([0752865](https://github.com/google/dotprompt/commit/0752865b415c6cc90c87e3113b537632a52e3423))
|
|
150
|
+
* **py/dotpromptz:** registering partials and start rendering some specs ([#269](https://github.com/google/dotprompt/issues/269)) ([aff3c4b](https://github.com/google/dotprompt/commit/aff3c4b9ee548e61268ca070f6660d51c860619d))
|
|
151
|
+
* **py/dotpromptz:** remove stray reference to inspect.isasyncgenfunction since we dont deal with those as resolvers ([#216](https://github.com/google/dotprompt/issues/216)) ([c300515](https://github.com/google/dotprompt/commit/c3005159aea0af906e3f704d03fd5859a9540d4f))
|
|
152
|
+
* **py/dotpromptz:** remove unused Options type from dotprompt.py and fix typo ([#213](https://github.com/google/dotprompt/issues/213)) ([ae59431](https://github.com/google/dotprompt/commit/ae5943179e77aa6fa775d092254d8adf21b06eb2))
|
|
153
|
+
* **py/dotpromptz:** some lint and add docstrings ([#235](https://github.com/google/dotprompt/issues/235)) ([2e1c893](https://github.com/google/dotprompt/commit/2e1c893bbbe7c29480d67e2d693db90e9bef9b1b))
|
|
154
|
+
* **py/handlebarrz:** helpers support in handlebarrz ([#291](https://github.com/google/dotprompt/issues/291)) ([d5d66a3](https://github.com/google/dotprompt/commit/d5d66a35858a068c2995b82fe54b62f0be4d057f))
|
|
155
|
+
* **py/spec_test:** hex-encoded SHA-256 digest rather than base64-encoded SHA-256 digest for module IDs ([#140](https://github.com/google/dotprompt/issues/140)) ([796c644](https://github.com/google/dotprompt/commit/796c6442a3c1836de2170c466966382a0577a940))
|
|
156
|
+
* **py:** lint reporting missing docstrings in test files ([#199](https://github.com/google/dotprompt/issues/199)) ([4d91514](https://github.com/google/dotprompt/commit/4d9151468ddd13f334454701daae42d5717d4dcf))
|
|
157
|
+
* **py:** metadata purpose support ([#296](https://github.com/google/dotprompt/issues/296)) ([4a0f436](https://github.com/google/dotprompt/commit/4a0f436f1420f738d4fb46a4e5f41129929fb0fd))
|
|
158
|
+
* remove spurious role type `assistant` ([#169](https://github.com/google/dotprompt/issues/169)) ([1b5142c](https://github.com/google/dotprompt/commit/1b5142c4a7ad20ef722d438cefa0b93a82d7adbb))
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
### Documentation
|
|
162
|
+
|
|
163
|
+
* add initial mkdocs documentation for eng [#43](https://github.com/google/dotprompt/issues/43) ([#44](https://github.com/google/dotprompt/issues/44)) ([31be336](https://github.com/google/dotprompt/commit/31be336d14899acf7ea1cefb4b782f5b2d1c31d1))
|
|
164
|
+
* **py/dotpromptz:** document awaitable type hierarchy as ASCII diagram in comments to make code readable ([#212](https://github.com/google/dotprompt/issues/212)) ([0926749](https://github.com/google/dotprompt/commit/0926749e72d17264b8078151b10f616a906cfd66))
|
|
165
|
+
* **py:** add docstring to parse.py and dotprompt.py modules. ([#246](https://github.com/google/dotprompt/issues/246)) ([c9d53bb](https://github.com/google/dotprompt/commit/c9d53bb3cad96f9d8ef5778ada93ee65276afa09))
|
|
166
|
+
* **py:** add documentation for the resolvers module ([#209](https://github.com/google/dotprompt/issues/209)) ([04b6691](https://github.com/google/dotprompt/commit/04b6691227ef5b01ebf5261d4846a3ba7e723ab2))
|
|
167
|
+
* **py:** ascii diagrams to explain the relationships between the types for easy visualization ([#197](https://github.com/google/dotprompt/issues/197)) ([6d775c4](https://github.com/google/dotprompt/commit/6d775c4bf1301c63d111b0d45db53dba61117555))
|
dotpromptz-0.1.2/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 Google LLC
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dotpromptz
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Dotpromptz is a language-neutral executable prompt template file format for Generative AI.
|
|
5
|
+
Author: Google
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Environment :: Web Environment
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: aiofiles>=24.1.0
|
|
24
|
+
Requires-Dist: anyio>=4.9.0
|
|
25
|
+
Requires-Dist: dotprompt-handlebars
|
|
26
|
+
Requires-Dist: pydantic[email]>=2.10.6
|
|
27
|
+
Requires-Dist: strenum>=0.4.15; python_version < '3.11'
|
|
28
|
+
Requires-Dist: structlog>=25.2.0
|
|
29
|
+
Requires-Dist: types-aiofiles>=24.1.0.20250326
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# Dotprompt: Executable GenAI Prompt Templates
|
|
33
|
+
|
|
34
|
+
**Dotprompt** is an executable prompt template file format for Generative AI. It
|
|
35
|
+
is designed to be agnostic to programming language and model provider to allow
|
|
36
|
+
for maximum flexibility in usage. Dotprompt extends the popular
|
|
37
|
+
[Handlebars](https://handlebarsjs.com) templating language with GenAI-specific
|
|
38
|
+
features.
|
|
39
|
+
|
|
40
|
+
## What's an executable prompt template?
|
|
41
|
+
|
|
42
|
+
An executable prompt template is a file that contains not only the text of a
|
|
43
|
+
prompt but also metadata and instructions for how to use that prompt with a
|
|
44
|
+
generative AI model. Here's what makes Dotprompt files executable:
|
|
45
|
+
|
|
46
|
+
- **Metadata Inclusion**: Dotprompt files include metadata about model
|
|
47
|
+
configuration, input requirements, and expected output format. This
|
|
48
|
+
information is typically stored in a YAML frontmatter section at the beginning
|
|
49
|
+
of the file.
|
|
50
|
+
|
|
51
|
+
- **Self-Contained Entity**: Because a Dotprompt file contains all the necessary
|
|
52
|
+
information to execute a prompt, it can be treated as a self-contained entity.
|
|
53
|
+
This means you can "run" a Dotprompt file directly, without needing additional
|
|
54
|
+
configuration or setup in your code.
|
|
55
|
+
|
|
56
|
+
- **Model Configuration**: The file specifies which model to use and how to
|
|
57
|
+
configure it (e.g., temperature, max tokens).
|
|
58
|
+
|
|
59
|
+
- **Input Schema**: It defines the structure of the input data expected by the
|
|
60
|
+
prompt, allowing for validation and type-checking.
|
|
61
|
+
|
|
62
|
+
- **Output Format**: The file can specify the expected format of the model's
|
|
63
|
+
output, which can be used for parsing and validation.
|
|
64
|
+
|
|
65
|
+
- **Templating**: The prompt text itself uses Handlebars syntax, allowing for
|
|
66
|
+
dynamic content insertion based on input variables.
|
|
67
|
+
|
|
68
|
+
This combination of features makes it possible to treat a Dotprompt file as an
|
|
69
|
+
executable unit, streamlining the process of working with AI models and ensuring
|
|
70
|
+
consistency across different uses of the same prompt.
|
|
71
|
+
|
|
72
|
+
## Example `.prompt` file
|
|
73
|
+
|
|
74
|
+
Here's an example of a Dotprompt file that extracts structured data from provided text:
|
|
75
|
+
|
|
76
|
+
```handlebars
|
|
77
|
+
---
|
|
78
|
+
model: googleai/gemini-1.5-pro
|
|
79
|
+
input:
|
|
80
|
+
schema:
|
|
81
|
+
text: string
|
|
82
|
+
output:
|
|
83
|
+
format: json
|
|
84
|
+
schema:
|
|
85
|
+
name?: string, the full name of the person
|
|
86
|
+
age?: number, the age of the person
|
|
87
|
+
occupation?: string, the person's occupation
|
|
88
|
+
---
|
|
89
|
+
Extract the requested information from the given text. If a piece of information is not
|
|
90
|
+
present, omit that field from the output. Text:
|
|
91
|
+
{{text}}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
This Dotprompt file:
|
|
95
|
+
|
|
96
|
+
1. Specifies the use of the `googleai/gemini-1.5-pro` model.
|
|
97
|
+
2. Defines an input schema expecting a `text` string.
|
|
98
|
+
3. Specifies that the output should be in JSON format.
|
|
99
|
+
4. Provides a schema for the expected output, including fields for name, age, and occupation.
|
|
100
|
+
5. Uses Handlebars syntax (`{{text}}`) to insert the input text into the prompt.
|
|
101
|
+
|
|
102
|
+
When executed, this prompt would take a text input, analyze it using the
|
|
103
|
+
specified AI model, and return a structured JSON object with the extracted
|
|
104
|
+
information.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Dotprompt: Executable GenAI Prompt Templates
|
|
2
|
+
|
|
3
|
+
**Dotprompt** is an executable prompt template file format for Generative AI. It
|
|
4
|
+
is designed to be agnostic to programming language and model provider to allow
|
|
5
|
+
for maximum flexibility in usage. Dotprompt extends the popular
|
|
6
|
+
[Handlebars](https://handlebarsjs.com) templating language with GenAI-specific
|
|
7
|
+
features.
|
|
8
|
+
|
|
9
|
+
## What's an executable prompt template?
|
|
10
|
+
|
|
11
|
+
An executable prompt template is a file that contains not only the text of a
|
|
12
|
+
prompt but also metadata and instructions for how to use that prompt with a
|
|
13
|
+
generative AI model. Here's what makes Dotprompt files executable:
|
|
14
|
+
|
|
15
|
+
- **Metadata Inclusion**: Dotprompt files include metadata about model
|
|
16
|
+
configuration, input requirements, and expected output format. This
|
|
17
|
+
information is typically stored in a YAML frontmatter section at the beginning
|
|
18
|
+
of the file.
|
|
19
|
+
|
|
20
|
+
- **Self-Contained Entity**: Because a Dotprompt file contains all the necessary
|
|
21
|
+
information to execute a prompt, it can be treated as a self-contained entity.
|
|
22
|
+
This means you can "run" a Dotprompt file directly, without needing additional
|
|
23
|
+
configuration or setup in your code.
|
|
24
|
+
|
|
25
|
+
- **Model Configuration**: The file specifies which model to use and how to
|
|
26
|
+
configure it (e.g., temperature, max tokens).
|
|
27
|
+
|
|
28
|
+
- **Input Schema**: It defines the structure of the input data expected by the
|
|
29
|
+
prompt, allowing for validation and type-checking.
|
|
30
|
+
|
|
31
|
+
- **Output Format**: The file can specify the expected format of the model's
|
|
32
|
+
output, which can be used for parsing and validation.
|
|
33
|
+
|
|
34
|
+
- **Templating**: The prompt text itself uses Handlebars syntax, allowing for
|
|
35
|
+
dynamic content insertion based on input variables.
|
|
36
|
+
|
|
37
|
+
This combination of features makes it possible to treat a Dotprompt file as an
|
|
38
|
+
executable unit, streamlining the process of working with AI models and ensuring
|
|
39
|
+
consistency across different uses of the same prompt.
|
|
40
|
+
|
|
41
|
+
## Example `.prompt` file
|
|
42
|
+
|
|
43
|
+
Here's an example of a Dotprompt file that extracts structured data from provided text:
|
|
44
|
+
|
|
45
|
+
```handlebars
|
|
46
|
+
---
|
|
47
|
+
model: googleai/gemini-1.5-pro
|
|
48
|
+
input:
|
|
49
|
+
schema:
|
|
50
|
+
text: string
|
|
51
|
+
output:
|
|
52
|
+
format: json
|
|
53
|
+
schema:
|
|
54
|
+
name?: string, the full name of the person
|
|
55
|
+
age?: number, the age of the person
|
|
56
|
+
occupation?: string, the person's occupation
|
|
57
|
+
---
|
|
58
|
+
Extract the requested information from the given text. If a piece of information is not
|
|
59
|
+
present, omit that field from the output. Text:
|
|
60
|
+
{{text}}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
This Dotprompt file:
|
|
64
|
+
|
|
65
|
+
1. Specifies the use of the `googleai/gemini-1.5-pro` model.
|
|
66
|
+
2. Defines an input schema expecting a `text` string.
|
|
67
|
+
3. Specifies that the output should be in JSON format.
|
|
68
|
+
4. Provides a schema for the expected output, including fields for name, age, and occupation.
|
|
69
|
+
5. Uses Handlebars syntax (`{{text}}`) to insert the input text into the prompt.
|
|
70
|
+
|
|
71
|
+
When executed, this prompt would take a text input, analyze it using the
|
|
72
|
+
specified AI model, and return a structured JSON object with the extracted
|
|
73
|
+
information.
|