@botpress/zai 2.1.16 → 2.1.17

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.
@@ -56,7 +56,7 @@ const extract = async (input, _schema, _options, ctx) => {
56
56
  } catch {
57
57
  }
58
58
  }
59
- const schemaTypescript = schema.toTypescriptType({ declaration: false });
59
+ const schemaTypescript = schema.toTypescriptType({ declaration: false, treatDefaultAsOptional: true });
60
60
  const schemaLength = tokenizer.count(schemaTypescript);
61
61
  options.chunkLength = Math.min(options.chunkLength, model.input.maxTokens - PROMPT_INPUT_BUFFER - schemaLength);
62
62
  const keys = Object.keys(schema.shape);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@botpress/zai",
3
3
  "description": "Zui AI (zai) – An LLM utility library written on top of Zui and the Botpress API",
4
- "version": "2.1.16",
4
+ "version": "2.1.17",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "exports": {
@@ -9,6 +9,9 @@
9
9
  "require": "./dist/index.js",
10
10
  "import": "./dist/index.js"
11
11
  },
12
+ "repository": {
13
+ "url": "https://github.com/botpress/botpress"
14
+ },
12
15
  "scripts": {
13
16
  "check:type": "tsc --noEmit",
14
17
  "build": "bp add -y && pnpm run build:types && pnpm run build:neutral && size-limit",
@@ -29,7 +32,7 @@
29
32
  "author": "",
30
33
  "license": "ISC",
31
34
  "dependencies": {
32
- "@botpress/cognitive": "0.1.47",
35
+ "@botpress/cognitive": "0.1.48",
33
36
  "json5": "^2.2.3",
34
37
  "jsonrepair": "^3.10.0",
35
38
  "lodash-es": "^4.17.21"
@@ -50,7 +53,7 @@
50
53
  },
51
54
  "peerDependencies": {
52
55
  "@bpinternal/thicktoken": "^1.0.0",
53
- "@bpinternal/zui": "^1.0.1"
56
+ "@bpinternal/zui": "1.2.1"
54
57
  },
55
58
  "engines": {
56
59
  "node": ">=18.0.0"
@@ -100,7 +100,7 @@ const extract = async <S extends OfType<AnyObjectOrArray>>(
100
100
  } catch {}
101
101
  }
102
102
 
103
- const schemaTypescript = schema.toTypescriptType({ declaration: false })
103
+ const schemaTypescript = schema.toTypescriptType({ declaration: false, treatDefaultAsOptional: true })
104
104
  const schemaLength = tokenizer.count(schemaTypescript)
105
105
 
106
106
  options.chunkLength = Math.min(options.chunkLength, model.input.maxTokens - PROMPT_INPUT_BUFFER - schemaLength)