zettcode-guidance 0.4.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.
- zettcode_guidance-0.4.1/.gitignore +42 -0
- zettcode_guidance-0.4.1/PKG-INFO +19 -0
- zettcode_guidance-0.4.1/pyproject.toml +51 -0
- zettcode_guidance-0.4.1/src/zettcode/guidance/__init__.py +12 -0
- zettcode_guidance-0.4.1/src/zettcode/guidance/plugin.py +32 -0
- zettcode_guidance-0.4.1/src/zettcode/guidance/py.typed +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
**/.venv/
|
|
2
|
+
**/__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
build/
|
|
6
|
+
dist/
|
|
7
|
+
.smoke/
|
|
8
|
+
.coverage
|
|
9
|
+
**/.pytest_cache/
|
|
10
|
+
**/.ruff_cache/
|
|
11
|
+
.zett-tool-output/
|
|
12
|
+
.env
|
|
13
|
+
.DS_Store
|
|
14
|
+
|
|
15
|
+
# viztracer writes its trace here by default.
|
|
16
|
+
/result.json
|
|
17
|
+
|
|
18
|
+
# The docs site: dependencies, build output, and VitePress' cache.
|
|
19
|
+
node_modules/
|
|
20
|
+
docs/.vitepress/dist/
|
|
21
|
+
docs/.vitepress/cache/
|
|
22
|
+
docs/.vitepress/.temp/
|
|
23
|
+
|
|
24
|
+
# The TypeScript client is built from its sources; only dist/ is published.
|
|
25
|
+
clients/typescript/dist/
|
|
26
|
+
|
|
27
|
+
# The gateway's page is built from clients/gateway into the package when a distribution is made (`make gateway-ui`);
|
|
28
|
+
# the build output is not kept in the repository. pyproject's `artifacts` puts it in the wheel all the same.
|
|
29
|
+
packages/zettcode-gateway/src/zettcode/gateway/static/
|
|
30
|
+
|
|
31
|
+
# The palette gallery is generated by `make palettes`: every widget painted in
|
|
32
|
+
# every palette, written by docs/scripts/palette_gallery.py. Regenerate it
|
|
33
|
+
# rather than committing a 2 MB copy that goes stale the moment a colour moves.
|
|
34
|
+
docs/internal/palettes.html
|
|
35
|
+
|
|
36
|
+
# The release order is generated from the pyproject.toml files (`make order`); it is not kept in git.
|
|
37
|
+
packages/order.txt
|
|
38
|
+
|
|
39
|
+
# The desktop and phone apps build the gateway's page into their own folders, and electron-builder writes its
|
|
40
|
+
# installers under release/.
|
|
41
|
+
clients/desktop/renderer/
|
|
42
|
+
clients/desktop/release/
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: zettcode-guidance
|
|
3
|
+
Version: 0.4.1
|
|
4
|
+
Summary: The per-tool guidance ZettCode gives the model, 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,guidance,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.10
|
|
19
|
+
Requires-Dist: zettcode-engine
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "zettcode-guidance"
|
|
3
|
+
description = "The per-tool guidance ZettCode gives the model, as a part of the agent that lives apart from it"
|
|
4
|
+
requires-python = ">=3.10"
|
|
5
|
+
dynamic = ["version"]
|
|
6
|
+
license = "MIT"
|
|
7
|
+
authors = [{name = "Chang-LeHung"}]
|
|
8
|
+
keywords = ["zettcode", "guidance", "agent"]
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Development Status :: 5 - Production/Stable",
|
|
11
|
+
"Programming Language :: Python :: 3.10",
|
|
12
|
+
"Programming Language :: Python :: 3.11",
|
|
13
|
+
"Programming Language :: Python :: 3.12",
|
|
14
|
+
"Programming Language :: Python :: 3.13",
|
|
15
|
+
"Programming Language :: Python :: 3.14",
|
|
16
|
+
"Programming Language :: Python :: 3.15",
|
|
17
|
+
"Typing :: Typed",
|
|
18
|
+
]
|
|
19
|
+
dependencies = [
|
|
20
|
+
# The plugin base classes, and the factory the extension is built from (`engine.extensions.guidance`).
|
|
21
|
+
"zettcode-engine",
|
|
22
|
+
# The type the factory returns; the module is only imported by the type checker.
|
|
23
|
+
"zett-agent>=0.2.10,<0.3",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
# A part of the program, not a plugin: the `[tool.zettcode] plugin = true` marker is what the plugin release line looks for. It is
|
|
27
|
+
# activated with the agent's other parts and nothing turns it off: every agent this program builds describes its
|
|
28
|
+
# tools the same way.
|
|
29
|
+
[project.entry-points."zettcode.plugin"]
|
|
30
|
+
tool-guidelines = "zettcode.guidance.plugin:ToolGuidance"
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Repository = "https://github.com/Chang-LeHung/zettcode"
|
|
34
|
+
|
|
35
|
+
[build-system]
|
|
36
|
+
requires = ["hatchling"]
|
|
37
|
+
build-backend = "hatchling.build"
|
|
38
|
+
|
|
39
|
+
[tool.hatch.version]
|
|
40
|
+
# One version for the whole repository: the engine ships the file.
|
|
41
|
+
path = "../zettcode-engine/src/zettcode/version.py"
|
|
42
|
+
|
|
43
|
+
[tool.hatch.build.targets.wheel]
|
|
44
|
+
packages = ["src/zettcode"]
|
|
45
|
+
|
|
46
|
+
[tool.hatch.build.targets.sdist]
|
|
47
|
+
include = ["/src", "/pyproject.toml"]
|
|
48
|
+
|
|
49
|
+
[tool.pytest.ini_options]
|
|
50
|
+
testpaths = ["tests"]
|
|
51
|
+
asyncio_mode = "auto"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""Per-tool guidance in each tool's description: the plugin that hands the extension 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. The
|
|
4
|
+
extension itself stays in the engine (`zettcode.engine.extensions.guidance`), because every child agent the engine's
|
|
5
|
+
``task`` tool builds carries it, so the runtime needs the factory whether or not this part is installed.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from .plugin import ToolGuidance
|
|
11
|
+
|
|
12
|
+
__all__ = ["ToolGuidance"]
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""The plugin that registers the guidance each tool carries in its own description."""
|
|
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
|
|
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 ToolGuidance(Plugin[PluginContext]):
|
|
17
|
+
"""The guidance each tool carries: its call shapes, guidelines and return type, in the tool's own description."""
|
|
18
|
+
|
|
19
|
+
name = "tool-guidelines"
|
|
20
|
+
description = "Per-tool guidance in each tool's description"
|
|
21
|
+
|
|
22
|
+
def activate(self, ctx: PluginContext) -> None:
|
|
23
|
+
"""Register the extension as a factory: it is built with the agent, not while the first frame is drawn."""
|
|
24
|
+
|
|
25
|
+
# Imported in the factory: the extension imports the framework's tool-guidelines module, which a launch that
|
|
26
|
+
# never builds an agent does not need.
|
|
27
|
+
def build(_: AgentBuild) -> AgentExtension:
|
|
28
|
+
from zettcode.engine.extensions.guidance import tool_guidance
|
|
29
|
+
|
|
30
|
+
return tool_guidance()
|
|
31
|
+
|
|
32
|
+
ctx.agent.register_extension_factory("ToolGuidelinesExtension", build)
|
|
File without changes
|