@gemmein/sdk 0.8.0 → 0.9.0
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/CHANGELOG.md +30 -0
- package/README.md +3 -1
- package/REFERENCE.md +121 -38
- package/dist/index.cjs +108 -12
- package/dist/index.d.cts +102 -14
- package/dist/index.d.ts +102 -14
- package/dist/index.js +108 -12
- package/llms.txt +146 -50
- package/migrations/README.md +1 -0
- package/migrations/raw-calls-off.md +51 -0
- package/package.json +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Raw AI calls are off until the owner switches them on
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
Since: 0.9.0
|
|
5
|
+
Action required by: 0.9.0
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
## What changed
|
|
9
|
+
|
|
10
|
+
Before 0.9.0 `g.ai.chat(body)` and `g.ai.text(body)` forwarded the
|
|
11
|
+
provider request the browser composed to any provider the owner had a key
|
|
12
|
+
for. From 0.9.0 that raw call is refused with `403 raw_calls_off` unless the
|
|
13
|
+
owner has switched raw calls on for that provider's key on the AI tools
|
|
14
|
+
page. The cloud applies this to every key, new and existing, from 7 Sep
|
|
15
|
+
2026; the local engine (`gemmein dev`) keeps its keyless fake provider open
|
|
16
|
+
and applies the same rule to a configured key.
|
|
17
|
+
|
|
18
|
+
The normal path is a named tool: the owner defines it on the AI tools page
|
|
19
|
+
or your AI writes `gemmein/ai/tools/<name>.json` (instructions, prompt
|
|
20
|
+
template, typed inputs, model, caps) and the app calls it with inputs only.
|
|
21
|
+
|
|
22
|
+
## Who is affected
|
|
23
|
+
|
|
24
|
+
Apps that call `g.ai.chat` or `g.ai.text` without `tool`, or with a `tool`
|
|
25
|
+
that only prices and gates a browser-composed body. An app that already
|
|
26
|
+
calls `g.ai.run` / `g.ai.runText`, or makes no AI calls, sees no
|
|
27
|
+
difference.
|
|
28
|
+
|
|
29
|
+
## What to do
|
|
30
|
+
|
|
31
|
+
Move each call to a named tool. The prompt leaves the browser and lives on
|
|
32
|
+
the tool:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
// before
|
|
36
|
+
const res = await g.ai.chat({ model: "gpt-4o-mini", messages: [{ role: "user", content: `Summarise: ${text}` }] });
|
|
37
|
+
|
|
38
|
+
// after — gemmein/ai/tools/summarise.json carries the instructions and
|
|
39
|
+
// "promptTemplate": "Summarise: {{text}}", "inputs": [{ "name": "text", "type": "text", "required": true }]
|
|
40
|
+
const res = await g.ai.run("summarise", { text });
|
|
41
|
+
const answer = await g.ai.runText("summarise", { text });
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
An owner who wants the raw path back switches raw calls on for that
|
|
45
|
+
provider's key on the AI tools page; the switch is per key and audited.
|
|
46
|
+
|
|
47
|
+
## How to tell
|
|
48
|
+
|
|
49
|
+
A 403 with `code: "raw_calls_off"` in the response, `err.code ===
|
|
50
|
+
"raw_calls_off"` in the SDK, and the message naming the provider and the
|
|
51
|
+
switch. On the AI calls record the outcome is `refused` with that reason.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gemmein/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Gemmein SDK \u2014 passwordless auth, safe storage, and Stripe-driven record flips for AI-built apps. Small enough that one prompt teaches the whole API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|