aisc-plugin-interface 0.2.4__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.
@@ -0,0 +1,3 @@
1
+ from .{{ import_path }} import {{ plugin_name }}
2
+
3
+ __all__ = ["{{ plugin_name }}"]
@@ -0,0 +1,19 @@
1
+ from typing import Any
2
+
3
+ from pydantic import BaseModel
4
+
5
+ from aisc_plugin_interface import BaseEvaluationPlugin, Measure, metric
6
+
7
+
8
+ # Define the configuration form schema
9
+ class ConfigFormSchema(BaseModel):
10
+ pass
11
+
12
+
13
+ class {{ plugin_name }}(BaseEvaluationPlugin[ConfigFormSchema]):
14
+ def evaluate(self, config_data: dict) -> Any:
15
+ pass
16
+
17
+ @metric("my-metric")
18
+ def my_metric(self, evaluation_output: Any) -> list[Measure]:
19
+ pass
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.4
2
+ Name: aisc-plugin-interface
3
+ Version: 0.2.4
4
+ Summary: Add your description here
5
+ Requires-Python: >=3.12
6
+ Requires-Dist: pydantic>=2.12.5
7
+ Requires-Dist: rich>=14.3.3
8
+ Description-Content-Type: text/markdown
9
+
10
+ # AISC Plugin Interface
11
+
12
+ This repository provides the base interface for writing evaluation plugins.
13
+
14
+ If you are new to the platform, start here:
15
+
16
+ - [Plugin Developer Guide](PLUGIN_DEVELOPER_GUIDE.md)
17
+
18
+ That guide covers:
19
+
20
+ - the plugin contract and discovery model
21
+ - how to create a plugin project
22
+ - how to implement configuration, inputs, metrics, and progress reporting
23
+ - optional integration hooks and current extension points
24
+ - common failure modes and architectural feedback areas
25
+
26
+ ## Quick Start
27
+
28
+ Create a new plugin project:
29
+
30
+ ```bash
31
+ mkdir my-aisc-plugin
32
+ cd my-aisc-plugin
33
+ uv init --lib
34
+ uv add git+https://github.com/lux-ai-factory/aisc-plugin-interface
35
+ ```
36
+
37
+ Implement a plugin class that inherits from `BaseEvaluationPlugin[T]`, then export it from your package `__init__.py`.
38
+
39
+ Minimal example:
40
+
41
+ ```python
42
+ from typing import Any
43
+
44
+ from aisc_plugin_interface.models.measure import Measure
45
+ from aisc_plugin_interface.base_evaluation_plugin import metric, BaseEvaluationPlugin
46
+ from pydantic import BaseModel, Field
47
+
48
+ from aisc_plugin_interface import BaseEvaluationPlugin, Measure, metric
49
+
50
+
51
+ class ConfigFormSchema(BaseModel):
52
+ threshold: float = Field(default=0.5, ge=0.0, le=1.0)
53
+
54
+
55
+ class MyPlugin(BaseEvaluationPlugin[ConfigFormSchema]):
56
+ def evaluate(self, config_data: dict) -> Any:
57
+ # Dependencies only used during evaluation should be imported locally here
58
+ import numpy as np
59
+
60
+ # Access configuration form data
61
+ config: ConfigFormSchema = self.validate_config_form_data(config_data)
62
+ threshold: float = config.threshold
63
+
64
+ # Your evaluation logic here
65
+
66
+ # Use self.logger for logging
67
+ self.logger.info("Evaluation completed successfully")
68
+
69
+ return {"MyMetric": [0.99, 0.5, 0.67], "OtherMetric": [0.01, 0.22, 0.77]}
70
+
71
+
72
+ @metric("MyMetric")
73
+ def my_metric(self, evaluation_output: Any) -> list[Measure]:
74
+ values = evaluation_output.get("MyMetric", [])
75
+ return [Measure(name="MyMetric", score=value) for value in values]
76
+ ```
77
+
78
+ Export it:
79
+
80
+ ```python
81
+ from .plugin import MyPlugin
82
+
83
+ __all__ = ["MyPlugin"]
84
+ ```
85
+
86
+ For the full development workflow, use the guide above.
@@ -0,0 +1,6 @@
1
+ aisc_plugin_interface/templates/init.py.tpl,sha256=dCc2sNkNrPV-4_8DG6QVlKGV4c7QiGN7I_qjGfiRyN8,82
2
+ aisc_plugin_interface/templates/plugin.py.tpl,sha256=fWUafQYQtvqhOmGji7P7CDqkZOCrtwPPOk03eESEQCk,448
3
+ aisc_plugin_interface-0.2.4.dist-info/METADATA,sha256=4RlovdnY0pFB5nM3ZJJs021CyBItm6YaAAYLXXEAlmE,2394
4
+ aisc_plugin_interface-0.2.4.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
5
+ aisc_plugin_interface-0.2.4.dist-info/entry_points.txt,sha256=Xdk2dUCmrtn2Mc4rVtha8wkyaR8DOHWiugXJBZ0oxvA,73
6
+ aisc_plugin_interface-0.2.4.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ aisc-plugin-interface = aisc_plugin_interface.cli:main