@botpress/cognitive 0.1.9 → 0.1.11
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 +28 -15
- package/dist/index.d.ts +721 -353
- package/package.json +1 -1
- package/.turbo/turbo-generate.log +0 -5
- package/bp_modules/llm/definition/actions/generateContent/index.ts +0 -14
- package/bp_modules/llm/definition/actions/generateContent/input.ts +0 -133
- package/bp_modules/llm/definition/actions/generateContent/output.ts +0 -81
- package/bp_modules/llm/definition/actions/index.ts +0 -12
- package/bp_modules/llm/definition/actions/listLanguageModels/index.ts +0 -14
- package/bp_modules/llm/definition/actions/listLanguageModels/input.ts +0 -8
- package/bp_modules/llm/definition/actions/listLanguageModels/output.ts +0 -45
- package/bp_modules/llm/definition/channels/index.ts +0 -6
- package/bp_modules/llm/definition/entities/index.ts +0 -9
- package/bp_modules/llm/definition/entities/modelRef.ts +0 -10
- package/bp_modules/llm/definition/events/index.ts +0 -6
- package/bp_modules/llm/definition/index.ts +0 -23
- package/bp_modules/llm/index.ts +0 -16
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// This file is generated. Do not edit it manually.
|
|
4
|
-
import * as input from "./input";
|
|
5
|
-
export * as input from "./input";
|
|
6
|
-
import * as output from "./output";
|
|
7
|
-
export * as output from "./output";
|
|
8
|
-
|
|
9
|
-
export const generateContent = {
|
|
10
|
-
"input": input.input,
|
|
11
|
-
"output": output.output,
|
|
12
|
-
"billable": true,
|
|
13
|
-
"cacheable": true,
|
|
14
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// This file is generated. Do not edit it manually.
|
|
4
|
-
|
|
5
|
-
import { z } from "@botpress/sdk";
|
|
6
|
-
export const input = {
|
|
7
|
-
schema: z.object({
|
|
8
|
-
model: /** Model to use for content generation */ z.optional(
|
|
9
|
-
/** Model to use for content generation */ z.ref("modelRef"),
|
|
10
|
-
),
|
|
11
|
-
reasoningEffort:
|
|
12
|
-
/** Reasoning effort level to use for models that support reasoning */ z.optional(
|
|
13
|
-
/** Reasoning effort level to use for models that support reasoning */ z.enum(
|
|
14
|
-
["low", "medium", "high"],
|
|
15
|
-
),
|
|
16
|
-
),
|
|
17
|
-
systemPrompt: /** Optional system prompt to guide the model */ z.optional(
|
|
18
|
-
/** Optional system prompt to guide the model */ z.string(),
|
|
19
|
-
),
|
|
20
|
-
messages: z.array(
|
|
21
|
-
z.object({
|
|
22
|
-
role: z.enum(["user", "assistant"]),
|
|
23
|
-
type: z
|
|
24
|
-
.enum(["text", "tool_calls", "tool_result", "multipart"])
|
|
25
|
-
.default("text"),
|
|
26
|
-
toolCalls: /** Required if `type` is "tool_calls" */ z.optional(
|
|
27
|
-
z.array(
|
|
28
|
-
z.object({
|
|
29
|
-
id: z.string(),
|
|
30
|
-
type: z.literal("function"),
|
|
31
|
-
function: z.object({
|
|
32
|
-
name: z.string(),
|
|
33
|
-
arguments:
|
|
34
|
-
/** Some LLMs may generate invalid JSON for a tool call, so this will be `null` when it happens. */ z.union(
|
|
35
|
-
[z.record(z.string(), z.any()), z.null()],
|
|
36
|
-
),
|
|
37
|
-
}),
|
|
38
|
-
}),
|
|
39
|
-
),
|
|
40
|
-
),
|
|
41
|
-
toolResultCallId: /** Required if `type` is "tool_result" */ z.optional(
|
|
42
|
-
/** Required if `type` is "tool_result" */ z.string(),
|
|
43
|
-
),
|
|
44
|
-
content:
|
|
45
|
-
/** Required unless `type` is "tool_call". If `type` is "multipart", this field must be an array of content objects. If `type` is "tool_result" then this field should be the result of the tool call (a plain string or a JSON-encoded array or object). If `type` is "tool_call" then the `toolCalls` field should be used instead. */ z.union(
|
|
46
|
-
[
|
|
47
|
-
z.union([
|
|
48
|
-
z.string(),
|
|
49
|
-
z.array(
|
|
50
|
-
z.object({
|
|
51
|
-
type: z.enum(["text", "image"]),
|
|
52
|
-
mimeType:
|
|
53
|
-
/** Indicates the MIME type of the content. If not provided it will be detected from the content-type header of the provided URL. */ z.optional(
|
|
54
|
-
/** Indicates the MIME type of the content. If not provided it will be detected from the content-type header of the provided URL. */ z.string(),
|
|
55
|
-
),
|
|
56
|
-
text: /** Required if part type is "text" */ z.optional(
|
|
57
|
-
/** Required if part type is "text" */ z.string(),
|
|
58
|
-
),
|
|
59
|
-
url: /** Required if part type is "image" */ z.optional(
|
|
60
|
-
/** Required if part type is "image" */ z.string(),
|
|
61
|
-
),
|
|
62
|
-
}),
|
|
63
|
-
),
|
|
64
|
-
]),
|
|
65
|
-
z.null(),
|
|
66
|
-
],
|
|
67
|
-
),
|
|
68
|
-
}),
|
|
69
|
-
),
|
|
70
|
-
responseFormat:
|
|
71
|
-
/** Response format expected from the model. If "json_object" is chosen, you must instruct the model to generate JSON either via the system prompt or a user message. */ z.optional(
|
|
72
|
-
/** Response format expected from the model. If "json_object" is chosen, you must instruct the model to generate JSON either via the system prompt or a user message. */ z.enum(
|
|
73
|
-
["text", "json_object"],
|
|
74
|
-
),
|
|
75
|
-
),
|
|
76
|
-
maxTokens:
|
|
77
|
-
/** Maximum number of tokens allowed in the generated response */ z.optional(
|
|
78
|
-
/** Maximum number of tokens allowed in the generated response */ z.number(),
|
|
79
|
-
),
|
|
80
|
-
temperature:
|
|
81
|
-
/** Sampling temperature for the model. Higher values result in more random outputs. */ /** Sampling temperature for the model. Higher values result in more random outputs. */ z
|
|
82
|
-
.number()
|
|
83
|
-
.default(1),
|
|
84
|
-
topP: /** Top-p sampling parameter. Limits sampling to the smallest set of tokens with a cumulative probability above the threshold. */ /** Top-p sampling parameter. Limits sampling to the smallest set of tokens with a cumulative probability above the threshold. */ z
|
|
85
|
-
.number()
|
|
86
|
-
.default(1),
|
|
87
|
-
stopSequences:
|
|
88
|
-
/** Sequences where the model should stop generating further tokens. */ z.optional(
|
|
89
|
-
z.array(z.string()),
|
|
90
|
-
),
|
|
91
|
-
tools: z.optional(
|
|
92
|
-
z.array(
|
|
93
|
-
z.object({
|
|
94
|
-
type: z.literal("function"),
|
|
95
|
-
function: z.object({
|
|
96
|
-
name: /** Function name */ z.string(),
|
|
97
|
-
description: z.optional(z.string()),
|
|
98
|
-
argumentsSchema:
|
|
99
|
-
/** JSON schema of the function arguments */ z.optional(
|
|
100
|
-
/** JSON schema of the function arguments */ z.object({}),
|
|
101
|
-
),
|
|
102
|
-
}),
|
|
103
|
-
}),
|
|
104
|
-
),
|
|
105
|
-
),
|
|
106
|
-
toolChoice: z.optional(
|
|
107
|
-
z.object({
|
|
108
|
-
type: z.optional(z.enum(["auto", "specific", "any", "none", ""])),
|
|
109
|
-
functionName: /** Required if `type` is "specific" */ z.optional(
|
|
110
|
-
/** Required if `type` is "specific" */ z.string(),
|
|
111
|
-
),
|
|
112
|
-
}),
|
|
113
|
-
),
|
|
114
|
-
userId: z.optional(z.string()),
|
|
115
|
-
debug:
|
|
116
|
-
/** Set to `true` to output debug information to the bot logs */ z.optional(
|
|
117
|
-
/** Set to `true` to output debug information to the bot logs */ z.boolean(),
|
|
118
|
-
),
|
|
119
|
-
meta: z.optional(
|
|
120
|
-
z.object({
|
|
121
|
-
promptSource:
|
|
122
|
-
/** Source of the prompt, e.g. agent/:id/:version cards/ai-generate, cards/ai-task, nodes/autonomous, etc. */ z.optional(
|
|
123
|
-
/** Source of the prompt, e.g. agent/:id/:version cards/ai-generate, cards/ai-task, nodes/autonomous, etc. */ z.string(),
|
|
124
|
-
),
|
|
125
|
-
promptCategory: z.optional(z.string()),
|
|
126
|
-
integrationName:
|
|
127
|
-
/** Name of the integration that originally received the message that initiated this action */ z.optional(
|
|
128
|
-
/** Name of the integration that originally received the message that initiated this action */ z.string(),
|
|
129
|
-
),
|
|
130
|
-
}),
|
|
131
|
-
),
|
|
132
|
-
}),
|
|
133
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// This file is generated. Do not edit it manually.
|
|
4
|
-
|
|
5
|
-
import { z } from "@botpress/sdk";
|
|
6
|
-
export const output = {
|
|
7
|
-
schema: z.object({
|
|
8
|
-
id: /** Response ID from LLM provider */ z.string(),
|
|
9
|
-
provider: /** LLM provider name */ z.string(),
|
|
10
|
-
model: /** Model name */ z.string(),
|
|
11
|
-
choices: z.array(
|
|
12
|
-
z.object({
|
|
13
|
-
type: z
|
|
14
|
-
.enum(["text", "tool_calls", "tool_result", "multipart"])
|
|
15
|
-
.default("text"),
|
|
16
|
-
toolCalls: /** Required if `type` is "tool_calls" */ z.optional(
|
|
17
|
-
z.array(
|
|
18
|
-
z.object({
|
|
19
|
-
id: z.string(),
|
|
20
|
-
type: z.literal("function"),
|
|
21
|
-
function: z.object({
|
|
22
|
-
name: z.string(),
|
|
23
|
-
arguments:
|
|
24
|
-
/** Some LLMs may generate invalid JSON for a tool call, so this will be `null` when it happens. */ z.union(
|
|
25
|
-
[z.record(z.string(), z.any()), z.null()],
|
|
26
|
-
),
|
|
27
|
-
}),
|
|
28
|
-
}),
|
|
29
|
-
),
|
|
30
|
-
),
|
|
31
|
-
toolResultCallId: /** Required if `type` is "tool_result" */ z.optional(
|
|
32
|
-
/** Required if `type` is "tool_result" */ z.string(),
|
|
33
|
-
),
|
|
34
|
-
content:
|
|
35
|
-
/** Required unless `type` is "tool_call". If `type` is "multipart", this field must be an array of content objects. If `type` is "tool_result" then this field should be the result of the tool call (a plain string or a JSON-encoded array or object). If `type` is "tool_call" then the `toolCalls` field should be used instead. */ z.union(
|
|
36
|
-
[
|
|
37
|
-
z.union([
|
|
38
|
-
z.string(),
|
|
39
|
-
z.array(
|
|
40
|
-
z.object({
|
|
41
|
-
type: z.enum(["text", "image"]),
|
|
42
|
-
mimeType:
|
|
43
|
-
/** Indicates the MIME type of the content. If not provided it will be detected from the content-type header of the provided URL. */ z.optional(
|
|
44
|
-
/** Indicates the MIME type of the content. If not provided it will be detected from the content-type header of the provided URL. */ z.string(),
|
|
45
|
-
),
|
|
46
|
-
text: /** Required if part type is "text" */ z.optional(
|
|
47
|
-
/** Required if part type is "text" */ z.string(),
|
|
48
|
-
),
|
|
49
|
-
url: /** Required if part type is "image" */ z.optional(
|
|
50
|
-
/** Required if part type is "image" */ z.string(),
|
|
51
|
-
),
|
|
52
|
-
}),
|
|
53
|
-
),
|
|
54
|
-
]),
|
|
55
|
-
z.null(),
|
|
56
|
-
],
|
|
57
|
-
),
|
|
58
|
-
role: z.literal("assistant"),
|
|
59
|
-
index: z.number(),
|
|
60
|
-
stopReason: z.enum([
|
|
61
|
-
"stop",
|
|
62
|
-
"max_tokens",
|
|
63
|
-
"tool_calls",
|
|
64
|
-
"content_filter",
|
|
65
|
-
"other",
|
|
66
|
-
]),
|
|
67
|
-
}),
|
|
68
|
-
),
|
|
69
|
-
usage: z.object({
|
|
70
|
-
inputTokens: /** Number of input tokens used by the model */ z.number(),
|
|
71
|
-
inputCost:
|
|
72
|
-
/** Cost of the input tokens received by the model, in U.S. dollars */ z.number(),
|
|
73
|
-
outputTokens: /** Number of output tokens used by the model */ z.number(),
|
|
74
|
-
outputCost:
|
|
75
|
-
/** Cost of the output tokens generated by the model, in U.S. dollars */ z.number(),
|
|
76
|
-
}),
|
|
77
|
-
botpress: z.object({
|
|
78
|
-
cost: /** Total cost of the content generation, in U.S. dollars */ z.number(),
|
|
79
|
-
}),
|
|
80
|
-
}),
|
|
81
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// This file is generated. Do not edit it manually.
|
|
4
|
-
import * as listLanguageModels from "./listLanguageModels/index";
|
|
5
|
-
export * as listLanguageModels from "./listLanguageModels/index";
|
|
6
|
-
import * as generateContent from "./generateContent/index";
|
|
7
|
-
export * as generateContent from "./generateContent/index";
|
|
8
|
-
|
|
9
|
-
export const actions = {
|
|
10
|
-
"listLanguageModels": listLanguageModels.listLanguageModels,
|
|
11
|
-
"generateContent": generateContent.generateContent,
|
|
12
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// This file is generated. Do not edit it manually.
|
|
4
|
-
import * as input from "./input";
|
|
5
|
-
export * as input from "./input";
|
|
6
|
-
import * as output from "./output";
|
|
7
|
-
export * as output from "./output";
|
|
8
|
-
|
|
9
|
-
export const listLanguageModels = {
|
|
10
|
-
"input": input.input,
|
|
11
|
-
"output": output.output,
|
|
12
|
-
"billable": false,
|
|
13
|
-
"cacheable": false,
|
|
14
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// This file is generated. Do not edit it manually.
|
|
4
|
-
|
|
5
|
-
import { z } from "@botpress/sdk";
|
|
6
|
-
export const output = {
|
|
7
|
-
schema: z.object({
|
|
8
|
-
models: z.array(
|
|
9
|
-
z.intersection(
|
|
10
|
-
z.object({
|
|
11
|
-
id: z.string(),
|
|
12
|
-
name: z.string(),
|
|
13
|
-
description: z.string(),
|
|
14
|
-
tags: z.array(
|
|
15
|
-
z.enum([
|
|
16
|
-
"recommended",
|
|
17
|
-
"deprecated",
|
|
18
|
-
"general-purpose",
|
|
19
|
-
"low-cost",
|
|
20
|
-
"vision",
|
|
21
|
-
"coding",
|
|
22
|
-
"agents",
|
|
23
|
-
"function-calling",
|
|
24
|
-
"roleplay",
|
|
25
|
-
"storytelling",
|
|
26
|
-
"reasoning",
|
|
27
|
-
"preview",
|
|
28
|
-
]),
|
|
29
|
-
),
|
|
30
|
-
input: z.object({
|
|
31
|
-
maxTokens: z.number(),
|
|
32
|
-
costPer1MTokens:
|
|
33
|
-
/** Cost per 1 million tokens, in U.S. dollars */ z.number(),
|
|
34
|
-
}),
|
|
35
|
-
output: z.object({
|
|
36
|
-
maxTokens: z.number(),
|
|
37
|
-
costPer1MTokens:
|
|
38
|
-
/** Cost per 1 million tokens, in U.S. dollars */ z.number(),
|
|
39
|
-
}),
|
|
40
|
-
}),
|
|
41
|
-
z.ref("modelRef"),
|
|
42
|
-
),
|
|
43
|
-
),
|
|
44
|
-
}),
|
|
45
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// This file is generated. Do not edit it manually.
|
|
4
|
-
|
|
5
|
-
import * as sdk from "@botpress/sdk"
|
|
6
|
-
|
|
7
|
-
import * as actions from "./actions/index"
|
|
8
|
-
import * as channels from "./channels/index"
|
|
9
|
-
import * as events from "./events/index"
|
|
10
|
-
import * as entities from "./entities/index"
|
|
11
|
-
export * as actions from "./actions/index"
|
|
12
|
-
export * as channels from "./channels/index"
|
|
13
|
-
export * as events from "./events/index"
|
|
14
|
-
export * as entities from "./entities/index"
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
name: "llm",
|
|
18
|
-
version: "8.0.0",
|
|
19
|
-
actions: actions.actions,
|
|
20
|
-
channels: channels.channels,
|
|
21
|
-
events: events.events,
|
|
22
|
-
entities: entities.entities,
|
|
23
|
-
} satisfies sdk.InterfacePackage["definition"]
|
package/bp_modules/llm/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
// This file is generated. Do not edit it manually.
|
|
4
|
-
|
|
5
|
-
import * as sdk from "@botpress/sdk"
|
|
6
|
-
|
|
7
|
-
import definition from "./definition"
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
type: "interface",
|
|
11
|
-
id: "b759e577-2ce7-451a-abff-68085b224985",
|
|
12
|
-
uri: undefined,
|
|
13
|
-
name: "llm",
|
|
14
|
-
version: "8.0.0",
|
|
15
|
-
definition,
|
|
16
|
-
} satisfies sdk.InterfacePackage
|