promptledger-promptfoo 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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ertugrul Mutlu
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.
@@ -0,0 +1,49 @@
1
+ Metadata-Version: 2.4
2
+ Name: promptledger-promptfoo
3
+ Version: 0.1.0
4
+ Summary: Optional promptfoo provider for PromptLedger
5
+ Author: PromptLedger Contributors
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/Ertugrulmutlu/promptledger
8
+ Project-URL: Documentation, https://github.com/Ertugrulmutlu/promptledger/blob/main/docs/plugin-sdk.md
9
+ Project-URL: Issues, https://github.com/Ertugrulmutlu/promptledger/issues
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: promptledger<0.9,>=0.8
14
+ Dynamic: license-file
15
+
16
+ # PromptLedger Promptfoo provider
17
+
18
+ Optional provider for PromptLedger 0.8.x (SDK v1).
19
+
20
+ Offline import of Promptfoo evaluation JSON reports. A report is manually associated with a saved prompt version; importing it does not run Promptfoo or independently verify the association.
21
+
22
+ ## Installation
23
+
24
+ ```sh
25
+ python -m pip install promptledger-promptfoo
26
+ promptledger plugins conformance promptfoo --confirm
27
+ ```
28
+
29
+ From a source checkout, install Core first and use `python -m pip install -e ./plugins/promptfoo` instead.
30
+
31
+ ## Usage
32
+
33
+ Initialize a workspace and create the referenced prompt where required. Example:
34
+
35
+ ```sh
36
+ promptledger integrations promptfoo-import --id greeting --ref 1 --file report.json
37
+ ```
38
+
39
+ ## Reading results
40
+
41
+ ```sh
42
+ promptledger eval list --id greeting
43
+ ```
44
+
45
+ Importing a report records its summary counts and pass rate for the selected version. Reports with multiple prompts/providers are not split automatically. Use a report that corresponds to the selected prompt and model.
46
+
47
+ Providers are trusted Python code, not sandboxed. Explicit confirmation is required for network execution. No automatic synchronization or publication. Review the [SDK guide](https://github.com/Ertugrulmutlu/promptledger/blob/main/docs/plugin-sdk.md) for the trust boundary and provider options.
48
+
49
+ MIT license.
@@ -0,0 +1,34 @@
1
+ # PromptLedger Promptfoo provider
2
+
3
+ Optional provider for PromptLedger 0.8.x (SDK v1).
4
+
5
+ Offline import of Promptfoo evaluation JSON reports. A report is manually associated with a saved prompt version; importing it does not run Promptfoo or independently verify the association.
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ python -m pip install promptledger-promptfoo
11
+ promptledger plugins conformance promptfoo --confirm
12
+ ```
13
+
14
+ From a source checkout, install Core first and use `python -m pip install -e ./plugins/promptfoo` instead.
15
+
16
+ ## Usage
17
+
18
+ Initialize a workspace and create the referenced prompt where required. Example:
19
+
20
+ ```sh
21
+ promptledger integrations promptfoo-import --id greeting --ref 1 --file report.json
22
+ ```
23
+
24
+ ## Reading results
25
+
26
+ ```sh
27
+ promptledger eval list --id greeting
28
+ ```
29
+
30
+ Importing a report records its summary counts and pass rate for the selected version. Reports with multiple prompts/providers are not split automatically. Use a report that corresponds to the selected prompt and model.
31
+
32
+ Providers are trusted Python code, not sandboxed. Explicit confirmation is required for network execution. No automatic synchronization or publication. Review the [SDK guide](https://github.com/Ertugrulmutlu/promptledger/blob/main/docs/plugin-sdk.md) for the trust boundary and provider options.
33
+
34
+ MIT license.
@@ -0,0 +1,23 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+ [project]
5
+ name = "promptledger-promptfoo"
6
+ version = "0.1.0"
7
+ description = "Optional promptfoo provider for PromptLedger"
8
+ requires-python = ">=3.10"
9
+ dependencies = ["promptledger>=0.8,<0.9"]
10
+ readme = "README.md"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "PromptLedger Contributors" }]
14
+
15
+ [project.urls]
16
+ Repository = "https://github.com/Ertugrulmutlu/promptledger"
17
+ Documentation = "https://github.com/Ertugrulmutlu/promptledger/blob/main/docs/plugin-sdk.md"
18
+ Issues = "https://github.com/Ertugrulmutlu/promptledger/issues"
19
+
20
+ [project.entry-points."promptledger.plugins"]
21
+ promptfoo = "ledger_promptfoo:PromptfooPlugin"
22
+ [tool.setuptools.packages.find]
23
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,25 @@
1
+ """Import existing Promptfoo JSON summaries without running Node or transmitting data."""
2
+ import hashlib
3
+ import json
4
+ from pathlib import Path
5
+ from promptledger.sdk import TypedIntegration, PluginManifest, EvaluationProvider, HealthcheckProvider, EvaluationResult
6
+
7
+ class PromptfooPlugin(TypedIntegration, EvaluationProvider, HealthcheckProvider):
8
+ manifest = PluginManifest('promptfoo','0.1.0',('evaluate','healthcheck'))
9
+ def healthcheck(self, options):
10
+ return {'status':'ok','mode':'offline-report-import'}
11
+
12
+ def evaluate(self, request):
13
+ path = request.options.get('file')
14
+ if not isinstance(path,str) or not path: raise ValueError('Report file required')
15
+ raw = Path(path).read_bytes()
16
+ document = json.loads(raw)
17
+ stats = document.get('results', {}).get('stats')
18
+ if not isinstance(stats,dict): raise ValueError('Expected Promptfoo JSON results.stats')
19
+ passed, failed, errors = stats.get('successes'), stats.get('failures'), stats.get('errors',0)
20
+ if any(type(n) is not int or n<0 for n in (passed,failed,errors)) or passed+failed+errors==0:
21
+ raise ValueError('Invalid or empty Promptfoo statistics')
22
+ return EvaluationResult('promptfoo',{'passed':passed,'failed':failed,'errors':errors,
23
+ 'pass_rate':passed/(passed+failed+errors)},request.options.get('model'),
24
+ metadata={'adapter':'promptfoo','report_sha256':hashlib.sha256(raw).hexdigest(),
25
+ 'binding':'user-selected prompt version; report not independently matched'})
@@ -0,0 +1,49 @@
1
+ Metadata-Version: 2.4
2
+ Name: promptledger-promptfoo
3
+ Version: 0.1.0
4
+ Summary: Optional promptfoo provider for PromptLedger
5
+ Author: PromptLedger Contributors
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/Ertugrulmutlu/promptledger
8
+ Project-URL: Documentation, https://github.com/Ertugrulmutlu/promptledger/blob/main/docs/plugin-sdk.md
9
+ Project-URL: Issues, https://github.com/Ertugrulmutlu/promptledger/issues
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: promptledger<0.9,>=0.8
14
+ Dynamic: license-file
15
+
16
+ # PromptLedger Promptfoo provider
17
+
18
+ Optional provider for PromptLedger 0.8.x (SDK v1).
19
+
20
+ Offline import of Promptfoo evaluation JSON reports. A report is manually associated with a saved prompt version; importing it does not run Promptfoo or independently verify the association.
21
+
22
+ ## Installation
23
+
24
+ ```sh
25
+ python -m pip install promptledger-promptfoo
26
+ promptledger plugins conformance promptfoo --confirm
27
+ ```
28
+
29
+ From a source checkout, install Core first and use `python -m pip install -e ./plugins/promptfoo` instead.
30
+
31
+ ## Usage
32
+
33
+ Initialize a workspace and create the referenced prompt where required. Example:
34
+
35
+ ```sh
36
+ promptledger integrations promptfoo-import --id greeting --ref 1 --file report.json
37
+ ```
38
+
39
+ ## Reading results
40
+
41
+ ```sh
42
+ promptledger eval list --id greeting
43
+ ```
44
+
45
+ Importing a report records its summary counts and pass rate for the selected version. Reports with multiple prompts/providers are not split automatically. Use a report that corresponds to the selected prompt and model.
46
+
47
+ Providers are trusted Python code, not sandboxed. Explicit confirmation is required for network execution. No automatic synchronization or publication. Review the [SDK guide](https://github.com/Ertugrulmutlu/promptledger/blob/main/docs/plugin-sdk.md) for the trust boundary and provider options.
48
+
49
+ MIT license.
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/ledger_promptfoo/__init__.py
5
+ src/promptledger_promptfoo.egg-info/PKG-INFO
6
+ src/promptledger_promptfoo.egg-info/SOURCES.txt
7
+ src/promptledger_promptfoo.egg-info/dependency_links.txt
8
+ src/promptledger_promptfoo.egg-info/entry_points.txt
9
+ src/promptledger_promptfoo.egg-info/requires.txt
10
+ src/promptledger_promptfoo.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [promptledger.plugins]
2
+ promptfoo = ledger_promptfoo:PromptfooPlugin