Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@botpress/cli",
"version": "4.20.0",
"version": "4.20.1",
"description": "Botpress CLI",
"scripts": {
"build": "pnpm run build:types && pnpm run bundle && pnpm run template:gen",
Expand All @@ -27,7 +27,7 @@
"@apidevtools/json-schema-ref-parser": "^11.7.0",
"@botpress/chat": "0.5.2",
"@botpress/client": "1.26.0",
"@botpress/sdk": "4.17.0",
"@botpress/sdk": "4.17.1",
"@bpinternal/const": "^0.1.0",
"@bpinternal/tunnel": "^0.1.1",
"@bpinternal/yargs-extra": "^0.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/code-generation/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as consts from './consts'
export type Primitive = string | number | boolean | null | undefined

export const zuiSchemaToTypeScriptType = async (zuiSchema: sdk.z.Schema, name: string): Promise<string> => {
let code = zuiSchema.toTypescriptType()
let code = zuiSchema.toTypescriptType({ treatDefaultAsOptional: true })
code = `export type ${name} = ${code}`
code = await prettier.format(code, { parser: 'typescript' })
return [
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/empty-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"private": true,
"dependencies": {
"@botpress/client": "1.26.0",
"@botpress/sdk": "4.17.0"
"@botpress/sdk": "4.17.1"
},
"devDependencies": {
"@types/node": "^22.16.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/empty-integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"private": true,
"dependencies": {
"@botpress/client": "1.26.0",
"@botpress/sdk": "4.17.0"
"@botpress/sdk": "4.17.1"
},
"devDependencies": {
"@types/node": "^22.16.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/empty-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"private": true,
"dependencies": {
"@botpress/sdk": "4.17.0"
"@botpress/sdk": "4.17.1"
},
"devDependencies": {
"@types/node": "^22.16.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"private": true,
"dependencies": {
"@botpress/client": "1.26.0",
"@botpress/sdk": "4.17.0"
"@botpress/sdk": "4.17.1"
},
"devDependencies": {
"@types/node": "^22.16.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/templates/webhook-message/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"private": true,
"dependencies": {
"@botpress/client": "1.26.0",
"@botpress/sdk": "4.17.0",
"@botpress/sdk": "4.17.1",
"axios": "^1.6.8"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/cognitive/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ const common: esbuild.BuildOptions = {

async function generateTypes() {
const code =
`export type GenerateContentInput = ${llm.schemas.GenerateContentInputSchema(z.any()).toTypescriptType()};
`export type GenerateContentInput = ${llm.schemas.GenerateContentInputSchema(z.any()).toTypescriptType({ treatDefaultAsOptional: true })};

export type GenerateContentOutput = ${llm.schemas.GenerateContentOutputSchema.toTypescriptType()};
export type GenerateContentOutput = ${llm.schemas.GenerateContentOutputSchema.toTypescriptType({ treatDefaultAsOptional: true })};

export type Model = ${llm.schemas.ModelSchema.toTypescriptType()};
export type Model = ${llm.schemas.ModelSchema.toTypescriptType({ treatDefaultAsOptional: true })};
`.trim()

const filePath = './src/schemas.gen.ts'
Expand Down
4 changes: 2 additions & 2 deletions packages/cognitive/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@botpress/cognitive",
"version": "0.1.47",
"version": "0.1.48",
"description": "Wrapper around the Botpress Client to call LLMs",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
Expand Down Expand Up @@ -34,7 +34,7 @@
"devDependencies": {
"@botpress/client": "workspace:*",
"@botpress/common": "workspace:*",
"@bpinternal/zui": "^1.0.1",
"@bpinternal/zui": "1.2.1",
"@size-limit/file": "^11.1.6",
"@types/axios": "^0.14.4",
"@types/debug": "^4.1.12",
Expand Down
4 changes: 2 additions & 2 deletions packages/cognitive/src/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type GenerateContentInput = {
type: 'text' | 'image'
/** Indicates the MIME type of the content. If not provided it will be detected from the content-type header of the provided URL. */
mimeType?: string
/** Required if part type is "text" */
/** Required if part type is "text" */
text?: string
/** Required if part type is "image" */
url?: string
Expand Down Expand Up @@ -103,7 +103,7 @@ export type GenerateContentOutput = {
type: 'text' | 'image'
/** Indicates the MIME type of the content. If not provided it will be detected from the content-type header of the provided URL. */
mimeType?: string
/** Required if part type is "text" */
/** Required if part type is "text" */
text?: string
/** Required if part type is "image" */
url?: string
Expand Down
2 changes: 1 addition & 1 deletion packages/llmz/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@botpress/client": "workspace:^",
"@botpress/zai": "^2.0.8",
"@bpinternal/zui": "^1.0.1",
"@bpinternal/zui": "1.2.1",
"chalk": "^4.1.2",
"llmz": "link:..",
"lodash": "^4.17.21",
Expand Down
6 changes: 3 additions & 3 deletions packages/llmz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "llmz",
"type": "module",
"description": "LLMz – An LLM-native Typescript VM built on top of Zui",
"version": "0.0.26",
"version": "0.0.27",
"types": "./dist/index.d.ts",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
Expand Down Expand Up @@ -70,9 +70,9 @@
},
"peerDependencies": {
"@botpress/client": "1.26.0",
"@botpress/cognitive": "0.1.47",
"@botpress/cognitive": "0.1.48",
"@bpinternal/thicktoken": "^1.0.5",
"@bpinternal/zui": "^1.0.1"
"@bpinternal/zui": "1.2.1"
},
"dependenciesMeta": {
"@bpinternal/zui": {
Expand Down
2 changes: 1 addition & 1 deletion packages/llmz/src/prompts/dual-modes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const getSystemMessage: Prompt['getSystemMessage'] = async (props) => {
name: exit.name,
description: exit.description,
has_typings: true,
typings: exit.zSchema.toTypescriptType(),
typings: exit.zSchema.toTypescriptType({ treatDefaultAsOptional: true }),
})
} else {
exits.push({
Expand Down
2 changes: 1 addition & 1 deletion packages/llmz/src/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ ${typeof schema.value === 'string' ? escapeString(schema.value) : schema.value}`
}

try {
let typings = schema?.toTypescriptType()
let typings = schema?.toTypescriptType({ treatDefaultAsOptional: true })
typings ??= 'unknown'

return stripSpaces(typings)
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@botpress/sdk",
"version": "4.17.0",
"version": "4.17.1",
"description": "Botpress SDK",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
Expand Down Expand Up @@ -28,7 +28,7 @@
"tsup": "^8.0.2"
},
"peerDependencies": {
"@bpinternal/zui": "^1.0.1",
"@bpinternal/zui": "1.2.1",
"esbuild": "^0.16.12"
},
"peerDependenciesMeta": {
Expand Down
4 changes: 2 additions & 2 deletions packages/vai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@botpress/vai",
"version": "0.0.6",
"version": "0.0.7",
"description": "Vitest AI (vai) – a vitest extension for testing with LLMs",
"types": "./dist/index.d.ts",
"exports": {
Expand Down Expand Up @@ -41,7 +41,7 @@
"peerDependencies": {
"@botpress/client": "1.26.0",
"@bpinternal/thicktoken": "^1.0.1",
"@bpinternal/zui": "^1.0.1",
"@bpinternal/zui": "1.2.1",
"lodash": "^4.17.21",
"vitest": "^2 || ^3 || ^4 || ^5"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vai/src/utils/predictJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ${options.systemMessage}
---
Please generate a JSON response with the following format:
\`\`\`typescript
${outputSchema.toTypescriptType()}
${outputSchema.toTypescriptType({ treatDefaultAsOptional: true })}
\`\`\`
`.trim(),
messages: [
Expand Down
6 changes: 3 additions & 3 deletions packages/zai/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@botpress/zai",
"description": "Zui AI (zai) – An LLM utility library written on top of Zui and the Botpress API",
"version": "2.1.16",
"version": "2.1.17",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
Expand Down Expand Up @@ -32,7 +32,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@botpress/cognitive": "0.1.47",
"@botpress/cognitive": "0.1.48",
"json5": "^2.2.3",
"jsonrepair": "^3.10.0",
"lodash-es": "^4.17.21"
Expand All @@ -53,7 +53,7 @@
},
"peerDependencies": {
"@bpinternal/thicktoken": "^1.0.0",
"@bpinternal/zui": "^1.0.1"
"@bpinternal/zui": "1.2.1"
},
"engines": {
"node": ">=18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/zai/src/operations/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const extract = async <S extends OfType<AnyObjectOrArray>>(
} catch {}
}

const schemaTypescript = schema.toTypescriptType({ declaration: false })
const schemaTypescript = schema.toTypescriptType({ declaration: false, treatDefaultAsOptional: true })
const schemaLength = tokenizer.count(schemaTypescript)

options.chunkLength = Math.min(options.chunkLength, model.input.maxTokens - PROMPT_INPUT_BUFFER - schemaLength)
Expand Down
2 changes: 1 addition & 1 deletion plugins/knowledge/src/question-prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Questions should be extracted with the following JSON format:
If there are no questions in the USER MESSAGE, return an empty array.

Always respond in JSON with the following format:
type OutputFormat = ${ExtractedQuestion.toTypescriptType()}
type OutputFormat = ${ExtractedQuestion.toTypescriptType({ treatDefaultAsOptional: true })}

The below examples are for illustrative purposes only. Your responses will be evaluated based on the quality of the questions extracted.
Please extract the questions found on line L${args.line} only. If there are no questions, return an empty array.
Expand Down
2 changes: 1 addition & 1 deletion plugins/personality/src/rewrite-prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const userPrompt = (args: PromptArgs): string => dedent`
{ "payload": ${args.payload} }
\`\`\`

type OutputFormat = ${responseSchema.toTypescriptType()}
type OutputFormat = ${responseSchema.toTypescriptType({ treatDefaultAsOptional: true })}
`

export const prompt = (args: PromptArgs): LLMInput => ({
Expand Down
Loading
Loading