@bivelio/savings-layer 0.5.0-rc.1 → 0.5.1
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 +9 -1
- package/dist/gateway/bin.js +876 -861
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/terminales/README.md +2 -2
- package/docs/terminales/codex.md +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -170,6 +170,9 @@ and the free **Measure** license, which runs the layer in shadow mode on your ow
|
|
|
170
170
|
traffic and shows what it would have saved, valued with your provider's counter. The verifier that replays the optimizer on your own data
|
|
171
171
|
lives in your dashboard once you sign in.
|
|
172
172
|
|
|
173
|
+
**Upgrading from 0.4?** Every breaking change of 0.5, with a before and after for
|
|
174
|
+
each, is in [Migrating from 0.4 to 0.5](https://savings.bivelio.com/en/migrate-to-0.5).
|
|
175
|
+
|
|
173
176
|
## Set it up in one command
|
|
174
177
|
|
|
175
178
|
```bash
|
|
@@ -914,7 +917,7 @@ Ask for a response contract and you also get `data`, validated against your sche
|
|
|
914
917
|
```ts
|
|
915
918
|
const { data, text } = await layer.generate<{ answer: number }>({
|
|
916
919
|
model: "openai/gpt-4o-mini",
|
|
917
|
-
messages: [{ role: "user", content: "
|
|
920
|
+
messages: [{ role: "user", content: "How many legs does a spider have?" }],
|
|
918
921
|
response: {
|
|
919
922
|
contractId: "answer:v1",
|
|
920
923
|
schema: {
|
|
@@ -930,6 +933,11 @@ const { data, text } = await layer.generate<{ answer: number }>({
|
|
|
930
933
|
console.log(data.answer); // 8
|
|
931
934
|
```
|
|
932
935
|
|
|
936
|
+
A question the layer answers on its own (the arithmetic of the first example)
|
|
937
|
+
never reaches the model, so its `data` is the resolver's `{ value: 8 }`, not
|
|
938
|
+
your schema's shape: `report.qualityLedger` says the contract was not met.
|
|
939
|
+
Ask the model for anything you want in your contract's shape.
|
|
940
|
+
|
|
933
941
|
</details>
|
|
934
942
|
|
|
935
943
|
<details>
|