ai-agent-kit 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,11 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires=["hatchling"]
|
|
3
|
+
build-backend="hatchling.build"
|
|
4
|
+
[project]
|
|
5
|
+
name="ai-agent-kit"
|
|
6
|
+
version="0.1.0"
|
|
7
|
+
description="Small tool-calling agent loop primitives"
|
|
8
|
+
readme="README.md"
|
|
9
|
+
requires-python=">=3.9"
|
|
10
|
+
[tool.hatch.build.targets.wheel]
|
|
11
|
+
packages=["src/ai_agent_kit"]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from typing import Callable, Dict
|
|
2
|
+
|
|
3
|
+
class ToolRegistry:
|
|
4
|
+
def __init__(self): self._tools: Dict[str, Callable] = {}
|
|
5
|
+
def register(self, name: str, fn: Callable) -> Callable:
|
|
6
|
+
self._tools[name] = fn; return fn
|
|
7
|
+
def call(self, name: str, **kwargs):
|
|
8
|
+
if name not in self._tools: raise KeyError(name)
|
|
9
|
+
return self._tools[name](**kwargs)
|