zettcode-ask-user 0.4.1__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,12 @@
1
+ """The ``ask_user`` tool of ZettCode: the plugin that hands it to the agent.
2
+
3
+ A part of the program that lives in a distribution of its own, found through the ``zettcode.plugin`` entry point.
4
+ ``[ask_user] enabled`` in the configuration is what turns it off. The extension is imported by the factory, so a launch
5
+ that never builds an agent does not pay for it.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from .plugin import AskUser
11
+
12
+ __all__ = ["AskUser"]
@@ -0,0 +1,33 @@
1
+ """The plugin that hands the agent the ``ask_user`` tool."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING
6
+
7
+ from zettcode.engine.plugins.context import PluginContext
8
+ from zettcode.engine.plugins.plugin import Plugin, PluginSetting
9
+
10
+ if TYPE_CHECKING: # pragma: no cover - annotations only
11
+ from zett_agent.extensions.base import AgentExtension
12
+
13
+ from zettcode.engine.plugins.state import AgentBuild
14
+
15
+
16
+ class AskUser(Plugin[PluginContext]):
17
+ """The ``ask_user`` tool: how the model puts a question to the reader instead of guessing."""
18
+
19
+ name = "ask-user"
20
+ description = "The ask_user tool"
21
+ setting = PluginSetting("ask_user_enabled", "ask_user")
22
+
23
+ def activate(self, ctx: PluginContext) -> None:
24
+ """Hand the agent the tool, unless the configuration turned it off."""
25
+ if not ctx.config.ask_user_enabled:
26
+ return
27
+
28
+ def build(_: AgentBuild) -> AgentExtension:
29
+ from zett_agent.extensions.ask_user import AskUserExtension
30
+
31
+ return AskUserExtension()
32
+
33
+ ctx.agent.register_extension_factory("AskUserExtension", build)
File without changes
@@ -0,0 +1,19 @@
1
+ Metadata-Version: 2.5
2
+ Name: zettcode-ask-user
3
+ Version: 0.4.1
4
+ Summary: The ask_user tool of ZettCode, as a part of the agent that lives apart from it
5
+ Project-URL: Repository, https://github.com/Chang-LeHung/zettcode
6
+ Author: Chang-LeHung
7
+ License-Expression: MIT
8
+ Keywords: agent,ask-user,zettcode
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Programming Language :: Python :: 3.15
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: zett-agent<0.3,>=0.2.7
19
+ Requires-Dist: zettcode-engine
@@ -0,0 +1,7 @@
1
+ zettcode/ask_user/__init__.py,sha256=meNFsWjZk0ViwGf0vhHES92xdlTNXk9pETVC15s5jAE,452
2
+ zettcode/ask_user/plugin.py,sha256=Qbafqn3TfvipGJG_53KE4fUUX4A9-cMbv0Adpe1xB40,1120
3
+ zettcode/ask_user/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ zettcode_ask_user-0.4.1.dist-info/METADATA,sha256=PSUv0ahBB-vIRVd4J2RbEHjil6wOAeYcLl9bW4_K360,777
5
+ zettcode_ask_user-0.4.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
6
+ zettcode_ask_user-0.4.1.dist-info/entry_points.txt,sha256=Jxqgp7peflnwtRzmKX62IMiAwvXgpjqXUaryKJTTS7M,62
7
+ zettcode_ask_user-0.4.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [zettcode.plugin]
2
+ ask-user = zettcode.ask_user.plugin:AskUser