@venturialstd/workflow 0.1.162 → 0.1.163
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/README.md +238 -238
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/chatbot/actions/ask-question.action.d.ts +3 -0
- package/dist/modules/chatbot/actions/ask-question.action.d.ts.map +1 -0
- package/dist/modules/chatbot/actions/ask-question.action.js +42 -0
- package/dist/modules/chatbot/actions/ask-question.action.js.map +1 -0
- package/dist/modules/chatbot/actions/index.d.ts +4 -0
- package/dist/modules/chatbot/actions/index.d.ts.map +1 -0
- package/dist/modules/chatbot/actions/index.js +20 -0
- package/dist/modules/chatbot/actions/index.js.map +1 -0
- package/dist/modules/chatbot/actions/send-buttons.action.d.ts +3 -0
- package/dist/modules/chatbot/actions/send-buttons.action.d.ts.map +1 -0
- package/dist/modules/chatbot/actions/send-buttons.action.js +67 -0
- package/dist/modules/chatbot/actions/send-buttons.action.js.map +1 -0
- package/dist/modules/chatbot/actions/send-message.action.d.ts +3 -0
- package/dist/modules/chatbot/actions/send-message.action.d.ts.map +1 -0
- package/dist/modules/chatbot/actions/send-message.action.js +52 -0
- package/dist/modules/chatbot/actions/send-message.action.js.map +1 -0
- package/dist/modules/chatbot/chatbot-nest.module.d.ts +3 -0
- package/dist/modules/chatbot/chatbot-nest.module.d.ts.map +1 -0
- package/dist/modules/chatbot/chatbot-nest.module.js +21 -0
- package/dist/modules/chatbot/chatbot-nest.module.js.map +1 -0
- package/dist/modules/chatbot/chatbot.module.d.ts +3 -0
- package/dist/modules/chatbot/chatbot.module.d.ts.map +1 -0
- package/dist/modules/chatbot/chatbot.module.js +17 -0
- package/dist/modules/chatbot/chatbot.module.js.map +1 -0
- package/dist/modules/chatbot/credentials.d.ts +3 -0
- package/dist/modules/chatbot/credentials.d.ts.map +1 -0
- package/dist/modules/chatbot/credentials.js +5 -0
- package/dist/modules/chatbot/credentials.js.map +1 -0
- package/dist/modules/chatbot/services/ask-question.service.d.ts +5 -0
- package/dist/modules/chatbot/services/ask-question.service.d.ts.map +1 -0
- package/dist/modules/chatbot/services/ask-question.service.js +25 -0
- package/dist/modules/chatbot/services/ask-question.service.js.map +1 -0
- package/dist/modules/chatbot/services/index.d.ts +5 -0
- package/dist/modules/chatbot/services/index.d.ts.map +1 -0
- package/dist/modules/chatbot/services/index.js +21 -0
- package/dist/modules/chatbot/services/index.js.map +1 -0
- package/dist/modules/chatbot/services/send-buttons.service.d.ts +5 -0
- package/dist/modules/chatbot/services/send-buttons.service.d.ts.map +1 -0
- package/dist/modules/chatbot/services/send-buttons.service.js +25 -0
- package/dist/modules/chatbot/services/send-buttons.service.js.map +1 -0
- package/dist/modules/chatbot/services/send-message.service.d.ts +5 -0
- package/dist/modules/chatbot/services/send-message.service.d.ts.map +1 -0
- package/dist/modules/chatbot/services/send-message.service.js +27 -0
- package/dist/modules/chatbot/services/send-message.service.js.map +1 -0
- package/dist/modules/chatbot/services/user-responded.service.d.ts +5 -0
- package/dist/modules/chatbot/services/user-responded.service.d.ts.map +1 -0
- package/dist/modules/chatbot/services/user-responded.service.js +25 -0
- package/dist/modules/chatbot/services/user-responded.service.js.map +1 -0
- package/dist/modules/chatbot/triggers/index.d.ts +2 -0
- package/dist/modules/chatbot/triggers/index.d.ts.map +1 -0
- package/dist/modules/chatbot/triggers/index.js +18 -0
- package/dist/modules/chatbot/triggers/index.js.map +1 -0
- package/dist/modules/chatbot/triggers/user-responded.trigger.d.ts +3 -0
- package/dist/modules/chatbot/triggers/user-responded.trigger.d.ts.map +1 -0
- package/dist/modules/chatbot/triggers/user-responded.trigger.js +45 -0
- package/dist/modules/chatbot/triggers/user-responded.trigger.js.map +1 -0
- package/dist/modules/chatgpt/actions/chat-completion.action.d.ts.map +1 -1
- package/dist/modules/chatgpt/actions/chat-completion.action.js +27 -109
- package/dist/modules/chatgpt/actions/chat-completion.action.js.map +1 -1
- package/dist/modules/chatgpt/actions/chat-purpose.action.d.ts +3 -0
- package/dist/modules/chatgpt/actions/chat-purpose.action.d.ts.map +1 -0
- package/dist/modules/chatgpt/actions/chat-purpose.action.js +229 -0
- package/dist/modules/chatgpt/actions/chat-purpose.action.js.map +1 -0
- package/dist/modules/chatgpt/actions/create-embedding.action.d.ts.map +1 -1
- package/dist/modules/chatgpt/actions/create-embedding.action.js +10 -16
- package/dist/modules/chatgpt/actions/create-embedding.action.js.map +1 -1
- package/dist/modules/chatgpt/actions/generate-image.action.d.ts.map +1 -1
- package/dist/modules/chatgpt/actions/generate-image.action.js +19 -35
- package/dist/modules/chatgpt/actions/generate-image.action.js.map +1 -1
- package/dist/modules/chatgpt/actions/index.d.ts +1 -0
- package/dist/modules/chatgpt/actions/index.d.ts.map +1 -1
- package/dist/modules/chatgpt/actions/index.js +1 -0
- package/dist/modules/chatgpt/actions/index.js.map +1 -1
- package/dist/modules/chatgpt/actions/speech-to-text.action.d.ts.map +1 -1
- package/dist/modules/chatgpt/actions/speech-to-text.action.js +18 -31
- package/dist/modules/chatgpt/actions/speech-to-text.action.js.map +1 -1
- package/dist/modules/chatgpt/actions/text-to-speech.action.d.ts.map +1 -1
- package/dist/modules/chatgpt/actions/text-to-speech.action.js +15 -32
- package/dist/modules/chatgpt/actions/text-to-speech.action.js.map +1 -1
- package/dist/modules/chatgpt/auth/chatgpt-auth.service.d.ts +3 -0
- package/dist/modules/chatgpt/auth/chatgpt-auth.service.d.ts.map +1 -1
- package/dist/modules/chatgpt/auth/chatgpt-auth.service.js +33 -36
- package/dist/modules/chatgpt/auth/chatgpt-auth.service.js.map +1 -1
- package/dist/modules/chatgpt/auth/index.d.ts +2 -0
- package/dist/modules/chatgpt/auth/index.d.ts.map +1 -0
- package/dist/modules/chatgpt/auth/index.js +6 -0
- package/dist/modules/chatgpt/auth/index.js.map +1 -0
- package/dist/modules/chatgpt/chatgpt-nest.module.d.ts.map +1 -1
- package/dist/modules/chatgpt/chatgpt-nest.module.js +9 -6
- package/dist/modules/chatgpt/chatgpt-nest.module.js.map +1 -1
- package/dist/modules/chatgpt/chatgpt.module.d.ts.map +1 -1
- package/dist/modules/chatgpt/chatgpt.module.js +3 -2
- package/dist/modules/chatgpt/chatgpt.module.js.map +1 -1
- package/dist/modules/chatgpt/services/chat-completion.service.d.ts +2 -4
- package/dist/modules/chatgpt/services/chat-completion.service.d.ts.map +1 -1
- package/dist/modules/chatgpt/services/chat-completion.service.js +21 -100
- package/dist/modules/chatgpt/services/chat-completion.service.js.map +1 -1
- package/dist/modules/chatgpt/services/chat-purpose.service.d.ts +24 -0
- package/dist/modules/chatgpt/services/chat-purpose.service.d.ts.map +1 -0
- package/dist/modules/chatgpt/services/chat-purpose.service.js +396 -0
- package/dist/modules/chatgpt/services/chat-purpose.service.js.map +1 -0
- package/dist/modules/chatgpt/services/index.d.ts +1 -0
- package/dist/modules/chatgpt/services/index.d.ts.map +1 -1
- package/dist/modules/chatgpt/services/index.js +1 -0
- package/dist/modules/chatgpt/services/index.js.map +1 -1
- package/dist/modules/chatgpt/types/purpose-memory.types.d.ts +38 -0
- package/dist/modules/chatgpt/types/purpose-memory.types.d.ts.map +1 -0
- package/dist/modules/chatgpt/types/purpose-memory.types.js +28 -0
- package/dist/modules/chatgpt/types/purpose-memory.types.js.map +1 -0
- package/dist/modules/chatgpt/utils/purpose-cache-key.util.d.ts +5 -0
- package/dist/modules/chatgpt/utils/purpose-cache-key.util.d.ts.map +1 -0
- package/dist/modules/chatgpt/utils/purpose-cache-key.util.js +15 -0
- package/dist/modules/chatgpt/utils/purpose-cache-key.util.js.map +1 -0
- package/dist/modules/chatgpt/utils/purpose-schema.validator.d.ts +2 -0
- package/dist/modules/chatgpt/utils/purpose-schema.validator.d.ts.map +1 -0
- package/dist/modules/chatgpt/utils/purpose-schema.validator.js +34 -0
- package/dist/modules/chatgpt/utils/purpose-schema.validator.js.map +1 -0
- package/dist/modules/chatgpt/utils/token-estimate.util.d.ts +7 -0
- package/dist/modules/chatgpt/utils/token-estimate.util.d.ts.map +1 -0
- package/dist/modules/chatgpt/utils/token-estimate.util.js +20 -0
- package/dist/modules/chatgpt/utils/token-estimate.util.js.map +1 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/modules/index.js +5 -1
- package/dist/modules/index.js.map +1 -1
- package/dist/workflow.module.d.ts.map +1 -1
- package/dist/workflow.module.js +3 -0
- package/dist/workflow.module.js.map +1 -1
- package/package.json +119 -118
- package/dist/modules/chatgpt/constants/chatgpt-completion.constants.d.ts +0 -4
- package/dist/modules/chatgpt/constants/chatgpt-completion.constants.d.ts.map +0 -1
- package/dist/modules/chatgpt/constants/chatgpt-completion.constants.js +0 -32
- package/dist/modules/chatgpt/constants/chatgpt-completion.constants.js.map +0 -1
|
@@ -2,30 +2,35 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.chatCompletionAction = void 0;
|
|
4
4
|
const types_1 = require("../../types");
|
|
5
|
-
const chatgpt_completion_constants_1 = require("../constants/chatgpt-completion.constants");
|
|
6
5
|
const chat_completion_service_1 = require("../services/chat-completion.service");
|
|
7
6
|
exports.chatCompletionAction = {
|
|
8
7
|
key: 'chat-completion',
|
|
9
8
|
name: 'Chat Completion',
|
|
10
|
-
description: '
|
|
9
|
+
description: 'Send a message to ChatGPT and get a reply.',
|
|
11
10
|
category: types_1.NODE_CATEGORY.ACTION,
|
|
12
11
|
icon: '💬',
|
|
13
12
|
serviceClass: chat_completion_service_1.ChatCompletionService,
|
|
14
13
|
inputs: [
|
|
15
14
|
{
|
|
16
|
-
id: '
|
|
17
|
-
name: '
|
|
18
|
-
description: '
|
|
19
|
-
type: types_1.FIELD_TYPE.
|
|
20
|
-
validation: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
id: 'message',
|
|
16
|
+
name: 'Message',
|
|
17
|
+
description: 'The question or text to send.',
|
|
18
|
+
type: types_1.FIELD_TYPE.STRING,
|
|
19
|
+
validation: { required: true },
|
|
20
|
+
placeholder: 'e.g. What is the capital of France?',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'systemInstructions',
|
|
24
|
+
name: 'System instructions',
|
|
25
|
+
description: 'Optional. How the assistant should behave.',
|
|
26
|
+
type: types_1.FIELD_TYPE.STRING,
|
|
27
|
+
validation: { required: false },
|
|
28
|
+
placeholder: 'e.g. You are a helpful assistant that answers in Spanish.',
|
|
24
29
|
},
|
|
25
30
|
{
|
|
26
31
|
id: 'model',
|
|
27
32
|
name: 'Model',
|
|
28
|
-
description: 'ChatGPT model to use',
|
|
33
|
+
description: 'ChatGPT model to use.',
|
|
29
34
|
type: types_1.FIELD_TYPE.STRING,
|
|
30
35
|
validation: {
|
|
31
36
|
required: false,
|
|
@@ -40,129 +45,42 @@ exports.chatCompletionAction = {
|
|
|
40
45
|
{ label: 'GPT-3.5 Turbo', value: 'gpt-3.5-turbo' },
|
|
41
46
|
],
|
|
42
47
|
},
|
|
43
|
-
{
|
|
44
|
-
id: 'phone',
|
|
45
|
-
name: 'Phone',
|
|
46
|
-
description: 'Phone number',
|
|
47
|
-
type: types_1.FIELD_TYPE.STRING,
|
|
48
|
-
validation: {
|
|
49
|
-
required: false,
|
|
50
|
-
minLength: 10,
|
|
51
|
-
maxLength: 15,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
48
|
{
|
|
55
49
|
id: 'temperature',
|
|
56
50
|
name: 'Temperature',
|
|
57
|
-
description: '
|
|
51
|
+
description: 'Response randomness (0 = focused, 2 = creative).',
|
|
58
52
|
type: types_1.FIELD_TYPE.NUMBER,
|
|
59
|
-
validation: {
|
|
60
|
-
required: false,
|
|
61
|
-
min: 0,
|
|
62
|
-
max: 2,
|
|
63
|
-
},
|
|
53
|
+
validation: { required: false, min: 0, max: 2 },
|
|
64
54
|
defaultValue: 0.7,
|
|
65
55
|
},
|
|
66
56
|
{
|
|
67
57
|
id: 'maxTokens',
|
|
68
|
-
name: 'Max
|
|
69
|
-
description: 'Maximum
|
|
58
|
+
name: 'Max tokens',
|
|
59
|
+
description: 'Maximum reply length.',
|
|
70
60
|
type: types_1.FIELD_TYPE.NUMBER,
|
|
71
|
-
validation: {
|
|
72
|
-
required: false,
|
|
73
|
-
min: 1,
|
|
74
|
-
max: 4000,
|
|
75
|
-
},
|
|
61
|
+
validation: { required: false, min: 1, max: 4000 },
|
|
76
62
|
defaultValue: 2000,
|
|
77
63
|
},
|
|
78
|
-
{
|
|
79
|
-
id: 'enableMemoryPersistence',
|
|
80
|
-
name: 'Enable Memory Persistence',
|
|
81
|
-
description: 'Enable memory persistence to store chat history in Redis',
|
|
82
|
-
type: types_1.FIELD_TYPE.BOOLEAN,
|
|
83
|
-
validation: {
|
|
84
|
-
required: false,
|
|
85
|
-
},
|
|
86
|
-
defaultValue: false,
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
id: 'memoryKey',
|
|
90
|
-
name: 'Memory Key',
|
|
91
|
-
description: 'Key to identify the memory in Redis',
|
|
92
|
-
type: types_1.FIELD_TYPE.STRING,
|
|
93
|
-
validation: {
|
|
94
|
-
required: false,
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
id: 'memoryTimePersistence',
|
|
99
|
-
name: 'Memory Time Persistence',
|
|
100
|
-
description: 'Time to persist memory in Redis (in minutes)',
|
|
101
|
-
type: types_1.FIELD_TYPE.NUMBER,
|
|
102
|
-
validation: {
|
|
103
|
-
required: false,
|
|
104
|
-
min: 1,
|
|
105
|
-
},
|
|
106
|
-
defaultValue: 60,
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
id: 'stopExecutionUntilPurposeFinish',
|
|
110
|
-
name: 'Stop Execution Until Purpose Finish',
|
|
111
|
-
description: 'Stop workflow execution until the purpose is finished (AI will determine completion)',
|
|
112
|
-
type: types_1.FIELD_TYPE.BOOLEAN,
|
|
113
|
-
validation: {
|
|
114
|
-
required: false,
|
|
115
|
-
},
|
|
116
|
-
defaultValue: false,
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
id: 'systemInstructions',
|
|
120
|
-
name: 'System Instructions',
|
|
121
|
-
description: 'System prompt/instructions for ChatGPT (will be added as a system message)',
|
|
122
|
-
type: types_1.FIELD_TYPE.STRING,
|
|
123
|
-
validation: {
|
|
124
|
-
required: false,
|
|
125
|
-
},
|
|
126
|
-
defaultValue: chatgpt_completion_constants_1.CHATGPT_COMPLETION_CONSTANTS.SYSTEM_INSTRUCTIONS,
|
|
127
|
-
},
|
|
128
64
|
],
|
|
129
65
|
outputs: [
|
|
130
66
|
{
|
|
131
67
|
id: 'content',
|
|
132
|
-
name: '
|
|
133
|
-
description: 'The
|
|
134
|
-
type: types_1.FIELD_TYPE.STRING,
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
id: 'role',
|
|
138
|
-
name: 'Role',
|
|
139
|
-
description: 'The role of the message (assistant)',
|
|
140
|
-
type: types_1.FIELD_TYPE.STRING,
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
id: 'model',
|
|
144
|
-
name: 'Model Used',
|
|
145
|
-
description: 'The model that was used',
|
|
68
|
+
name: 'Reply',
|
|
69
|
+
description: 'The assistant reply text.',
|
|
146
70
|
type: types_1.FIELD_TYPE.STRING,
|
|
147
71
|
},
|
|
148
72
|
{
|
|
149
73
|
id: 'tokensUsed',
|
|
150
|
-
name: 'Tokens
|
|
151
|
-
description: 'Number of tokens consumed',
|
|
74
|
+
name: 'Tokens used',
|
|
75
|
+
description: 'Number of tokens consumed.',
|
|
152
76
|
type: types_1.FIELD_TYPE.NUMBER,
|
|
153
77
|
},
|
|
154
78
|
{
|
|
155
79
|
id: 'cost',
|
|
156
|
-
name: 'Cost',
|
|
157
|
-
description: 'Estimated cost in USD',
|
|
80
|
+
name: 'Cost (USD)',
|
|
81
|
+
description: 'Estimated cost in USD.',
|
|
158
82
|
type: types_1.FIELD_TYPE.NUMBER,
|
|
159
83
|
},
|
|
160
|
-
{
|
|
161
|
-
id: 'messageId',
|
|
162
|
-
name: 'Message ID',
|
|
163
|
-
description: 'Unique identifier for the message',
|
|
164
|
-
type: types_1.FIELD_TYPE.STRING,
|
|
165
|
-
},
|
|
166
84
|
],
|
|
167
85
|
};
|
|
168
86
|
//# sourceMappingURL=chat-completion.action.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-completion.action.js","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/chat-completion.action.ts"],"names":[],"mappings":";;;AAAA,uCAKqB;AACrB,
|
|
1
|
+
{"version":3,"file":"chat-completion.action.js","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/chat-completion.action.ts"],"names":[],"mappings":";;;AAAA,uCAKqB;AACrB,iFAA4E;AAE/D,QAAA,oBAAoB,GAA0B;IACzD,GAAG,EAAE,iBAAiB;IACtB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,4CAA4C;IACzD,QAAQ,EAAE,qBAAa,CAAC,MAAM;IAC9B,IAAI,EAAE,IAAI;IACV,YAAY,EAAE,+CAA2E;IACzF,MAAM,EAAE;QACN;YACE,EAAE,EAAE,SAAS;YACb,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,kBAAU,CAAC,MAAM;YACvB,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9B,WAAW,EAAE,qCAAqC;SACnD;QACD;YACE,EAAE,EAAE,oBAAoB;YACxB,IAAI,EAAE,qBAAqB;YAC3B,WAAW,EAAE,4CAA4C;YACzD,IAAI,EAAE,kBAAU,CAAC,MAAM;YACvB,UAAU,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC/B,WAAW,EAAE,2DAA2D;SACzE;QACD;YACE,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,kBAAU,CAAC,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kBAAU,CAAC,MAAM;SACxB;QACD;YACE,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,kBAAU,CAAC,MAAM;SACxB;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-purpose.action.d.ts","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/chat-purpose.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,iBAAiB,EAAE,qBAqO/B,CAAC"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.chatPurposeAction = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
|
+
const chat_purpose_service_1 = require("../services/chat-purpose.service");
|
|
6
|
+
exports.chatPurposeAction = {
|
|
7
|
+
key: 'chat-purpose',
|
|
8
|
+
name: 'ChatGPT Purpose',
|
|
9
|
+
description: 'Stateful conversational controller: collects structured data through conversation, persists memory across webhook executions, returns IN_PROGRESS | COMPLETED | FAILED. Use for KYC, onboarding, surveys, data correction.',
|
|
10
|
+
category: types_1.NODE_CATEGORY.ACTION,
|
|
11
|
+
icon: '🎯',
|
|
12
|
+
serviceClass: chat_purpose_service_1.ChatGptPurposeService,
|
|
13
|
+
inputs: [
|
|
14
|
+
{
|
|
15
|
+
id: 'systemPrompt',
|
|
16
|
+
name: 'System prompt',
|
|
17
|
+
description: 'Instructions for the assistant (e.g. goal, tone, questions to ask). Supports expressions like {{workflowId}}.',
|
|
18
|
+
type: types_1.FIELD_TYPE.STRING,
|
|
19
|
+
validation: { required: true },
|
|
20
|
+
placeholder: 'e.g. You are collecting KYC data. Ask for full name, then ID number.',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'incomingUserMessage',
|
|
24
|
+
name: 'Incoming user message',
|
|
25
|
+
description: 'The user message for this turn. Supports expressions from previous nodes.',
|
|
26
|
+
type: types_1.FIELD_TYPE.STRING,
|
|
27
|
+
validation: { required: false },
|
|
28
|
+
placeholder: 'e.g. {{trigger.body.message}} or {{node_1.reply}}',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'enableMemoryPersistence',
|
|
32
|
+
name: 'Enable memory persistence',
|
|
33
|
+
description: 'Store conversation state in cache across executions (required for multi-turn via webhooks).',
|
|
34
|
+
type: types_1.FIELD_TYPE.BOOLEAN,
|
|
35
|
+
validation: { required: false },
|
|
36
|
+
defaultValue: true,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'userId',
|
|
40
|
+
name: 'User ID',
|
|
41
|
+
description: 'Optional. User identifier for per-user isolation. Stored in Redis as workflow:workflowId:userId:... when provided. Supports expressions.',
|
|
42
|
+
type: types_1.FIELD_TYPE.STRING,
|
|
43
|
+
validation: { required: false },
|
|
44
|
+
placeholder: 'e.g. {{trigger.body.userId}} or leave empty',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: 'memoryKey',
|
|
48
|
+
name: 'Memory key',
|
|
49
|
+
description: 'Required when persistence is enabled. Slot name for this conversation. Full Redis key: workflow:{workflowId}:[userId]:[purposeName]:memoryKey. Supports expressions.',
|
|
50
|
+
type: types_1.FIELD_TYPE.STRING,
|
|
51
|
+
validation: { required: false },
|
|
52
|
+
placeholder: 'e.g. simpleKyc, onboarding',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'purposeName',
|
|
56
|
+
name: 'Purpose name',
|
|
57
|
+
description: 'Optional. Purpose identifier (e.g. simpleKyc, onboarding). Included in Redis key when provided. Supports expressions.',
|
|
58
|
+
type: types_1.FIELD_TYPE.STRING,
|
|
59
|
+
validation: { required: false },
|
|
60
|
+
placeholder: 'e.g. simpleKyc',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'memoryTimePersistenceMinutes',
|
|
64
|
+
name: 'Memory time persistence (minutes)',
|
|
65
|
+
description: 'TTL for the conversation memory in cache (minutes). Default 60.',
|
|
66
|
+
type: types_1.FIELD_TYPE.NUMBER,
|
|
67
|
+
validation: { required: false, min: 1, max: 43200 },
|
|
68
|
+
defaultValue: 60,
|
|
69
|
+
placeholder: '60',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'stopExecutionUntilPurposeFinish',
|
|
73
|
+
name: 'Stop execution until purpose finish',
|
|
74
|
+
description: 'When true, use an IF node after this node to branch on result.status; route only when COMPLETED to continue. Prevents advancing until conversation completes.',
|
|
75
|
+
type: types_1.FIELD_TYPE.BOOLEAN,
|
|
76
|
+
validation: { required: false },
|
|
77
|
+
defaultValue: false,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'expectedOutputSchema',
|
|
81
|
+
name: 'Expected output schema (JSON)',
|
|
82
|
+
description: 'JSON schema or object describing the shape of "output" when status is COMPLETED (e.g. {"type":"object","properties":{"fullName":{},"idNumber":{}},"required":["fullName","idNumber"]}). Used for validation and to guide the model.',
|
|
83
|
+
type: types_1.FIELD_TYPE.JSON,
|
|
84
|
+
validation: { required: false },
|
|
85
|
+
placeholder: '{"type":"object","properties":{"fullName":{},"idNumber":{}},"required":["fullName","idNumber"]}',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 'model',
|
|
89
|
+
name: 'Model',
|
|
90
|
+
description: 'ChatGPT model to use',
|
|
91
|
+
type: types_1.FIELD_TYPE.STRING,
|
|
92
|
+
validation: {
|
|
93
|
+
required: false,
|
|
94
|
+
enum: ['gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo-preview', 'gpt-4', 'gpt-3.5-turbo'],
|
|
95
|
+
},
|
|
96
|
+
defaultValue: 'gpt-4o',
|
|
97
|
+
options: [
|
|
98
|
+
{ label: 'GPT-4o', value: 'gpt-4o' },
|
|
99
|
+
{ label: 'GPT-4o Mini', value: 'gpt-4o-mini' },
|
|
100
|
+
{ label: 'GPT-4 Turbo', value: 'gpt-4-turbo-preview' },
|
|
101
|
+
{ label: 'GPT-4', value: 'gpt-4' },
|
|
102
|
+
{ label: 'GPT-3.5 Turbo', value: 'gpt-3.5-turbo' },
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: 'temperature',
|
|
107
|
+
name: 'Temperature',
|
|
108
|
+
description: 'Randomness (0 = focused, 2 = creative). Lower is better for structured collection.',
|
|
109
|
+
type: types_1.FIELD_TYPE.NUMBER,
|
|
110
|
+
validation: { required: false, min: 0, max: 2 },
|
|
111
|
+
defaultValue: 0.3,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: 'maxTokens',
|
|
115
|
+
name: 'Max tokens',
|
|
116
|
+
description: 'Maximum response length',
|
|
117
|
+
type: types_1.FIELD_TYPE.NUMBER,
|
|
118
|
+
validation: { required: false, min: 100, max: 4000 },
|
|
119
|
+
defaultValue: 2000,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: 'maxContextTokens',
|
|
123
|
+
name: 'Max context tokens',
|
|
124
|
+
description: 'Token budget for conversation history; older messages are truncated to stay under this. Default 6000.',
|
|
125
|
+
type: types_1.FIELD_TYPE.NUMBER,
|
|
126
|
+
validation: { required: false, min: 1000, max: 120000 },
|
|
127
|
+
defaultValue: 6000,
|
|
128
|
+
placeholder: '6000',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: 'enableConversationSummarization',
|
|
132
|
+
name: 'Enable conversation summarization',
|
|
133
|
+
description: 'When conversation is long, summarize oldest messages into one to save context. Recommended for long flows.',
|
|
134
|
+
type: types_1.FIELD_TYPE.BOOLEAN,
|
|
135
|
+
validation: { required: false },
|
|
136
|
+
defaultValue: true,
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: 'summarizationTriggerMessageCount',
|
|
140
|
+
name: 'Summarization trigger (message count)',
|
|
141
|
+
description: 'When message count reaches this, oldest portion is summarized. Default 14.',
|
|
142
|
+
type: types_1.FIELD_TYPE.NUMBER,
|
|
143
|
+
validation: { required: false, min: 6, max: 50 },
|
|
144
|
+
defaultValue: 14,
|
|
145
|
+
placeholder: '14',
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
outputs: [
|
|
149
|
+
{
|
|
150
|
+
id: 'messages',
|
|
151
|
+
name: 'Messages',
|
|
152
|
+
description: 'Full conversation history [{ role, content }]',
|
|
153
|
+
type: types_1.FIELD_TYPE.ARRAY,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: 'result',
|
|
157
|
+
name: 'Result',
|
|
158
|
+
description: 'Object with status (IN_PROGRESS | COMPLETED | FAILED) and output (when COMPLETED)',
|
|
159
|
+
type: types_1.FIELD_TYPE.OBJECT,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
id: 'result.status',
|
|
163
|
+
name: 'Result status',
|
|
164
|
+
description: 'Use in IF node: IN_PROGRESS, COMPLETED, or FAILED',
|
|
165
|
+
type: types_1.FIELD_TYPE.STRING,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: 'result.output',
|
|
169
|
+
name: 'Result output',
|
|
170
|
+
description: 'Collected data when status is COMPLETED; use in concatenation or downstream nodes',
|
|
171
|
+
type: types_1.FIELD_TYPE.OBJECT,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: 'memoryKey',
|
|
175
|
+
name: 'Memory key',
|
|
176
|
+
description: 'Key used for persistence (for debugging)',
|
|
177
|
+
type: types_1.FIELD_TYPE.STRING,
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: 'collectedData',
|
|
181
|
+
name: 'Collected data',
|
|
182
|
+
description: 'Accumulated collected data so far',
|
|
183
|
+
type: types_1.FIELD_TYPE.OBJECT,
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: 'lastAssistantMessage',
|
|
187
|
+
name: 'Last assistant message',
|
|
188
|
+
description: 'Latest assistant reply (e.g. for Twilio/SMS)',
|
|
189
|
+
type: types_1.FIELD_TYPE.STRING,
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: 'metrics',
|
|
193
|
+
name: 'Metrics',
|
|
194
|
+
description: 'Conversation duration (ms), message count, completed (for completion rate)',
|
|
195
|
+
type: types_1.FIELD_TYPE.OBJECT,
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
id: 'metrics.conversationDurationMs',
|
|
199
|
+
name: 'Metrics: duration (ms)',
|
|
200
|
+
description: 'Time from first message to last update',
|
|
201
|
+
type: types_1.FIELD_TYPE.NUMBER,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: 'metrics.messageCount',
|
|
205
|
+
name: 'Metrics: message count',
|
|
206
|
+
description: 'Total messages in conversation',
|
|
207
|
+
type: types_1.FIELD_TYPE.NUMBER,
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: 'metrics.completed',
|
|
211
|
+
name: 'Metrics: completed',
|
|
212
|
+
description: 'True when status is COMPLETED (for completion rate)',
|
|
213
|
+
type: types_1.FIELD_TYPE.BOOLEAN,
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: 'error',
|
|
217
|
+
name: 'Error',
|
|
218
|
+
description: 'True if the node returned FAILED due to an error',
|
|
219
|
+
type: types_1.FIELD_TYPE.BOOLEAN,
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
id: 'errorMessage',
|
|
223
|
+
name: 'Error message',
|
|
224
|
+
description: 'Error details when error is true',
|
|
225
|
+
type: types_1.FIELD_TYPE.STRING,
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
};
|
|
229
|
+
//# sourceMappingURL=chat-purpose.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-purpose.action.js","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/chat-purpose.action.ts"],"names":[],"mappings":";;;AA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zF,IAAI,EAAE,kBAAU,CAAC,MAAM;SACxB;QACD;YACE,EAAE,EAAE,gCAAgC;YACpC,IAAI,EAAE,wBAAwB;YAC9B,WAAW,EAAE,wCAAwC;YACrD,IAAI,EAAE,kBAAU,CAAC,MAAM;SACxB;QACD;YACE,EAAE,EAAE,sBAAsB;YAC1B,IAAI,EAAE,wBAAwB;YAC9B,WAAW,EAAE,gCAAgC;YAC7C,IAAI,EAAE,kBAAU,CAAC,MAAM;SACxB;QACD;YACE,EAAE,EAAE,mBAAmB;YACvB,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EAAE,qDAAqD;YAClE,IAAI,EAAE,kBAAU,CAAC,OAAO;SACzB;QACD;YACE,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,kDAAkD;YAC/D,IAAI,EAAE,kBAAU,CAAC,OAAO;SACzB;QACD;YACE,EAAE,EAAE,cAAc;YAClB,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,kCAAkC;YAC/C,IAAI,EAAE,kBAAU,CAAC,MAAM;SACxB;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-embedding.action.d.ts","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/create-embedding.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"create-embedding.action.d.ts","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/create-embedding.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,qBAAqB,EAAE,qBA0DnC,CAAC"}
|
|
@@ -13,25 +13,21 @@ exports.createEmbeddingAction = {
|
|
|
13
13
|
inputs: [
|
|
14
14
|
{
|
|
15
15
|
id: 'input',
|
|
16
|
-
name: '
|
|
17
|
-
description: '
|
|
16
|
+
name: 'Text to embed',
|
|
17
|
+
description: 'A single text or a JSON array of texts. Each will get its own embedding vector.',
|
|
18
18
|
type: types_1.FIELD_TYPE.JSON,
|
|
19
|
-
validation: {
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
placeholder: '"Hello world" or ["Hello", "World"]',
|
|
19
|
+
validation: { required: true },
|
|
20
|
+
placeholder: 'e.g. "Hello world" or ["First sentence", "Second sentence"]',
|
|
23
21
|
},
|
|
24
22
|
{
|
|
25
23
|
id: 'model',
|
|
26
24
|
name: 'Model',
|
|
27
|
-
description: '
|
|
25
|
+
description: 'OpenAI embedding model',
|
|
28
26
|
type: types_1.FIELD_TYPE.STRING,
|
|
29
|
-
validation: {
|
|
30
|
-
required: false,
|
|
31
|
-
},
|
|
27
|
+
validation: { required: false },
|
|
32
28
|
defaultValue: 'text-embedding-3-small',
|
|
33
29
|
options: [
|
|
34
|
-
{ label: 'text-embedding-3-small', value: 'text-embedding-3-small' },
|
|
30
|
+
{ label: 'text-embedding-3-small (recommended)', value: 'text-embedding-3-small' },
|
|
35
31
|
{ label: 'text-embedding-3-large', value: 'text-embedding-3-large' },
|
|
36
32
|
{ label: 'text-embedding-ada-002', value: 'text-embedding-ada-002' },
|
|
37
33
|
],
|
|
@@ -39,12 +35,10 @@ exports.createEmbeddingAction = {
|
|
|
39
35
|
{
|
|
40
36
|
id: 'dimensions',
|
|
41
37
|
name: 'Dimensions',
|
|
42
|
-
description: '
|
|
38
|
+
description: 'Optional. Vector size (only for models that support it). Lower = faster and smaller.',
|
|
43
39
|
type: types_1.FIELD_TYPE.NUMBER,
|
|
44
|
-
validation: {
|
|
45
|
-
|
|
46
|
-
min: 1,
|
|
47
|
-
},
|
|
40
|
+
validation: { required: false, min: 1 },
|
|
41
|
+
placeholder: 'e.g. 512',
|
|
48
42
|
},
|
|
49
43
|
],
|
|
50
44
|
outputs: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-embedding.action.js","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/create-embedding.action.ts"],"names":[],"mappings":";;;AAAA,uCAKqB;AACrB,mFAA8E;AAEjE,QAAA,qBAAqB,GAA0B;IAC1D,GAAG,EAAE,kBAAkB;IACvB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,yCAAyC;IACtD,QAAQ,EAAE,qBAAa,CAAC,MAAM;IAC9B,IAAI,EAAE,IAAI;IACV,YAAY,EAAE,iDAA4E;IAC1F,MAAM,EAAE;QACN;YACE,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"create-embedding.action.js","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/create-embedding.action.ts"],"names":[],"mappings":";;;AAAA,uCAKqB;AACrB,mFAA8E;AAEjE,QAAA,qBAAqB,GAA0B;IAC1D,GAAG,EAAE,kBAAkB;IACvB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,yCAAyC;IACtD,QAAQ,EAAE,qBAAa,CAAC,MAAM;IAC9B,IAAI,EAAE,IAAI;IACV,YAAY,EAAE,iDAA4E;IAC1F,MAAM,EAAE;QACN;YACE,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,iFAAiF;YAC9F,IAAI,EAAE,kBAAU,CAAC,IAAI;YACrB,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9B,WAAW,EAAE,6DAA6D;SAC3E;QACD;YACE,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,kBAAU,CAAC,MAAM;YACvB,UAAU,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC/B,YAAY,EAAE,wBAAwB;YACtC,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,sCAAsC,EAAE,KAAK,EAAE,wBAAwB,EAAE;gBAClF,EAAE,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAE,wBAAwB,EAAE;gBACpE,EAAE,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAE,wBAAwB,EAAE;aACrE;SACF;QACD;YACE,EAAE,EAAE,YAAY;YAChB,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,sFAAsF;YACnG,IAAI,EAAE,kBAAU,CAAC,MAAM;YACvB,UAAU,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE;YACvC,WAAW,EAAE,UAAU;SACxB;KACF;IACD,OAAO,EAAE;QACP;YACE,EAAE,EAAE,YAAY;YAChB,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,4BAA4B;YACzC,IAAI,EAAE,kBAAU,CAAC,KAAK;SACvB;QACD;YACE,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,kBAAU,CAAC,MAAM;SACxB;QACD;YACE,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,kBAAU,CAAC,MAAM;SACxB;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-image.action.d.ts","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/generate-image.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"generate-image.action.d.ts","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/generate-image.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,mBAAmB,EAAE,qBAgFjC,CAAC"}
|
|
@@ -13,58 +13,45 @@ exports.generateImageAction = {
|
|
|
13
13
|
inputs: [
|
|
14
14
|
{
|
|
15
15
|
id: 'prompt',
|
|
16
|
-
name: '
|
|
17
|
-
description: '
|
|
16
|
+
name: 'Image description',
|
|
17
|
+
description: 'Describe the image you want. Be specific for better results.',
|
|
18
18
|
type: types_1.FIELD_TYPE.STRING,
|
|
19
|
-
validation: {
|
|
20
|
-
|
|
21
|
-
minLength: 1,
|
|
22
|
-
maxLength: 1000,
|
|
23
|
-
},
|
|
24
|
-
placeholder: 'A beautiful sunset over the ocean',
|
|
19
|
+
validation: { required: true, minLength: 1, maxLength: 1000 },
|
|
20
|
+
placeholder: 'e.g. A cozy coffee shop at night, warm lighting, rain on the window',
|
|
25
21
|
},
|
|
26
22
|
{
|
|
27
23
|
id: 'model',
|
|
28
24
|
name: 'Model',
|
|
29
|
-
description: 'DALL-E
|
|
25
|
+
description: 'DALL-E version (3 has higher quality)',
|
|
30
26
|
type: types_1.FIELD_TYPE.STRING,
|
|
31
|
-
validation: {
|
|
32
|
-
required: false,
|
|
33
|
-
enum: ['dall-e-2', 'dall-e-3'],
|
|
34
|
-
},
|
|
27
|
+
validation: { required: false, enum: ['dall-e-2', 'dall-e-3'] },
|
|
35
28
|
defaultValue: 'dall-e-3',
|
|
36
29
|
options: [
|
|
37
|
-
{ label: 'DALL-E 3', value: 'dall-e-3' },
|
|
30
|
+
{ label: 'DALL-E 3 (recommended)', value: 'dall-e-3' },
|
|
38
31
|
{ label: 'DALL-E 2', value: 'dall-e-2' },
|
|
39
32
|
],
|
|
40
33
|
},
|
|
41
34
|
{
|
|
42
35
|
id: 'size',
|
|
43
|
-
name: '
|
|
44
|
-
description: '
|
|
36
|
+
name: 'Image size',
|
|
37
|
+
description: 'Output dimensions (DALL-E 3: 1024 or 1792; DALL-E 2: 256–1024)',
|
|
45
38
|
type: types_1.FIELD_TYPE.STRING,
|
|
46
|
-
validation: {
|
|
47
|
-
required: false,
|
|
48
|
-
enum: ['256x256', '512x512', '1024x1024', '1792x1024', '1024x1792'],
|
|
49
|
-
},
|
|
39
|
+
validation: { required: false, enum: ['256x256', '512x512', '1024x1024', '1792x1024', '1024x1792'] },
|
|
50
40
|
defaultValue: '1024x1024',
|
|
51
41
|
options: [
|
|
52
|
-
{ label: '
|
|
53
|
-
{ label: '
|
|
54
|
-
{ label: '
|
|
55
|
-
{ label: '
|
|
56
|
-
{ label: '
|
|
42
|
+
{ label: '1024×1024 (square)', value: '1024x1024' },
|
|
43
|
+
{ label: '1792×1024 (landscape)', value: '1792x1024' },
|
|
44
|
+
{ label: '1024×1792 (portrait)', value: '1024x1792' },
|
|
45
|
+
{ label: '512×512', value: '512x512' },
|
|
46
|
+
{ label: '256×256', value: '256x256' },
|
|
57
47
|
],
|
|
58
48
|
},
|
|
59
49
|
{
|
|
60
50
|
id: 'quality',
|
|
61
51
|
name: 'Quality',
|
|
62
|
-
description: '
|
|
52
|
+
description: 'DALL-E 3 only: standard or HD',
|
|
63
53
|
type: types_1.FIELD_TYPE.STRING,
|
|
64
|
-
validation: {
|
|
65
|
-
required: false,
|
|
66
|
-
enum: ['standard', 'hd'],
|
|
67
|
-
},
|
|
54
|
+
validation: { required: false, enum: ['standard', 'hd'] },
|
|
68
55
|
options: [
|
|
69
56
|
{ label: 'Standard', value: 'standard' },
|
|
70
57
|
{ label: 'HD', value: 'hd' },
|
|
@@ -73,12 +60,9 @@ exports.generateImageAction = {
|
|
|
73
60
|
{
|
|
74
61
|
id: 'style',
|
|
75
62
|
name: 'Style',
|
|
76
|
-
description: '
|
|
63
|
+
description: 'DALL-E 3 only: more vivid or more natural',
|
|
77
64
|
type: types_1.FIELD_TYPE.STRING,
|
|
78
|
-
validation: {
|
|
79
|
-
required: false,
|
|
80
|
-
enum: ['vivid', 'natural'],
|
|
81
|
-
},
|
|
65
|
+
validation: { required: false, enum: ['vivid', 'natural'] },
|
|
82
66
|
options: [
|
|
83
67
|
{ label: 'Vivid', value: 'vivid' },
|
|
84
68
|
{ label: 'Natural', value: 'natural' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-image.action.js","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/generate-image.action.ts"],"names":[],"mappings":";;;AAAA,uCAKqB;AACrB,+EAA0E;AAE7D,QAAA,mBAAmB,GAA0B;IACxD,GAAG,EAAE,gBAAgB;IACrB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gCAAgC;IAC7C,QAAQ,EAAE,qBAAa,CAAC,MAAM;IAC9B,IAAI,EAAE,IAAI;IACV,YAAY,EAAE,6CAA0E;IACxF,MAAM,EAAE;QACN;YACE,EAAE,EAAE,QAAQ;YACZ,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"generate-image.action.js","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/generate-image.action.ts"],"names":[],"mappings":";;;AAAA,uCAKqB;AACrB,+EAA0E;AAE7D,QAAA,mBAAmB,GAA0B;IACxD,GAAG,EAAE,gBAAgB;IACrB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gCAAgC;IAC7C,QAAQ,EAAE,qBAAa,CAAC,MAAM;IAC9B,IAAI,EAAE,IAAI;IACV,YAAY,EAAE,6CAA0E;IACxF,MAAM,EAAE;QACN;YACE,EAAE,EAAE,QAAQ;YACZ,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,8DAA8D;YAC3E,IAAI,EAAE,kBAAU,CAAC,MAAM;YACvB,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE;YAC7D,WAAW,EAAE,qEAAqE;SACnF;QACD;YACE,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,uCAAuC;YACpD,IAAI,EAAE,kBAAU,CAAC,MAAM;YACvB,UAAU,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE;YAC/D,YAAY,EAAE,UAAU;YACxB,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,wBAAwB,EAAE,KAA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,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;YAC3D,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;gBAClC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;aACvC;SACF;KACF;IACD,OAAO,EAAE;QACP;YACE,EAAE,EAAE,UAAU;YACd,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,4BAA4B;YACzC,IAAI,EAAE,kBAAU,CAAC,GAAG;SACrB;QACD;YACE,EAAE,EAAE,eAAe;YACnB,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,mCAAmC;YAChD,IAAI,EAAE,kBAAU,CAAC,MAAM;SACxB;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/chatgpt/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
|