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
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@botpress/cli",
"version": "4.17.17",
"version": "4.17.19",
"description": "Botpress CLI",
"scripts": {
"build": "pnpm run build:types && pnpm run bundle && pnpm run template:gen",
Expand Down
21 changes: 13 additions & 8 deletions packages/cli/src/command-implementations/dev-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ProjectCommand, ProjectDefinition } from './project-command'
const DEFAULT_BOT_PORT = 8075
const DEFAULT_INTEGRATION_PORT = 8076
const TUNNEL_HELLO_INTERVAL = 5000
const FILEWATCHER_DEBOUNCE_MS = 2000
const FILEWATCHER_DEBOUNCE_MS = 500

export type DevCommandDefinition = typeof commandDefinitions.dev
export class DevCommand extends ProjectCommand<DevCommandDefinition> {
Expand Down Expand Up @@ -146,16 +146,21 @@ export class DevCommand extends ProjectCommand<DevCommandDefinition> {
return
}

const typescriptEvents = events.filter((e) => pathlib.extname(e.path) === '.ts')
if (typescriptEvents.length === 0) {
return
}
const typescriptEvents = events
.filter((e) => !e.path.startsWith(this.projectPaths.abs.outDir))
.filter((e) => pathlib.extname(e.path) === '.ts')

this.logger.log('Changes detected, rebuilding')
await this._restart(api, worker, httpTunnelUrl)
const distEvents = events.filter((e) => e.path.startsWith(this.projectPaths.abs.distDir))

if (typescriptEvents.length > 0) {
this.logger.log('Changes detected, rebuilding')
await this._restart(api, worker, httpTunnelUrl)
} else if (distEvents.length > 0) {
this.logger.log('Changes detected in output directory, reloading worker')
await worker.reload()
}
},
{
ignore: [this.projectPaths.abs.outDir],
debounceMs: FILEWATCHER_DEBOUNCE_MS,
}
)
Expand Down
2 changes: 1 addition & 1 deletion packages/cognitive/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@botpress/cognitive",
"version": "0.1.41",
"version": "0.1.42",
"description": "Wrapper around the Botpress Client to call LLMs",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
Expand Down
11 changes: 3 additions & 8 deletions packages/cognitive/src/cognitive-v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,12 @@ export class CognitiveBeta {
return data
}

public async listModels(input: void, options: RequestOptions = {}) {
const signal = options.signal ?? AbortSignal.timeout(this._timeout)

public async listModels() {
const { data } = await this._withServerRetry(() =>
this._axiosClient.post<Model[]>('/v2/cognitive/models', input, {
signal,
timeout: options.timeout ?? this._timeout,
})
this._axiosClient.get<{ models: Model[] }>('/v2/cognitive/models')
)

return data
return data.models
}

public async *generateTextStream(
Expand Down
4 changes: 4 additions & 0 deletions packages/cognitive/src/cognitive-v2/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ export type Model = {
id: string
name: string
description: string
/**
* Aliases that are also resolving to this model
*/
aliases?: string[]
tags: (
| 'recommended'
| 'deprecated'
Expand Down
2 changes: 1 addition & 1 deletion packages/llmz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"tsx": "^4.19.2"
},
"peerDependencies": {
"@botpress/cognitive": "0.1.41",
"@botpress/cognitive": "0.1.42",
"@bpinternal/thicktoken": "^1.0.5",
"@bpinternal/zui": "^1.0.1"
},
Expand Down
4 changes: 2 additions & 2 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.11",
"version": "2.1.12",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
Expand Down Expand Up @@ -29,7 +29,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@botpress/cognitive": "0.1.41",
"@botpress/cognitive": "0.1.42",
"json5": "^2.2.3",
"jsonrepair": "^3.10.0",
"lodash-es": "^4.17.21"
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading