@botpress/cognitive 0.3.6 → 0.3.8
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/.turbo/turbo-build.log +5 -5
- package/dist/index.d.ts +27 -8
- package/package.json +2 -1
- package/vitest.config.ts +2 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/cognitive@0.3.
|
|
2
|
+
> @botpress/cognitive@0.3.8 build /home/runner/work/botpress/botpress/packages/cognitive
|
|
3
3
|
> pnpm build:type && pnpm build:neutral && size-limit
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @botpress/cognitive@0.3.
|
|
6
|
+
> @botpress/cognitive@0.3.8 build:type /home/runner/work/botpress/botpress/packages/cognitive
|
|
7
7
|
> tsup --tsconfig tsconfig.build.json ./src/index.ts --dts-resolve --dts-only --clean
|
|
8
8
|
|
|
9
9
|
CLI Building entry: ./src/index.ts
|
|
10
10
|
CLI Using tsconfig: tsconfig.build.json
|
|
11
11
|
CLI tsup v8.0.2
|
|
12
12
|
DTS Build start
|
|
13
|
-
DTS ⚡️ Build success in
|
|
14
|
-
DTS dist/index.d.ts
|
|
13
|
+
DTS ⚡️ Build success in 6505ms
|
|
14
|
+
DTS dist/index.d.ts 664.36 KB
|
|
15
15
|
|
|
16
|
-
> @botpress/cognitive@0.3.
|
|
16
|
+
> @botpress/cognitive@0.3.8 build:neutral /home/runner/work/botpress/botpress/packages/cognitive
|
|
17
17
|
> ts-node -T ./build.ts --neutral
|
|
18
18
|
|
|
19
19
|
Done
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ type GenerateContentInput = {
|
|
|
49
49
|
topP?: number;
|
|
50
50
|
/** Sequences where the model should stop generating further tokens. */
|
|
51
51
|
stopSequences?: string[];
|
|
52
|
+
/** List of tools available for the model to use */
|
|
52
53
|
tools?: Array<{
|
|
53
54
|
type: 'function';
|
|
54
55
|
function: {
|
|
@@ -59,14 +60,17 @@ type GenerateContentInput = {
|
|
|
59
60
|
argumentsSchema?: {};
|
|
60
61
|
};
|
|
61
62
|
}>;
|
|
63
|
+
/** The chosen tool to use for content generation */
|
|
62
64
|
toolChoice?: {
|
|
63
65
|
type?: 'auto' | 'specific' | 'any' | 'none' | '';
|
|
64
66
|
/** Required if `type` is "specific" */
|
|
65
67
|
functionName?: string;
|
|
66
68
|
};
|
|
69
|
+
/** Unique identifier of the user that sent the prompt */
|
|
67
70
|
userId?: string;
|
|
68
71
|
/** Set to `true` to output debug information to the bot logs */
|
|
69
72
|
debug?: boolean;
|
|
73
|
+
/** Contextual metadata about the prompt */
|
|
70
74
|
meta?: {
|
|
71
75
|
/** Source of the prompt, e.g. agent/:id/:version cards/ai-generate, cards/ai-task, nodes/autonomous, etc. */
|
|
72
76
|
promptSource?: string;
|
|
@@ -80,8 +84,9 @@ type GenerateContentOutput = {
|
|
|
80
84
|
id: string;
|
|
81
85
|
/** LLM provider name */
|
|
82
86
|
provider: string;
|
|
83
|
-
/**
|
|
87
|
+
/** The name of the LLM model that was used */
|
|
84
88
|
model: string;
|
|
89
|
+
/** Array of generated message choices from the model */
|
|
85
90
|
choices: Array<{
|
|
86
91
|
type?: 'text' | 'tool_calls' | 'tool_result' | 'multipart';
|
|
87
92
|
/** Required if `type` is "tool_calls" */
|
|
@@ -112,6 +117,7 @@ type GenerateContentOutput = {
|
|
|
112
117
|
index: number;
|
|
113
118
|
stopReason: 'stop' | 'max_tokens' | 'tool_calls' | 'content_filter' | 'other';
|
|
114
119
|
}>;
|
|
120
|
+
/** A breakdown of token usage and cost information */
|
|
115
121
|
usage: {
|
|
116
122
|
/** Number of input tokens used by the model */
|
|
117
123
|
inputTokens: number;
|
|
@@ -122,12 +128,14 @@ type GenerateContentOutput = {
|
|
|
122
128
|
/** Cost of the output tokens generated by the model, in U.S. dollars */
|
|
123
129
|
outputCost: number;
|
|
124
130
|
};
|
|
131
|
+
/** Metadata added by Botpress */
|
|
125
132
|
botpress: {
|
|
126
133
|
/** Total cost of the content generation, in U.S. dollars */
|
|
127
134
|
cost: number;
|
|
128
135
|
};
|
|
129
136
|
};
|
|
130
137
|
type Model$2 = {
|
|
138
|
+
/** Unique identifier of the large language model */
|
|
131
139
|
id: string;
|
|
132
140
|
name: string;
|
|
133
141
|
description: string;
|
|
@@ -6882,7 +6890,7 @@ interface CreateBotRequestBody {
|
|
|
6882
6890
|
name: string;
|
|
6883
6891
|
}[];
|
|
6884
6892
|
/**
|
|
6885
|
-
* URL of the [Bot](#schema_bot)
|
|
6893
|
+
* URL of the [Bot](#schema_bot)
|
|
6886
6894
|
*/
|
|
6887
6895
|
url?: string;
|
|
6888
6896
|
/**
|
|
@@ -7316,9 +7324,9 @@ interface UpdateBotRequestParams {
|
|
|
7316
7324
|
}
|
|
7317
7325
|
interface UpdateBotRequestBody {
|
|
7318
7326
|
/**
|
|
7319
|
-
* URL of the [Bot](#schema_bot)
|
|
7327
|
+
* URL of the [Bot](#schema_bot)
|
|
7320
7328
|
*/
|
|
7321
|
-
url?: string;
|
|
7329
|
+
url?: string | null;
|
|
7322
7330
|
/**
|
|
7323
7331
|
* Type of the [Bot](#schema_bot) authentication (`iam`)
|
|
7324
7332
|
*/
|
|
@@ -8631,6 +8639,9 @@ interface ListActionRunsResponse {
|
|
|
8631
8639
|
* ISO 8601 timestamp of the action run
|
|
8632
8640
|
*/
|
|
8633
8641
|
timestamp: string;
|
|
8642
|
+
/**
|
|
8643
|
+
* Alias of the integration instance used for this action run
|
|
8644
|
+
*/
|
|
8634
8645
|
integrationName?: string;
|
|
8635
8646
|
actionType: string;
|
|
8636
8647
|
/**
|
|
@@ -8639,12 +8650,20 @@ interface ListActionRunsResponse {
|
|
|
8639
8650
|
input: {
|
|
8640
8651
|
[k: string]: any;
|
|
8641
8652
|
};
|
|
8653
|
+
/**
|
|
8654
|
+
* Present if the length of the action's input exceeds 190 KB.
|
|
8655
|
+
*/
|
|
8656
|
+
inputTruncated?: boolean;
|
|
8642
8657
|
/**
|
|
8643
8658
|
* Output of the action
|
|
8644
8659
|
*/
|
|
8645
8660
|
output: {
|
|
8646
8661
|
[k: string]: any;
|
|
8647
8662
|
} | null;
|
|
8663
|
+
/**
|
|
8664
|
+
* Present if the length of the action's output exceeds 190 KB.
|
|
8665
|
+
*/
|
|
8666
|
+
outputTruncated?: boolean;
|
|
8648
8667
|
status: "SUCCESS" | "FAILURE";
|
|
8649
8668
|
durationMs: number;
|
|
8650
8669
|
cached: boolean;
|
|
@@ -9170,7 +9189,7 @@ interface CreateWorkspaceResponse {
|
|
|
9170
9189
|
createdAt: string;
|
|
9171
9190
|
updatedAt: string;
|
|
9172
9191
|
botCount: number;
|
|
9173
|
-
billingVersion: "v1" | "v2" | "v3";
|
|
9192
|
+
billingVersion: "v1" | "v2" | "v3" | "v4";
|
|
9174
9193
|
plan: "community" | "team" | "enterprise" | "plus";
|
|
9175
9194
|
blocked: boolean;
|
|
9176
9195
|
spendingLimit: number;
|
|
@@ -9224,7 +9243,7 @@ interface GetWorkspaceResponse {
|
|
|
9224
9243
|
createdAt: string;
|
|
9225
9244
|
updatedAt: string;
|
|
9226
9245
|
botCount: number;
|
|
9227
|
-
billingVersion: "v1" | "v2" | "v3";
|
|
9246
|
+
billingVersion: "v1" | "v2" | "v3" | "v4";
|
|
9228
9247
|
plan: "community" | "team" | "enterprise" | "plus";
|
|
9229
9248
|
blocked: boolean;
|
|
9230
9249
|
spendingLimit: number;
|
|
@@ -9396,7 +9415,7 @@ interface UpdateWorkspaceResponse$1 {
|
|
|
9396
9415
|
createdAt: string;
|
|
9397
9416
|
updatedAt: string;
|
|
9398
9417
|
botCount: number;
|
|
9399
|
-
billingVersion: "v1" | "v2" | "v3";
|
|
9418
|
+
billingVersion: "v1" | "v2" | "v3" | "v4";
|
|
9400
9419
|
plan: "community" | "team" | "enterprise" | "plus";
|
|
9401
9420
|
blocked: boolean;
|
|
9402
9421
|
spendingLimit: number;
|
|
@@ -9453,7 +9472,7 @@ interface UpdateWorkspaceResponse {
|
|
|
9453
9472
|
createdAt: string;
|
|
9454
9473
|
updatedAt: string;
|
|
9455
9474
|
botCount: number;
|
|
9456
|
-
billingVersion: "v1" | "v2" | "v3";
|
|
9475
|
+
billingVersion: "v1" | "v2" | "v3" | "v4";
|
|
9457
9476
|
plan: "community" | "team" | "enterprise" | "plus";
|
|
9458
9477
|
blocked: boolean;
|
|
9459
9478
|
spendingLimit: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/cognitive",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "Wrapper around the Botpress Client to call LLMs",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"build:neutral": "ts-node -T ./build.ts --neutral",
|
|
16
16
|
"build": "pnpm build:type && pnpm build:neutral && size-limit",
|
|
17
17
|
"test:e2e": "vitest run --dir ./e2e",
|
|
18
|
+
"test": "vitest --run",
|
|
18
19
|
"refresh:models": "ts-node -T ./refresh-models.ts && pnpm prettier src/cognitive-v2/models.ts --write"
|
|
19
20
|
},
|
|
20
21
|
"size-limit": [
|
package/vitest.config.ts
ADDED