@botpress/cognitive 0.3.7 → 0.3.9

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.
@@ -1,19 +1,19 @@
1
1
 
2
- > @botpress/cognitive@0.3.7 build /home/runner/work/botpress/botpress/packages/cognitive
2
+ > @botpress/cognitive@0.3.9 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.7 build:type /home/runner/work/botpress/botpress/packages/cognitive
6
+ > @botpress/cognitive@0.3.9 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 7067ms
14
- DTS dist/index.d.ts 663.58 KB
13
+ DTS ⚡️ Build success in 6954ms
14
+ DTS dist/index.d.ts 665.56 KB
15
15
 
16
- > @botpress/cognitive@0.3.7 build:neutral /home/runner/work/botpress/botpress/packages/cognitive
16
+ > @botpress/cognitive@0.3.9 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
- /** Model name */
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;
@@ -4418,6 +4426,52 @@ type TrackAnalyticsInput = TrackAnalyticsRequestBody & TrackAnalyticsRequestHead
4418
4426
  interface TrackAnalyticsResponse {
4419
4427
  }
4420
4428
 
4429
+ interface CaptureObservationRequestHeaders {
4430
+ }
4431
+ interface CaptureObservationRequestQuery {
4432
+ }
4433
+ interface CaptureObservationRequestParams {
4434
+ }
4435
+ interface CaptureObservationRequestBody {
4436
+ /**
4437
+ * Name of the observation
4438
+ */
4439
+ name: string;
4440
+ /**
4441
+ * Data of the observation
4442
+ */
4443
+ data: {
4444
+ [k: string]: any;
4445
+ };
4446
+ /**
4447
+ * ID of the message associated with the observation
4448
+ */
4449
+ messageId?: string;
4450
+ /**
4451
+ * ID of the event associated with the observation
4452
+ */
4453
+ eventId?: string;
4454
+ /**
4455
+ * ID of the conversation associated with the observation
4456
+ */
4457
+ conversationId?: string;
4458
+ /**
4459
+ * ID of the user associated with the observation
4460
+ */
4461
+ userId?: string;
4462
+ /**
4463
+ * ID of the error associated with the observation
4464
+ */
4465
+ errorId?: string;
4466
+ /**
4467
+ * ID of the trace associated with the observation
4468
+ */
4469
+ traceId?: string;
4470
+ }
4471
+ type CaptureObservationInput = CaptureObservationRequestBody & CaptureObservationRequestHeaders & CaptureObservationRequestQuery & CaptureObservationRequestParams;
4472
+ interface CaptureObservationResponse {
4473
+ }
4474
+
4421
4475
  interface RunVrlRequestHeaders {
4422
4476
  }
4423
4477
  interface RunVrlRequestQuery {
@@ -6882,7 +6936,7 @@ interface CreateBotRequestBody {
6882
6936
  name: string;
6883
6937
  }[];
6884
6938
  /**
6885
- * URL of the [Bot](#schema_bot); Only available for dev bots
6939
+ * URL of the [Bot](#schema_bot)
6886
6940
  */
6887
6941
  url?: string;
6888
6942
  /**
@@ -7316,9 +7370,9 @@ interface UpdateBotRequestParams {
7316
7370
  }
7317
7371
  interface UpdateBotRequestBody {
7318
7372
  /**
7319
- * URL of the [Bot](#schema_bot); Only available for dev bots
7373
+ * URL of the [Bot](#schema_bot)
7320
7374
  */
7321
- url?: string;
7375
+ url?: string | null;
7322
7376
  /**
7323
7377
  * Type of the [Bot](#schema_bot) authentication (`iam`)
7324
7378
  */
@@ -8631,6 +8685,9 @@ interface ListActionRunsResponse {
8631
8685
  * ISO 8601 timestamp of the action run
8632
8686
  */
8633
8687
  timestamp: string;
8688
+ /**
8689
+ * Alias of the integration instance used for this action run
8690
+ */
8634
8691
  integrationName?: string;
8635
8692
  actionType: string;
8636
8693
  /**
@@ -8639,12 +8696,20 @@ interface ListActionRunsResponse {
8639
8696
  input: {
8640
8697
  [k: string]: any;
8641
8698
  };
8699
+ /**
8700
+ * Present if the length of the action's input exceeds 190 KB.
8701
+ */
8702
+ inputTruncated?: boolean;
8642
8703
  /**
8643
8704
  * Output of the action
8644
8705
  */
8645
8706
  output: {
8646
8707
  [k: string]: any;
8647
8708
  } | null;
8709
+ /**
8710
+ * Present if the length of the action's output exceeds 190 KB.
8711
+ */
8712
+ outputTruncated?: boolean;
8648
8713
  status: "SUCCESS" | "FAILURE";
8649
8714
  durationMs: number;
8650
8715
  cached: boolean;
@@ -9170,7 +9235,7 @@ interface CreateWorkspaceResponse {
9170
9235
  createdAt: string;
9171
9236
  updatedAt: string;
9172
9237
  botCount: number;
9173
- billingVersion: "v1" | "v2" | "v3";
9238
+ billingVersion: "v1" | "v2" | "v3" | "v4";
9174
9239
  plan: "community" | "team" | "enterprise" | "plus";
9175
9240
  blocked: boolean;
9176
9241
  spendingLimit: number;
@@ -9224,7 +9289,7 @@ interface GetWorkspaceResponse {
9224
9289
  createdAt: string;
9225
9290
  updatedAt: string;
9226
9291
  botCount: number;
9227
- billingVersion: "v1" | "v2" | "v3";
9292
+ billingVersion: "v1" | "v2" | "v3" | "v4";
9228
9293
  plan: "community" | "team" | "enterprise" | "plus";
9229
9294
  blocked: boolean;
9230
9295
  spendingLimit: number;
@@ -9396,7 +9461,7 @@ interface UpdateWorkspaceResponse$1 {
9396
9461
  createdAt: string;
9397
9462
  updatedAt: string;
9398
9463
  botCount: number;
9399
- billingVersion: "v1" | "v2" | "v3";
9464
+ billingVersion: "v1" | "v2" | "v3" | "v4";
9400
9465
  plan: "community" | "team" | "enterprise" | "plus";
9401
9466
  blocked: boolean;
9402
9467
  spendingLimit: number;
@@ -9453,7 +9518,7 @@ interface UpdateWorkspaceResponse {
9453
9518
  createdAt: string;
9454
9519
  updatedAt: string;
9455
9520
  botCount: number;
9456
- billingVersion: "v1" | "v2" | "v3";
9521
+ billingVersion: "v1" | "v2" | "v3" | "v4";
9457
9522
  plan: "community" | "team" | "enterprise" | "plus";
9458
9523
  blocked: boolean;
9459
9524
  spendingLimit: number;
@@ -18552,6 +18617,7 @@ declare class Client$1 {
18552
18617
  readonly getOrCreateWorkflow: (input: GetOrCreateWorkflowInput) => Promise<GetOrCreateWorkflowResponse>;
18553
18618
  readonly listTagValues: (input: ListTagValuesInput) => Promise<ListTagValuesResponse>;
18554
18619
  readonly trackAnalytics: (input: TrackAnalyticsInput) => Promise<TrackAnalyticsResponse>;
18620
+ readonly captureObservation: (input: CaptureObservationInput) => Promise<CaptureObservationResponse>;
18555
18621
  readonly runVrl: (input: RunVrlInput) => Promise<RunVrlResponse>;
18556
18622
  readonly getAccount: (input: GetAccountInput) => Promise<GetAccountResponse>;
18557
18623
  readonly updateAccount: (input: UpdateAccountInput) => Promise<UpdateAccountResponse>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/cognitive",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "Wrapper around the Botpress Client to call LLMs",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",