@nola-lang/providers 0.1.9 → 0.1.10

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.
Files changed (2) hide show
  1. package/dist/openai.js +5 -2
  2. package/package.json +3 -3
package/dist/openai.js CHANGED
@@ -17,11 +17,14 @@ function toStrict(schema) {
17
17
  function toStrictNode(schema) {
18
18
  if ("$ref" in schema)
19
19
  return { $ref: schema.$ref };
20
- // emit 15 shapes: choice and literals pass through; strict mode accepts anyOf/const
20
+ // emit 15 shapes: choice passes through; strict mode accepts anyOf.
21
+ // A literal keeps its `const` but gains the `type` it implies: OpenAI-compatible
22
+ // backends (Cerebras) reject a bare `{ const }` node as an unsupported field,
23
+ // and every backend accepts the typed form (it is a strict subset).
21
24
  if ("anyOf" in schema)
22
25
  return { anyOf: schema.anyOf.map(toStrictNode) };
23
26
  if ("const" in schema)
24
- return { const: schema.const };
27
+ return { type: typeof schema.const, const: schema.const };
25
28
  switch (schema.type) {
26
29
  case "object": {
27
30
  if (!("properties" in schema)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nola-lang/providers",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Nola bring-your-own LLM providers: openai, anthropic, google, typesafe, mock, resilience combinators, record/replay",
5
5
  "keywords": [
6
6
  "nola",
@@ -37,8 +37,8 @@
37
37
  "!dist/**/*.map"
38
38
  ],
39
39
  "dependencies": {
40
- "@nola-lang/ast": "0.1.9",
41
- "@nola-lang/core": "0.1.9"
40
+ "@nola-lang/ast": "0.1.10",
41
+ "@nola-lang/core": "0.1.10"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=22"