@kindgi/cli 0.1.4-rc.3 → 0.1.4-rc.5
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.
- package/README.md +10 -6
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +12 -1
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +20 -8
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/helpers.d.ts +5 -2
- package/dist/commands/helpers.d.ts.map +1 -1
- package/dist/commands/helpers.js +8 -3
- package/dist/commands/helpers.js.map +1 -1
- package/dist/commands/runs.d.ts.map +1 -1
- package/dist/commands/runs.js +33 -4
- package/dist/commands/runs.js.map +1 -1
- package/dist/dev/runtime-container.d.ts +2 -0
- package/dist/dev/runtime-container.d.ts.map +1 -1
- package/dist/dev/runtime-container.js +6 -0
- package/dist/dev/runtime-container.js.map +1 -1
- package/dist/dev/runtime-env.d.ts.map +1 -1
- package/dist/dev/runtime-env.js +4 -0
- package/dist/dev/runtime-env.js.map +1 -1
- package/dist/dev/runtime-image.d.ts +1 -1
- package/dist/dev/runtime-image.js +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +10 -4
- package/dist/errors.js.map +1 -1
- package/dist/providers/preset-loader.d.ts +2 -0
- package/dist/providers/preset-loader.d.ts.map +1 -1
- package/dist/providers/preset-loader.js +30 -11
- package/dist/providers/preset-loader.js.map +1 -1
- package/dist/providers/presets/anthropic.json +2 -2
- package/dist/providers/presets/gemini-api.json +55 -0
- package/dist/providers/presets/gemini.json +9 -15
- package/dist/providers/presets/groq.json +39 -0
- package/dist/providers/presets/openai.json +50 -0
- package/dist/providers/presets/openrouter.json +61 -0
- package/dist/sdk-skills/kindgi-authoring-agents/SKILL.md +8 -4
- package/dist/sdk-skills/kindgi-authoring-flows/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-authoring-guardrails/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-authoring-mcp-servers/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-authoring-providers/SKILL.md +28 -11
- package/dist/sdk-skills/kindgi-authoring-tools/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-framework-feedback/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-getting-started/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-python-authoring-agents/SKILL.md +16 -9
- package/dist/sdk-skills/kindgi-python-authoring-flows/SKILL.md +7 -5
- package/dist/sdk-skills/kindgi-python-authoring-guardrails/SKILL.md +8 -6
- package/dist/sdk-skills/kindgi-python-authoring-tools/SKILL.md +7 -5
- package/dist/sdk-skills/kindgi-python-getting-started/SKILL.md +22 -16
- package/dist/templates/minimal/AGENTS.md +6 -3
- package/dist/templates/minimal/README.md.tmpl +11 -5
- package/dist/templates/python/AGENTS.md +7 -4
- package/dist/templates/python/README.md.tmpl +11 -5
- package/dist/templates/python/agents/echo_agent.py.tmpl +2 -2
- package/dist/templates/sample/AGENTS.md +6 -3
- package/dist/templates/sample/README.md.tmpl +11 -5
- package/dist/templates/sample/agents/echo-agent/index.ts.tmpl +1 -1
- package/package.json +12 -11
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "openrouter",
|
|
3
|
+
"description": "Many vendors' models through OpenRouter, with one key (key: OPENROUTER_API_KEY).",
|
|
4
|
+
"adapterId": "@kindgi/adapter-model-openai-compat",
|
|
5
|
+
"adapterConfigValues": {
|
|
6
|
+
"baseURL": "https://openrouter.ai/api/v1"
|
|
7
|
+
},
|
|
8
|
+
"secret": "OPENROUTER_API_KEY",
|
|
9
|
+
"pricesCheckedAt": "2026-10-07",
|
|
10
|
+
"metadata": {
|
|
11
|
+
"id": "openrouter",
|
|
12
|
+
"region": "unspecified",
|
|
13
|
+
"description": "Models from several vendors through OpenRouter",
|
|
14
|
+
"models": [
|
|
15
|
+
{
|
|
16
|
+
"name": "anthropic/claude-sonnet-5.5",
|
|
17
|
+
"contextWindow": 1000000,
|
|
18
|
+
"maxOutputTokens": 128000,
|
|
19
|
+
"features": ["tool-use", "parallel-tool-use", "structured-output", "long-context"],
|
|
20
|
+
"cost": {
|
|
21
|
+
"promptUsdPer1kTokens": 0.002,
|
|
22
|
+
"completionUsdPer1kTokens": 0.01
|
|
23
|
+
},
|
|
24
|
+
"description": "Claude Sonnet 5.5: balanced performance and cost."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "openai/gpt-6.1-sol",
|
|
28
|
+
"contextWindow": 1050000,
|
|
29
|
+
"maxOutputTokens": 128000,
|
|
30
|
+
"features": ["tool-use", "parallel-tool-use", "structured-output", "long-context"],
|
|
31
|
+
"cost": {
|
|
32
|
+
"promptUsdPer1kTokens": 0.002,
|
|
33
|
+
"completionUsdPer1kTokens": 0.01
|
|
34
|
+
},
|
|
35
|
+
"description": "GPT-6.1 Sol: balanced performance and cost."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "google/gemini-3.8-flash",
|
|
39
|
+
"contextWindow": 1048576,
|
|
40
|
+
"maxOutputTokens": 65536,
|
|
41
|
+
"features": ["tool-use", "parallel-tool-use", "structured-output", "long-context"],
|
|
42
|
+
"cost": {
|
|
43
|
+
"promptUsdPer1kTokens": 0.00075,
|
|
44
|
+
"completionUsdPer1kTokens": 0.00375
|
|
45
|
+
},
|
|
46
|
+
"description": "Gemini 3.8 Flash: fast and inexpensive."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "openai/gpt-6-luna",
|
|
50
|
+
"contextWindow": 1050000,
|
|
51
|
+
"maxOutputTokens": 128000,
|
|
52
|
+
"features": ["tool-use", "parallel-tool-use", "structured-output", "long-context"],
|
|
53
|
+
"cost": {
|
|
54
|
+
"promptUsdPer1kTokens": 0.0001,
|
|
55
|
+
"completionUsdPer1kTokens": 0.0005
|
|
56
|
+
},
|
|
57
|
+
"description": "GPT-6 Luna: fastest and cheapest — routing, classification, simple calls."
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -12,8 +12,8 @@ description: >
|
|
|
12
12
|
kindgi-authoring-guardrails.
|
|
13
13
|
type: core
|
|
14
14
|
library: "@kindgi/sdk"
|
|
15
|
-
version: "0.4.
|
|
16
|
-
sdk_version: "0.1.4-rc.
|
|
15
|
+
version: "0.4.3"
|
|
16
|
+
sdk_version: "0.1.4-rc.5"
|
|
17
17
|
pack_languages: [node]
|
|
18
18
|
sources:
|
|
19
19
|
- packages/agents/src/types.ts
|
|
@@ -63,7 +63,7 @@ const defined = defineAgent({
|
|
|
63
63
|
description:
|
|
64
64
|
'Drafts appellate briefs from a case file. Cites precedents; escalates novel legal questions.',
|
|
65
65
|
instructions:
|
|
66
|
-
'You are drafting a brief in {{ jurisdiction }}. The user provides the case facts; you produce a Section IV argument citing at least two precedents.
|
|
66
|
+
'You are drafting a brief in {{ jurisdiction }}. The user provides the case facts; you produce a Section IV argument citing at least two precedents. Check every cite with the verify-citation tool before including it. Refuse to fabricate citations — always call the tool.',
|
|
67
67
|
capabilities: [{ needs: [{ feature: 'tool-use' as const }] }],
|
|
68
68
|
tools: [
|
|
69
69
|
{ id: 'acme.verify-citation', version: '^0.1.0' },
|
|
@@ -96,7 +96,11 @@ export default defined.value;
|
|
|
96
96
|
`conversation.*`). Rendered with `strictVariables: true` — unresolved
|
|
97
97
|
references fail loudly at invoke time. Frame instructions like a
|
|
98
98
|
competent employee brief: what the agent does, what tools to prefer,
|
|
99
|
-
what to refuse, what quality bar to hit.
|
|
99
|
+
what to refuse, what quality bar to hit. Name a tool by what it does
|
|
100
|
+
("the verify-citation tool"), never by its dotted id: the model sees
|
|
101
|
+
ids in its provider's form (`acme__verify-citation` for Anthropic and
|
|
102
|
+
OpenAI-compatible models), and `acme.verify-citation` in the
|
|
103
|
+
instructions can make it call a name it wasn't given.
|
|
100
104
|
- **`capabilities`** — declares the resource kinds the agent needs at
|
|
101
105
|
runtime. `{feature: 'tool-use'}` is standard for tool-calling
|
|
102
106
|
agents. The router picks the concrete LLM provider at turn time.
|
|
@@ -22,8 +22,8 @@ description: >
|
|
|
22
22
|
kindgi-getting-started.
|
|
23
23
|
type: core
|
|
24
24
|
library: "@kindgi/sdk"
|
|
25
|
-
version: "0.9.
|
|
26
|
-
sdk_version: "0.1.4-rc.
|
|
25
|
+
version: "0.9.5"
|
|
26
|
+
sdk_version: "0.1.4-rc.5"
|
|
27
27
|
pack_languages: [node, python]
|
|
28
28
|
sources:
|
|
29
29
|
- packages/adapters/model-anthropic/src/provider.ts
|
|
@@ -241,7 +241,14 @@ capability requirement (see "How the router picks…" below).
|
|
|
241
241
|
|
|
242
242
|
Nothing to switch off: `dev-echo` is a fallback, so the new provider
|
|
243
243
|
answers every agent it satisfies. A turn that still lands on dev-echo
|
|
244
|
-
carries
|
|
244
|
+
carries the `fallback-provider` and `dev-echo-not-a-model` warnings — see
|
|
245
|
+
mistake 9.
|
|
246
|
+
|
|
247
|
+
**The other one-key presets** work the same way, with their own key:
|
|
248
|
+
`--preset=openai` (`OPENAI_API_KEY`), `--preset=gemini-api` (`GEMINI_API_KEY`,
|
|
249
|
+
a Google AI Studio key; `gemini` is Vertex AI), `--preset=groq`
|
|
250
|
+
(`GROQ_API_KEY`) and `--preset=openrouter` (`OPENROUTER_API_KEY`).
|
|
251
|
+
`kindgi providers presets` lists them with their models.
|
|
245
252
|
|
|
246
253
|
## Path B — Hosted via OpenAI-compat
|
|
247
254
|
|
|
@@ -305,15 +312,23 @@ kindgi secrets set GROQ_API_KEY --env=local --scope=tenant
|
|
|
305
312
|
|
|
306
313
|
**Steps 3–5** same as Path A.
|
|
307
314
|
|
|
308
|
-
## Path C — Local via in-process ONNX
|
|
315
|
+
## Path C — Local via in-process ONNX (runtime from source only)
|
|
316
|
+
|
|
317
|
+
> ⚠️ **Not in the runtime image, so not under `kindgi dev`.** The adapter
|
|
318
|
+
> runs ONNX through `onnxruntime-node`, which ships glibc binaries only,
|
|
319
|
+
> and the Kindgi runtime image is Alpine (musl): the adapter can't load
|
|
320
|
+
> there (`Error loading shared library ld-linux-…`). `kindgi dev` runs
|
|
321
|
+
> that image, so this path fails under it. It works only when the
|
|
322
|
+
> runtime itself runs from source on macOS or a glibc Linux. **For a
|
|
323
|
+
> local model under `kindgi dev`, use Ollama** ([Local via Ollama](#local-via-ollama-via-path-b)).
|
|
309
324
|
|
|
310
325
|
> ⚠️ **Dev-only.** The in-process ONNX adapter writes weights to
|
|
311
326
|
> `~/.cache/huggingface/hub/` — a per-machine cache with no production
|
|
312
327
|
> recipe (no volume-mount recipe, no image-bake pattern, no offline
|
|
313
|
-
> mode, no SHA pinning). Good for
|
|
314
|
-
>
|
|
315
|
-
> that rely on this adapter to production.** Use hosted
|
|
316
|
-
> (Path A) or Ollama (Path B) instead.
|
|
328
|
+
> mode, no SHA pinning). Good for smoke tests and CI runners that run
|
|
329
|
+
> the runtime from source and keep the same disk between runs. **Do not
|
|
330
|
+
> ship packs that rely on this adapter to production.** Use hosted
|
|
331
|
+
> providers (Path A) or Ollama (Path B) instead.
|
|
317
332
|
|
|
318
333
|
No API key. No network. Bundled with the framework — the adapter ships
|
|
319
334
|
`smollm2-360m` by default (~273 MB weights, cached at
|
|
@@ -385,7 +400,8 @@ production. Skip only for scripted teardown where the model is already
|
|
|
385
400
|
cached (`~/.cache/huggingface/hub/models--HuggingFaceTB--SmolLM2-360M-Instruct/`).
|
|
386
401
|
|
|
387
402
|
`prepare` is idempotent: subsequent invocations are cache hits and
|
|
388
|
-
return almost instantly, so put it in
|
|
403
|
+
return almost instantly, so put it in the script that boots your
|
|
404
|
+
from-source runtime.
|
|
389
405
|
|
|
390
406
|
Multi-model providers: prepare each model separately.
|
|
391
407
|
```sh
|
|
@@ -687,8 +703,9 @@ defineAgent({
|
|
|
687
703
|
does nothing. Pin the model with a `models: { allow: [...] }`
|
|
688
704
|
requirement instead.
|
|
689
705
|
|
|
690
|
-
9. **Replies still come from dev-echo** (
|
|
691
|
-
result has
|
|
706
|
+
9. **Replies still come from dev-echo** (`⚠ dev-echo isn't a real model: …`
|
|
707
|
+
then `Tool responded: …`; the turn's result has the `fallback-provider`
|
|
708
|
+
and `dev-echo-not-a-model` warnings). dev-echo is a fallback: it
|
|
692
709
|
answers only when no registered provider satisfies the agent. So your
|
|
693
710
|
provider doesn't — check its models' `features` against the agent's
|
|
694
711
|
`capabilities.needs` (mistake 2), a `models` / `providers` allow-list
|
|
@@ -15,8 +15,8 @@ description: >
|
|
|
15
15
|
model by kindgi-authoring-providers.
|
|
16
16
|
type: core
|
|
17
17
|
library: "kindgi (Python)"
|
|
18
|
-
version: "0.1.
|
|
19
|
-
sdk_version: "0.1.4-rc.
|
|
18
|
+
version: "0.1.3"
|
|
19
|
+
sdk_version: "0.1.4-rc.5"
|
|
20
20
|
pack_languages: [python]
|
|
21
21
|
sources:
|
|
22
22
|
- sdks/python/src/kindgi/pack/define.py
|
|
@@ -25,9 +25,11 @@ sources:
|
|
|
25
25
|
|
|
26
26
|
# Authoring Kindgi agents in Python
|
|
27
27
|
|
|
28
|
-
> **Running `kindgi`:**
|
|
29
|
-
>
|
|
30
|
-
>
|
|
28
|
+
> **Running `kindgi`:** the CLI is `kindgi-cli` from PyPI, pinned in the
|
|
29
|
+
> pack's dev group, so every `kindgi <command>` below runs as
|
|
30
|
+
> `uv run kindgi <command>` (Poetry: `poetry run kindgi <command>`). Python
|
|
31
|
+
> commands run in the pack's environment the same way: `uv run …` (or
|
|
32
|
+
> `.venv/bin/python …`).
|
|
31
33
|
|
|
32
34
|
An **agent** is a versioned, model-driven orchestrator: instructions (a
|
|
33
35
|
prompt template), the tools it may call, the capabilities its model
|
|
@@ -75,7 +77,7 @@ brief_writer = Agent(
|
|
|
75
77
|
instructions=(
|
|
76
78
|
"You are drafting a brief in {{ jurisdiction }}. The user provides the case "
|
|
77
79
|
"facts; you produce a Section IV argument citing at least two precedents. "
|
|
78
|
-
"
|
|
80
|
+
"Check every cite with the verify-citation tool before using it. Never invent one."
|
|
79
81
|
),
|
|
80
82
|
capabilities=[{"needs": [{"feature": "tool-use"}]}],
|
|
81
83
|
tools=[verify_citation, fetch_precedent], # Tool objects — or {"id", "version"} refs
|
|
@@ -109,7 +111,11 @@ brief_writer = Agent(
|
|
|
109
111
|
`parameters` or the runtime's own variables (`today`, `now`,
|
|
110
112
|
`agent.*`, `conversation.*`), rendered strictly: an unknown variable
|
|
111
113
|
fails the turn. Write it as a brief for a capable colleague: what to
|
|
112
|
-
do, which tools to prefer, what to refuse, the quality bar.
|
|
114
|
+
do, which tools to prefer, what to refuse, the quality bar. Name a
|
|
115
|
+
tool by what it does ("the verify-citation tool"), never by its dotted
|
|
116
|
+
id: the model sees ids in its provider's form (`acme__verify-citation`
|
|
117
|
+
for Anthropic and OpenAI-compatible models), and `acme.verify-citation`
|
|
118
|
+
in the instructions can make it call a name it wasn't given.
|
|
113
119
|
- **`capabilities`** — what the model must support, e.g.
|
|
114
120
|
`[{"needs": [{"feature": "tool-use"}]}]`. The turn routes its first
|
|
115
121
|
capability to pick a provider and model; none declared fails the turn.
|
|
@@ -159,8 +165,9 @@ brief_writer = Agent(
|
|
|
159
165
|
Agents run on a registered model provider; the router picks one whose
|
|
160
166
|
models satisfy `capabilities`. `kindgi dev` gives a new pack `dev-echo`,
|
|
161
167
|
a **fallback** that answers only while no other provider fits — it
|
|
162
|
-
calls the first tool and replies "
|
|
163
|
-
carries
|
|
168
|
+
calls the first tool and replies "⚠ dev-echo isn't a real model: …"
|
|
169
|
+
then "Tool responded: …", and the turn carries the `fallback-provider` and
|
|
170
|
+
`dev-echo-not-a-model` warnings. Register a real model and it
|
|
164
171
|
takes over: see `kindgi-authoring-providers`
|
|
165
172
|
(`kindgi providers register --preset=anthropic`).
|
|
166
173
|
|
|
@@ -16,8 +16,8 @@ description: >
|
|
|
16
16
|
kindgi-python-authoring-agents.
|
|
17
17
|
type: core
|
|
18
18
|
library: "kindgi (Python)"
|
|
19
|
-
version: "0.1.
|
|
20
|
-
sdk_version: "0.1.4-rc.
|
|
19
|
+
version: "0.1.2"
|
|
20
|
+
sdk_version: "0.1.4-rc.5"
|
|
21
21
|
pack_languages: [python]
|
|
22
22
|
sources:
|
|
23
23
|
- sdks/python/src/kindgi/pack/define.py
|
|
@@ -27,9 +27,11 @@ sources:
|
|
|
27
27
|
|
|
28
28
|
# Authoring Kindgi flows in Python
|
|
29
29
|
|
|
30
|
-
> **Running `kindgi`:**
|
|
31
|
-
>
|
|
32
|
-
>
|
|
30
|
+
> **Running `kindgi`:** the CLI is `kindgi-cli` from PyPI, pinned in the
|
|
31
|
+
> pack's dev group, so every `kindgi <command>` below runs as
|
|
32
|
+
> `uv run kindgi <command>` (Poetry: `poetry run kindgi <command>`). Python
|
|
33
|
+
> commands run in the pack's environment the same way: `uv run …` (or
|
|
34
|
+
> `.venv/bin/python …`).
|
|
33
35
|
|
|
34
36
|
A **flow** is a versioned, durable graph of steps: tools (your code) and
|
|
35
37
|
agents (a model's judgment), joined by edges that can carry conditions.
|
|
@@ -14,8 +14,8 @@ description: >
|
|
|
14
14
|
kindgi-python-authoring-tools.
|
|
15
15
|
type: core
|
|
16
16
|
library: "kindgi (Python)"
|
|
17
|
-
version: "0.1.
|
|
18
|
-
sdk_version: "0.1.4-rc.
|
|
17
|
+
version: "0.1.3"
|
|
18
|
+
sdk_version: "0.1.4-rc.5"
|
|
19
19
|
pack_languages: [python]
|
|
20
20
|
sources:
|
|
21
21
|
- sdks/python/src/kindgi/pack/define.py
|
|
@@ -25,9 +25,11 @@ sources:
|
|
|
25
25
|
|
|
26
26
|
# Authoring Kindgi guardrails in Python
|
|
27
27
|
|
|
28
|
-
> **Running `kindgi`:**
|
|
29
|
-
>
|
|
30
|
-
>
|
|
28
|
+
> **Running `kindgi`:** the CLI is `kindgi-cli` from PyPI, pinned in the
|
|
29
|
+
> pack's dev group, so every `kindgi <command>` below runs as
|
|
30
|
+
> `uv run kindgi <command>` (Poetry: `poetry run kindgi <command>`). Python
|
|
31
|
+
> commands run in the pack's environment the same way: `uv run …` (or
|
|
32
|
+
> `.venv/bin/python …`).
|
|
31
33
|
|
|
32
34
|
A **guardrail** is a rule an agent's turn must satisfy: a **check** (a
|
|
33
35
|
function over the turn's trace) plus an **action** (what happens when it
|
|
@@ -49,7 +51,7 @@ from kindgi import CheckResult, RunTrace, guardrail
|
|
|
49
51
|
|
|
50
52
|
|
|
51
53
|
class Config(BaseModel):
|
|
52
|
-
min_lookups: int = Field(1, alias="minLookups", ge=0)
|
|
54
|
+
min_lookups: int = Field(default=1, alias="minLookups", ge=0)
|
|
53
55
|
|
|
54
56
|
|
|
55
57
|
@guardrail(
|
|
@@ -14,8 +14,8 @@ description: >
|
|
|
14
14
|
kindgi-python-getting-started.
|
|
15
15
|
type: core
|
|
16
16
|
library: "kindgi (Python)"
|
|
17
|
-
version: "0.1.
|
|
18
|
-
sdk_version: "0.1.4-rc.
|
|
17
|
+
version: "0.1.2"
|
|
18
|
+
sdk_version: "0.1.4-rc.5"
|
|
19
19
|
pack_languages: [python]
|
|
20
20
|
sources:
|
|
21
21
|
- sdks/python/src/kindgi/pack/define.py
|
|
@@ -25,9 +25,11 @@ sources:
|
|
|
25
25
|
|
|
26
26
|
# Authoring Kindgi tools in Python
|
|
27
27
|
|
|
28
|
-
> **Running `kindgi`:**
|
|
29
|
-
>
|
|
30
|
-
>
|
|
28
|
+
> **Running `kindgi`:** the CLI is `kindgi-cli` from PyPI, pinned in the
|
|
29
|
+
> pack's dev group, so every `kindgi <command>` below runs as
|
|
30
|
+
> `uv run kindgi <command>` (Poetry: `poetry run kindgi <command>`). Python
|
|
31
|
+
> commands run in the pack's environment the same way: `uv run …` (or
|
|
32
|
+
> `.venv/bin/python …`).
|
|
31
33
|
|
|
32
34
|
A **tool** is a unit of work an agent (or a flow step) calls: typed
|
|
33
35
|
input, typed output, your code in between. In a Python pack it is a
|
|
@@ -14,8 +14,8 @@ description: >
|
|
|
14
14
|
kindgi-python-authoring-agents; models by kindgi-authoring-providers.
|
|
15
15
|
type: core
|
|
16
16
|
library: "kindgi (Python)"
|
|
17
|
-
version: "0.1.
|
|
18
|
-
sdk_version: "0.1.4-rc.
|
|
17
|
+
version: "0.1.7"
|
|
18
|
+
sdk_version: "0.1.4-rc.5"
|
|
19
19
|
pack_languages: [python]
|
|
20
20
|
sources:
|
|
21
21
|
- sdks/python/README.md
|
|
@@ -25,9 +25,11 @@ sources:
|
|
|
25
25
|
|
|
26
26
|
# Getting started with Kindgi in Python
|
|
27
27
|
|
|
28
|
-
> **Running `kindgi`:**
|
|
29
|
-
>
|
|
30
|
-
>
|
|
28
|
+
> **Running `kindgi`:** the CLI is `kindgi-cli` from PyPI (the Kindgi CLI
|
|
29
|
+
> with its own Node, so no Node install), pinned in the pack's dev group.
|
|
30
|
+
> Every `kindgi <command>` below runs as `uv run kindgi <command>` (Poetry:
|
|
31
|
+
> `poetry run kindgi <command>`). Python commands run in the pack's
|
|
32
|
+
> environment the same way: `uv run …`.
|
|
31
33
|
|
|
32
34
|
## What a pack is
|
|
33
35
|
|
|
@@ -52,11 +54,11 @@ primitive; `test_*.py`, `*_test.py` and `conftest.py` are skipped.
|
|
|
52
54
|
## Scaffold a new pack
|
|
53
55
|
|
|
54
56
|
```sh
|
|
55
|
-
kindgi init my-pack --template=python
|
|
57
|
+
uvx --from "kindgi-cli>=0.1,<0.2" kindgi init my-pack --template=python
|
|
56
58
|
cd my-pack
|
|
57
|
-
uv sync # .venv with the kindgi package
|
|
59
|
+
uv sync # .venv with the kindgi package and the kindgi CLI
|
|
58
60
|
uv run pytest
|
|
59
|
-
kindgi dev
|
|
61
|
+
uv run kindgi dev # boots Kindgi locally and runs this pack, reloading on save
|
|
60
62
|
```
|
|
61
63
|
|
|
62
64
|
`kindgi dev` needs Postgres: it starts one in Docker unless
|
|
@@ -70,9 +72,10 @@ kindgi dev # boots Kindgi locally and runs this pack, reloading on save
|
|
|
70
72
|
In the app's directory (where its `pyproject.toml` is):
|
|
71
73
|
|
|
72
74
|
```sh
|
|
73
|
-
|
|
75
|
+
uv add --dev "kindgi-cli>=0.1,<0.2" # the CLI (Poetry: poetry add --group dev …)
|
|
76
|
+
uv run kindgi init # --pack-id=<id> if the app's name doesn't make one
|
|
74
77
|
uv sync # or what it prints for Poetry / pip
|
|
75
|
-
kindgi dev
|
|
78
|
+
uv run kindgi dev
|
|
76
79
|
```
|
|
77
80
|
|
|
78
81
|
`kindgi init` edits the app's `pyproject.toml` in place — your layout and
|
|
@@ -116,17 +119,20 @@ The `[tool.kindgi]` keys are the ones `kindgi.config.ts` takes —
|
|
|
116
119
|
With `kindgi dev` running, from another terminal in the pack directory:
|
|
117
120
|
|
|
118
121
|
```sh
|
|
119
|
-
kindgi runs start --agent=my-pack.echo-agent --input='{"userMessage":"Ada"}'
|
|
122
|
+
uv run kindgi runs start --agent=my-pack.echo-agent --input='{"userMessage":"Ada"}'
|
|
120
123
|
```
|
|
121
124
|
|
|
122
125
|
The answer comes from `dev-echo`, a **fallback** provider a new pack
|
|
123
|
-
gets: no model, no key — it calls the first tool and replies "
|
|
124
|
-
responded: …", and the turn
|
|
125
|
-
|
|
126
|
+
gets: no model, no key — it calls the first tool and replies "⚠
|
|
127
|
+
dev-echo isn't a real model: …" then "Tool responded: …", and the turn
|
|
128
|
+
carries the `fallback-provider` and `dev-echo-not-a-model` warnings. For a
|
|
129
|
+
real model, put an LLM provider's key in `.env` and register its preset
|
|
130
|
+
(Anthropic below; `kindgi providers presets` lists OpenAI, Gemini, Groq and
|
|
131
|
+
OpenRouter too):
|
|
126
132
|
|
|
127
133
|
```sh
|
|
128
|
-
kindgi secrets set ANTHROPIC_API_KEY --env=local --scope=tenant # no-echo prompt
|
|
129
|
-
kindgi providers register --preset=anthropic
|
|
134
|
+
uv run kindgi secrets set ANTHROPIC_API_KEY --env=local --scope=tenant # no-echo prompt
|
|
135
|
+
uv run kindgi providers register --preset=anthropic
|
|
130
136
|
```
|
|
131
137
|
|
|
132
138
|
It takes over at the next turn. That registration is in this project's dev
|
|
@@ -7,9 +7,12 @@ field-level docs. Iterate with `kindgi dev`; `kindgi --help` lists
|
|
|
7
7
|
the full CLI.
|
|
8
8
|
|
|
9
9
|
Agents answer through a model provider. `kindgi dev` gives a new pack
|
|
10
|
-
`dev-echo`, a fallback that calls the first tool and
|
|
11
|
-
"Tool responded: …" while no other provider
|
|
12
|
-
|
|
10
|
+
`dev-echo`, a fallback that isn't a model: it calls the first tool and
|
|
11
|
+
replies "Tool responded: …" after a warning line, while no other provider
|
|
12
|
+
fits. For a real model, put one LLM provider's key in `.env`
|
|
13
|
+
(`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `GROQ_API_KEY` or
|
|
14
|
+
`OPENROUTER_API_KEY`) and declare its preset (`{ preset: 'anthropic' }`,
|
|
15
|
+
`'openai'`, `'gemini-api'`, `'groq'` or `'openrouter'`) in
|
|
13
16
|
`kindgi.config.ts`'s `providers`: `kindgi dev` then registers it on every
|
|
14
17
|
boot, in every worktree. Other providers and per-agent model choice:
|
|
15
18
|
`.claude/skills/kindgi-authoring-providers/SKILL.md`.
|
|
@@ -48,9 +48,11 @@ kindgi runs start --agent=demo.echo-agent --input='{"userMessage":"hi"}'
|
|
|
48
48
|
|
|
49
49
|
## Use a real model
|
|
50
50
|
|
|
51
|
-
`kindgi dev` gives a new pack `dev-echo`, a fallback provider that
|
|
52
|
-
first tool and replies "Tool responded: …"
|
|
53
|
-
|
|
51
|
+
`kindgi dev` gives a new pack `dev-echo`, a fallback provider that isn't a
|
|
52
|
+
model: it calls the first tool and replies "Tool responded: …", after a
|
|
53
|
+
warning line that says so. It answers only while no other provider fits. To
|
|
54
|
+
use a real model, set one LLM provider's key and register its preset, with
|
|
55
|
+
`kindgi dev` running, from another terminal. For Claude:
|
|
54
56
|
|
|
55
57
|
```sh
|
|
56
58
|
kindgi secrets set ANTHROPIC_API_KEY --env=local --scope=tenant # no-echo prompt; writes .env.local
|
|
@@ -58,8 +60,12 @@ kindgi providers register --preset=anthropic # Opus 5.5, So
|
|
|
58
60
|
```
|
|
59
61
|
|
|
60
62
|
Claude takes over from dev-echo on the next turn; nothing to restart.
|
|
61
|
-
`--models=claude-haiku-4-5` registers one model only
|
|
62
|
-
|
|
63
|
+
`--models=claude-haiku-4-5` registers one model only. OpenAI
|
|
64
|
+
(`OPENAI_API_KEY`, `--preset=openai`), Gemini (`GEMINI_API_KEY`,
|
|
65
|
+
`--preset=gemini-api`), Groq (`GROQ_API_KEY`, `--preset=groq`) and
|
|
66
|
+
OpenRouter, many vendors' models with one key (`OPENROUTER_API_KEY`,
|
|
67
|
+
`--preset=openrouter`), work the same way; `kindgi providers presets` lists
|
|
68
|
+
the presets (Gemini on Vertex AI too). Picking a model per
|
|
63
69
|
agent, and other providers: `.claude/skills/kindgi-authoring-providers/SKILL.md`.
|
|
64
70
|
|
|
65
71
|
## Note on `@kindgi/sdk` versioning
|
|
@@ -11,10 +11,13 @@ starts with `_`. The config is `[tool.kindgi]` in `pyproject.toml`.
|
|
|
11
11
|
- `uv run pytest` runs the tests; a `Tool` or `Guardrail` is still callable.
|
|
12
12
|
- `uv run python -m kindgi.pack index --pack-dir .` shows what Kindgi sees.
|
|
13
13
|
- Agents answer through a model provider. `kindgi dev` gives a new pack
|
|
14
|
-
`dev-echo`, a fallback that calls the first tool and
|
|
15
|
-
"Tool responded: …" while no other provider
|
|
16
|
-
put
|
|
17
|
-
`
|
|
14
|
+
`dev-echo`, a fallback that isn't a model: it calls the first tool and
|
|
15
|
+
replies "Tool responded: …" after a warning line, while no other provider
|
|
16
|
+
fits. For a real model, put one LLM provider's key in `.env`
|
|
17
|
+
(`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `GROQ_API_KEY` or
|
|
18
|
+
`OPENROUTER_API_KEY`) and add a `[[tool.kindgi.providers]]` table with its
|
|
19
|
+
preset (`preset = "anthropic"`, `"openai"`, `"gemini-api"`, `"groq"` or
|
|
20
|
+
`"openrouter"`) to `pyproject.toml`: `kindgi dev` then registers it
|
|
18
21
|
on every boot, in every worktree. Other providers and per-agent model
|
|
19
22
|
choice: `.claude/skills/kindgi-authoring-providers/SKILL.md`.
|
|
20
23
|
|
|
@@ -35,9 +35,11 @@ kindgi runs start --agent={{PACK_ID}}.echo-agent --input='{"userMessage":"hi"}'
|
|
|
35
35
|
|
|
36
36
|
## Use a real model
|
|
37
37
|
|
|
38
|
-
`kindgi dev` gives a new pack `dev-echo`, a fallback provider that
|
|
39
|
-
first tool and replies "Tool responded: …"
|
|
40
|
-
|
|
38
|
+
`kindgi dev` gives a new pack `dev-echo`, a fallback provider that isn't a
|
|
39
|
+
model: it calls the first tool and replies "Tool responded: …", after a
|
|
40
|
+
warning line that says so. It answers only while no other provider fits. To
|
|
41
|
+
use a real model, set one LLM provider's key and register its preset, with
|
|
42
|
+
`kindgi dev` running, from another terminal. For Claude:
|
|
41
43
|
|
|
42
44
|
```sh
|
|
43
45
|
kindgi secrets set ANTHROPIC_API_KEY --env=local --scope=tenant # no-echo prompt; writes .env.local
|
|
@@ -45,8 +47,12 @@ kindgi providers register --preset=anthropic # Opus 5.5, So
|
|
|
45
47
|
```
|
|
46
48
|
|
|
47
49
|
Claude takes over from dev-echo on the next turn; nothing to restart.
|
|
48
|
-
`--models=claude-haiku-4-5` registers one model only
|
|
49
|
-
|
|
50
|
+
`--models=claude-haiku-4-5` registers one model only. OpenAI
|
|
51
|
+
(`OPENAI_API_KEY`, `--preset=openai`), Gemini (`GEMINI_API_KEY`,
|
|
52
|
+
`--preset=gemini-api`), Groq (`GROQ_API_KEY`, `--preset=groq`) and
|
|
53
|
+
OpenRouter, many vendors' models with one key (`OPENROUTER_API_KEY`,
|
|
54
|
+
`--preset=openrouter`), work the same way; `kindgi providers presets` lists
|
|
55
|
+
the presets (Gemini on Vertex AI too). Picking a model per
|
|
50
56
|
agent, and other providers: `.claude/skills/kindgi-authoring-providers/SKILL.md`.
|
|
51
57
|
|
|
52
58
|
## Build
|
|
@@ -12,8 +12,8 @@ echo_agent = Agent(
|
|
|
12
12
|
name="Echo Agent",
|
|
13
13
|
description="Uses the pack's echo and greet tools; the response-not-empty guardrail guards the output.",
|
|
14
14
|
instructions=(
|
|
15
|
-
"For each user message: if the user sends a name,
|
|
16
|
-
"Otherwise
|
|
15
|
+
"For each user message: if the user sends a name, greet them with the greet tool. "
|
|
16
|
+
"Otherwise echo their message with the echo tool. Quote the tool result verbatim."
|
|
17
17
|
),
|
|
18
18
|
capabilities=[{"needs": [{"feature": "tool-use"}]}],
|
|
19
19
|
tools=[echo, greet],
|
|
@@ -7,9 +7,12 @@ field-level docs. Iterate with `kindgi dev`; `kindgi --help` lists
|
|
|
7
7
|
the full CLI.
|
|
8
8
|
|
|
9
9
|
Agents answer through a model provider. `kindgi dev` gives a new pack
|
|
10
|
-
`dev-echo`, a fallback that calls the first tool and
|
|
11
|
-
"Tool responded: …" while no other provider
|
|
12
|
-
|
|
10
|
+
`dev-echo`, a fallback that isn't a model: it calls the first tool and
|
|
11
|
+
replies "Tool responded: …" after a warning line, while no other provider
|
|
12
|
+
fits. For a real model, put one LLM provider's key in `.env`
|
|
13
|
+
(`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `GROQ_API_KEY` or
|
|
14
|
+
`OPENROUTER_API_KEY`) and declare its preset (`{ preset: 'anthropic' }`,
|
|
15
|
+
`'openai'`, `'gemini-api'`, `'groq'` or `'openrouter'`) in
|
|
13
16
|
`kindgi.config.ts`'s `providers`: `kindgi dev` then registers it on every
|
|
14
17
|
boot, in every worktree. Other providers and per-agent model choice:
|
|
15
18
|
`.claude/skills/kindgi-authoring-providers/SKILL.md`.
|
|
@@ -40,9 +40,11 @@ re-registers on every file save.
|
|
|
40
40
|
|
|
41
41
|
## Use a real model
|
|
42
42
|
|
|
43
|
-
`kindgi dev` gives a new pack `dev-echo`, a fallback provider that
|
|
44
|
-
first tool and replies "Tool responded: …"
|
|
45
|
-
|
|
43
|
+
`kindgi dev` gives a new pack `dev-echo`, a fallback provider that isn't a
|
|
44
|
+
model: it calls the first tool and replies "Tool responded: …", after a
|
|
45
|
+
warning line that says so. It answers only while no other provider fits. To
|
|
46
|
+
use a real model, set one LLM provider's key and register its preset, with
|
|
47
|
+
`kindgi dev` running, from another terminal. For Claude:
|
|
46
48
|
|
|
47
49
|
```sh
|
|
48
50
|
kindgi secrets set ANTHROPIC_API_KEY --env=local --scope=tenant # no-echo prompt; writes .env.local
|
|
@@ -50,8 +52,12 @@ kindgi providers register --preset=anthropic # Opus 5.5, So
|
|
|
50
52
|
```
|
|
51
53
|
|
|
52
54
|
Claude takes over from dev-echo on the next turn; nothing to restart.
|
|
53
|
-
`--models=claude-haiku-4-5` registers one model only
|
|
54
|
-
|
|
55
|
+
`--models=claude-haiku-4-5` registers one model only. OpenAI
|
|
56
|
+
(`OPENAI_API_KEY`, `--preset=openai`), Gemini (`GEMINI_API_KEY`,
|
|
57
|
+
`--preset=gemini-api`), Groq (`GROQ_API_KEY`, `--preset=groq`) and
|
|
58
|
+
OpenRouter, many vendors' models with one key (`OPENROUTER_API_KEY`,
|
|
59
|
+
`--preset=openrouter`), work the same way; `kindgi providers presets` lists
|
|
60
|
+
the presets (Gemini on Vertex AI too). Picking a model per
|
|
55
61
|
agent, and other providers: `.claude/skills/kindgi-authoring-providers/SKILL.md`.
|
|
56
62
|
|
|
57
63
|
## The four primitives (one file each)
|
|
@@ -12,7 +12,7 @@ const defined = defineAgent({
|
|
|
12
12
|
description:
|
|
13
13
|
'Uses the pack\'s echo + greet tools; the response-not-empty guardrail guards the output.',
|
|
14
14
|
instructions:
|
|
15
|
-
'For each user message: if the user sends a name,
|
|
15
|
+
'For each user message: if the user sends a name, greet them with the greet tool. Otherwise echo their message with the echo tool. Quote the tool result verbatim in your reply.',
|
|
16
16
|
capabilities: [{ needs: [{ feature: 'tool-use' as const }] }],
|
|
17
17
|
tools: [
|
|
18
18
|
{ id: '{{PACK_ID}}.echo', version: '{{PACK_VERSION}}' },
|