@inductiv/node-red-openai-api 1.103.0 → 6.27.0
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 +213 -86
- package/examples/realtime/client-secrets.json +182 -0
- package/examples/responses/computer-use.json +142 -0
- package/examples/responses/mcp.json +1 -1
- package/examples/responses/phase.json +102 -0
- package/examples/responses/tool-search.json +107 -0
- package/examples/responses/websocket.json +172 -0
- package/internals/openai-api-features-v6.23.0-v6.27.0.md +96 -0
- package/lib.js +12696 -15003
- package/locales/en-US/node.json +50 -1
- package/node.html +1723 -1012
- package/node.js +204 -54
- package/package.json +9 -7
- package/src/assistants/help.html +1 -77
- package/src/audio/help.html +1 -37
- package/src/batch/help.html +3 -17
- package/src/chat/help.html +11 -89
- package/src/container-files/help.html +1 -27
- package/src/containers/help.html +8 -18
- package/src/conversations/help.html +135 -0
- package/src/conversations/methods.js +73 -0
- package/src/conversations/template.html +10 -0
- package/src/embeddings/help.html +1 -11
- package/src/evals/help.html +249 -0
- package/src/evals/methods.js +114 -0
- package/src/evals/template.html +14 -0
- package/src/files/help.html +4 -17
- package/src/fine-tuning/help.html +1 -35
- package/src/images/help.html +1 -45
- package/src/lib.js +53 -1
- package/src/messages/help.html +19 -39
- package/src/messages/methods.js +13 -0
- package/src/messages/template.html +7 -18
- package/src/models/help.html +1 -5
- package/src/moderations/help.html +1 -5
- package/src/node.html +126 -37
- package/src/realtime/help.html +209 -0
- package/src/realtime/methods.js +45 -0
- package/src/realtime/template.html +7 -0
- package/src/responses/help.html +286 -63
- package/src/responses/methods.js +234 -16
- package/src/responses/template.html +21 -1
- package/src/responses/websocket.js +150 -0
- package/src/runs/help.html +1 -123
- package/src/skills/help.html +183 -0
- package/src/skills/methods.js +99 -0
- package/src/skills/template.html +13 -0
- package/src/threads/help.html +1 -15
- package/src/uploads/help.html +1 -21
- package/src/vector-store-file-batches/help.html +1 -27
- package/src/vector-store-file-batches/methods.js +5 -5
- package/src/vector-store-files/help.html +1 -25
- package/src/vector-store-files/methods.js +4 -7
- package/src/vector-stores/help.html +2 -31
- package/src/vector-stores/methods.js +5 -11
- package/src/vector-stores/template.html +7 -22
- package/src/videos/help.html +113 -0
- package/src/videos/methods.js +50 -0
- package/src/videos/template.html +8 -0
- package/src/webhooks/help.html +61 -0
- package/src/webhooks/methods.js +40 -0
- package/src/webhooks/template.html +4 -0
- package/test/openai-methods-mapping.test.js +1559 -0
- package/test/openai-node-auth-routing.test.js +206 -0
- package/test/openai-responses-websocket.test.js +472 -0
- package/test/service-host-editor-template.test.js +56 -0
- package/test/service-host-node.test.js +185 -0
- package/test/services.test.js +150 -0
- package/test/utils.test.js +78 -0
package/src/images/help.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<section>
|
|
2
2
|
<details>
|
|
3
3
|
<summary style="font-weight: bold;">🖼️ Images</summary>
|
|
4
|
-
<a href="https://
|
|
4
|
+
<a href="https://developers.openai.com/api/reference/typescript/resources/images/" target="_blank">Official Documentation
|
|
5
5
|
<i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
6
6
|
<h4 style="font-weight: bolder;"> ⋙ Create Image</h4>
|
|
7
7
|
<p>Creates an image given a prompt.</p>
|
|
@@ -10,36 +10,26 @@
|
|
|
10
10
|
|
|
11
11
|
<dt>
|
|
12
12
|
prompt
|
|
13
|
-
<a href="https://platform.openai.com/docs/api-reference/images/create#images-create-prompt"
|
|
14
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
15
13
|
<span class="property-type">string</span>
|
|
16
14
|
</dt>
|
|
17
15
|
<dd>A text description of the desired image(s).</dd>
|
|
18
16
|
<dt class="optional">
|
|
19
17
|
model
|
|
20
|
-
<a href="https://platform.openai.com/docs/api-reference/images/create#images-create-model"
|
|
21
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
22
18
|
<span class="property-type">string</span>
|
|
23
19
|
</dt>
|
|
24
20
|
<dd>The model to use for image generation.</dd>
|
|
25
21
|
<dt class="optional">
|
|
26
22
|
n
|
|
27
|
-
<a href="https://platform.openai.com/docs/api-reference/images/create#images-create-n"
|
|
28
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
29
23
|
<span class="property-type">integer</span>
|
|
30
24
|
</dt>
|
|
31
25
|
<dd>The number of images to generate.</dd>
|
|
32
26
|
<dt class="optional">
|
|
33
27
|
quality
|
|
34
|
-
<a href="https://platform.openai.com/docs/api-reference/images/create#images-create-quality"
|
|
35
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
36
28
|
<span class="property-type">string</span>
|
|
37
29
|
</dt>
|
|
38
30
|
<dd>The quality of the image that will be generated.</dd>
|
|
39
31
|
<dt class="optional">
|
|
40
32
|
response_format
|
|
41
|
-
<a href="https://platform.openai.com/docs/api-reference/images/create#images-create-response_format"
|
|
42
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
43
33
|
<span class="property-type">string</span>
|
|
44
34
|
</dt>
|
|
45
35
|
<dd>
|
|
@@ -48,8 +38,6 @@
|
|
|
48
38
|
</dd>
|
|
49
39
|
<dt class="optional">
|
|
50
40
|
size
|
|
51
|
-
<a href="https://platform.openai.com/docs/api-reference/images/create#images-create-size"
|
|
52
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
53
41
|
<span class="property-type">string</span>
|
|
54
42
|
</dt>
|
|
55
43
|
<dd>
|
|
@@ -59,8 +47,6 @@
|
|
|
59
47
|
</dd>
|
|
60
48
|
<dt class="optional">
|
|
61
49
|
style
|
|
62
|
-
<a href="https://platform.openai.com/docs/api-reference/images/create#images-create-style"
|
|
63
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
64
50
|
<span class="property-type">string</span>
|
|
65
51
|
</dt>
|
|
66
52
|
<dd>
|
|
@@ -68,8 +54,6 @@
|
|
|
68
54
|
</dd>
|
|
69
55
|
<dt class="optional">
|
|
70
56
|
user
|
|
71
|
-
<a href="https://platform.openai.com/docs/api-reference/images/create#images-create-user"
|
|
72
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
73
57
|
<span class="property-type">string</span>
|
|
74
58
|
</dt>
|
|
75
59
|
<dd>
|
|
@@ -87,22 +71,16 @@
|
|
|
87
71
|
|
|
88
72
|
<dt>
|
|
89
73
|
image
|
|
90
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createEdit#images-createedit-image"
|
|
91
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
92
74
|
<span class="property-type">string</span>
|
|
93
75
|
</dt>
|
|
94
76
|
<dd>The image to edit.</dd>
|
|
95
77
|
<dt>
|
|
96
78
|
prompt
|
|
97
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createEdit#images-createedit-prompt"
|
|
98
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
99
79
|
<span class="property-type">string</span>
|
|
100
80
|
</dt>
|
|
101
81
|
<dd>A text description of the desired image(s).</dd>
|
|
102
82
|
<dt class="optional">
|
|
103
83
|
mask
|
|
104
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createEdit#images-createedit-mask"
|
|
105
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
106
84
|
<span class="property-type">string</span>
|
|
107
85
|
</dt>
|
|
108
86
|
<dd>
|
|
@@ -111,29 +89,21 @@
|
|
|
111
89
|
</dd>
|
|
112
90
|
<dt class="optional">
|
|
113
91
|
model
|
|
114
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createEdit#images-createedit-model"
|
|
115
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
116
92
|
<span class="property-type"></span>
|
|
117
93
|
</dt>
|
|
118
94
|
<dd>The model to use for image generation.</dd>
|
|
119
95
|
<dt class="optional">
|
|
120
96
|
n
|
|
121
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createEdit#images-createedit-n"
|
|
122
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
123
97
|
<span class="property-type">integer</span>
|
|
124
98
|
</dt>
|
|
125
99
|
<dd>The number of images to generate. Must be between 1 and 10.</dd>
|
|
126
100
|
<dt class="optional">
|
|
127
101
|
size
|
|
128
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createEdit#images-createedit-size"
|
|
129
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
130
102
|
<span class="property-type">string</span>
|
|
131
103
|
</dt>
|
|
132
104
|
<dd>The size of the generated images.</dd>
|
|
133
105
|
<dt class="optional">
|
|
134
106
|
response_format
|
|
135
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createEdit#images-createedit-response_format"
|
|
136
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
137
107
|
<span class="property-type">string</span>
|
|
138
108
|
</dt>
|
|
139
109
|
<dd>
|
|
@@ -142,8 +112,6 @@
|
|
|
142
112
|
</dd>
|
|
143
113
|
<dt class="optional">
|
|
144
114
|
user
|
|
145
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createEdit#images-createedit-user"
|
|
146
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
147
115
|
<span class="property-type">string</span>
|
|
148
116
|
</dt>
|
|
149
117
|
<dd>
|
|
@@ -159,43 +127,31 @@
|
|
|
159
127
|
|
|
160
128
|
<dt>
|
|
161
129
|
image
|
|
162
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createVariation#images-createvariation-image"
|
|
163
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
164
130
|
<span class="property-type">string</span>
|
|
165
131
|
</dt>
|
|
166
132
|
<dd>The image to use as the basis for the variation(s).</dd>
|
|
167
133
|
<dt>
|
|
168
134
|
model
|
|
169
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createVariation#images-createvariation-model"
|
|
170
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
171
135
|
<span class="property-type"></span>
|
|
172
136
|
</dt>
|
|
173
137
|
<dd>The model to use for image generation.</dd>
|
|
174
138
|
<dt>
|
|
175
139
|
n
|
|
176
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createVariation#images-createvariation-n"
|
|
177
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
178
140
|
<span class="property-type">integer</span>
|
|
179
141
|
</dt>
|
|
180
142
|
<dd>The number of images to generate.</dd>
|
|
181
143
|
<dt>
|
|
182
144
|
response_format
|
|
183
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createVariation#images-createvariation-response_format"
|
|
184
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
185
145
|
<span class="property-type">string</span>
|
|
186
146
|
</dt>
|
|
187
147
|
<dd>The format in which the generated images are returned.</dd>
|
|
188
148
|
<dt>
|
|
189
149
|
size
|
|
190
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createVariation#images-createvariation-size"
|
|
191
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
192
150
|
<span class="property-type">string</span>
|
|
193
151
|
</dt>
|
|
194
152
|
<dd>The size of the generated images.</dd>
|
|
195
153
|
<dt>
|
|
196
154
|
user
|
|
197
|
-
<a href="https://platform.openai.com/docs/api-reference/images/createVariation#images-createvariation-user"
|
|
198
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
199
155
|
<span class="property-type">string</span>
|
|
200
156
|
</dt>
|
|
201
157
|
<dd>
|
package/src/lib.js
CHANGED
|
@@ -6,26 +6,71 @@ const batch = require("./batch/methods.js");
|
|
|
6
6
|
const chat = require("./chat/methods.js");
|
|
7
7
|
const container_files = require("./container-files/methods.js");
|
|
8
8
|
const containers = require("./containers/methods.js");
|
|
9
|
+
const conversations = require("./conversations/methods.js");
|
|
9
10
|
const embeddings = require("./embeddings/methods.js");
|
|
11
|
+
const evals = require("./evals/methods.js");
|
|
10
12
|
const files = require("./files/methods.js");
|
|
11
13
|
const fine_tuning = require("./fine-tuning/methods.js");
|
|
12
14
|
const images = require("./images/methods.js");
|
|
15
|
+
const messages = require("./messages/methods.js");
|
|
13
16
|
const models = require("./models/methods.js");
|
|
14
17
|
const moderations = require("./moderations/methods.js");
|
|
18
|
+
const realtime = require("./realtime/methods.js");
|
|
15
19
|
const responses = require("./responses/methods.js");
|
|
16
20
|
const runs = require("./runs/methods.js");
|
|
21
|
+
const skills = require("./skills/methods.js");
|
|
17
22
|
const threads = require("./threads/methods.js");
|
|
18
23
|
const uploads = require("./uploads/methods.js");
|
|
19
24
|
const vectorStoreFileBatches = require("./vector-store-file-batches/methods.js");
|
|
20
25
|
const vectorStoreFiles = require("./vector-store-files/methods.js");
|
|
21
26
|
const vectorStores = require("./vector-stores/methods.js");
|
|
27
|
+
const videos = require("./videos/methods.js");
|
|
28
|
+
const webhooks = require("./webhooks/methods.js");
|
|
29
|
+
|
|
30
|
+
function normalizeHeaderOrQueryName(headerOrQueryName) {
|
|
31
|
+
if (typeof headerOrQueryName !== "string") {
|
|
32
|
+
return "Authorization";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const trimmedHeaderOrQueryName = headerOrQueryName.trim();
|
|
36
|
+
return trimmedHeaderOrQueryName || "Authorization";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function createApiKeyTransportParams(apiKey, apiKeyTransport = {}) {
|
|
40
|
+
const headerOrQueryName = normalizeHeaderOrQueryName(
|
|
41
|
+
apiKeyTransport.headerOrQueryName
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
if (apiKeyTransport.isQuery) {
|
|
45
|
+
return {
|
|
46
|
+
defaultHeaders: {
|
|
47
|
+
Authorization: null,
|
|
48
|
+
},
|
|
49
|
+
defaultQuery: {
|
|
50
|
+
[headerOrQueryName]: apiKey,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (headerOrQueryName.toLowerCase() === "authorization") {
|
|
56
|
+
return {};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
defaultHeaders: {
|
|
61
|
+
Authorization: null,
|
|
62
|
+
[headerOrQueryName]: apiKey,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
22
66
|
|
|
23
67
|
class OpenaiApi {
|
|
24
|
-
constructor(apiKey, baseURL, organization) {
|
|
68
|
+
constructor(apiKey, baseURL, organization, apiKeyTransport) {
|
|
25
69
|
this.clientParams = {
|
|
26
70
|
apiKey,
|
|
27
71
|
baseURL,
|
|
28
72
|
organization,
|
|
73
|
+
...createApiKeyTransportParams(apiKey, apiKeyTransport),
|
|
29
74
|
};
|
|
30
75
|
}
|
|
31
76
|
}
|
|
@@ -39,16 +84,23 @@ Object.assign(
|
|
|
39
84
|
chat,
|
|
40
85
|
container_files,
|
|
41
86
|
containers,
|
|
87
|
+
conversations,
|
|
42
88
|
embeddings,
|
|
89
|
+
evals,
|
|
43
90
|
files,
|
|
44
91
|
fine_tuning,
|
|
45
92
|
images,
|
|
93
|
+
messages,
|
|
46
94
|
models,
|
|
47
95
|
moderations,
|
|
96
|
+
realtime,
|
|
48
97
|
responses,
|
|
49
98
|
runs,
|
|
99
|
+
skills,
|
|
50
100
|
threads,
|
|
51
101
|
uploads,
|
|
102
|
+
videos,
|
|
103
|
+
webhooks,
|
|
52
104
|
vectorStoreFileBatches,
|
|
53
105
|
vectorStoreFiles,
|
|
54
106
|
vectorStores
|
package/src/messages/help.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<section>
|
|
2
2
|
<details>
|
|
3
3
|
<summary style="font-weight: bold;">📟 Messages</summary>
|
|
4
|
-
<a href="https://
|
|
4
|
+
<a href="https://developers.openai.com/api/reference/typescript/resources/beta/threads/messages/" target="_blank">Official Documentation
|
|
5
5
|
<i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
6
6
|
<h4 style="font-weight: bolder;"> ⋙ List Messages</h4>
|
|
7
7
|
<p>Returns a list of messages for a given thread.</p>
|
|
@@ -10,15 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
<dt>
|
|
12
12
|
thread_id
|
|
13
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/listMessages#messages-listmessages-thread_id"
|
|
14
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
15
13
|
<span class="property-type">string</span>
|
|
16
14
|
</dt>
|
|
17
15
|
<dd>The ID of the thread the messages belong to.</dd>
|
|
18
16
|
<dt class="optional">
|
|
19
17
|
limit
|
|
20
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/listMessages#messages-listmessages-limit"
|
|
21
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
22
18
|
<span class="property-type">integer</span>
|
|
23
19
|
</dt>
|
|
24
20
|
<dd>
|
|
@@ -27,30 +23,22 @@
|
|
|
27
23
|
</dd>
|
|
28
24
|
<dt class="optional">
|
|
29
25
|
order
|
|
30
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/listMessages#messages-listmessages-order"
|
|
31
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
32
26
|
<span class="property-type">string</span>
|
|
33
27
|
</dt>
|
|
34
28
|
<dd>Sort order by the created_at timestamp of the objects.</dd>
|
|
35
29
|
<dt class="optional">
|
|
36
30
|
after
|
|
37
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/listMessages#messages-listmessages-after"
|
|
38
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
39
31
|
<span class="property-type">string</span>
|
|
40
32
|
</dt>
|
|
41
33
|
<dd>A cursor for use in pagination.</dd>
|
|
42
34
|
<dt class="optional">
|
|
43
35
|
before
|
|
44
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/listMessages#messages-listmessages-before"
|
|
45
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
46
36
|
<span class="property-type">string</span>
|
|
47
37
|
</dt>
|
|
48
38
|
<dd>A cursor for use in pagination.</dd>
|
|
49
39
|
|
|
50
40
|
<dt class="optional">
|
|
51
41
|
run_id
|
|
52
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/listMessages#messages-listmessages-run_id"
|
|
53
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
54
42
|
<span class="property-type">string</span>
|
|
55
43
|
</dt>
|
|
56
44
|
<dd>Filter messages by the run ID that generated them.</dd>
|
|
@@ -64,36 +52,26 @@
|
|
|
64
52
|
|
|
65
53
|
<dt>
|
|
66
54
|
thread_id
|
|
67
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/createMessage#messages-createmessage-thread_id"
|
|
68
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
69
55
|
<span class="property-type">string</span>
|
|
70
56
|
</dt>
|
|
71
57
|
<dd>The ID of the thread to create a message for.</dd>
|
|
72
58
|
<dt>
|
|
73
59
|
role
|
|
74
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/createMessage#messages-createmessage-role"
|
|
75
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
76
60
|
<span class="property-type">string</span>
|
|
77
61
|
</dt>
|
|
78
62
|
<dd>The role of the entity that is creating the message.</dd>
|
|
79
63
|
<dt>
|
|
80
64
|
content
|
|
81
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/createMessage#messages-createmessage-content"
|
|
82
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
83
65
|
<span class="property-type">string</span>
|
|
84
66
|
</dt>
|
|
85
67
|
<dd>The content of the message.</dd>
|
|
86
68
|
<dt class="optional">
|
|
87
69
|
attachments
|
|
88
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/createMessage#messages-createmessage-attachments"
|
|
89
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
90
70
|
<span class="property-type">array</span>
|
|
91
71
|
</dt>
|
|
92
72
|
<dd>A list of files attached to the message, and the tools they should be added to.</dd>
|
|
93
73
|
<dt class="optional">
|
|
94
74
|
metadata
|
|
95
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/createMessage#messages-createmessage-metadata"
|
|
96
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
97
75
|
<span class="property-type">object</span>
|
|
98
76
|
</dt>
|
|
99
77
|
<dd>Set of 16 key-value pairs that can be attached to an object.</dd>
|
|
@@ -106,15 +84,11 @@
|
|
|
106
84
|
|
|
107
85
|
<dt>
|
|
108
86
|
thread_id
|
|
109
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/deleteMessage#messages-deletemessage-thread_id"
|
|
110
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
111
87
|
<span class="property-type">string</span>
|
|
112
88
|
</dt>
|
|
113
89
|
<dd>The ID of the thread to which this message belongs.</dd>
|
|
114
90
|
<dt>
|
|
115
91
|
message_id
|
|
116
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/deleteMessage#messages-deletemessage-message_id"
|
|
117
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
118
92
|
<span class="property-type">string</span>
|
|
119
93
|
</dt>
|
|
120
94
|
<dd>The ID of the message to delete.</dd>
|
|
@@ -127,20 +101,34 @@
|
|
|
127
101
|
|
|
128
102
|
<dt>
|
|
129
103
|
thread_id
|
|
130
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/getMessage#messages-getmessage-thread_id"
|
|
131
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
132
104
|
<span class="property-type">string</span>
|
|
133
105
|
</dt>
|
|
134
106
|
<dd>The ID of the thread to which this message belongs.</dd>
|
|
135
107
|
<dt>
|
|
136
108
|
message_id
|
|
137
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/getMessage#messages-getmessage-message_id"
|
|
138
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
139
109
|
<span class="property-type">string</span>
|
|
140
110
|
</dt>
|
|
141
111
|
<dd>The ID of the message to retrieve.</dd>
|
|
142
112
|
</dl>
|
|
143
113
|
|
|
114
|
+
<h4 style="font-weight: bolder;"> ⋙ Delete Message</h4>
|
|
115
|
+
<p>Delete a message.</p>
|
|
116
|
+
<dl class="message-properties">
|
|
117
|
+
<h4>msg.payload Properties</h4>
|
|
118
|
+
|
|
119
|
+
<dt>
|
|
120
|
+
thread_id
|
|
121
|
+
<span class="property-type">string</span>
|
|
122
|
+
</dt>
|
|
123
|
+
<dd>The ID of the thread to which this message belongs.</dd>
|
|
124
|
+
|
|
125
|
+
<dt>
|
|
126
|
+
message_id
|
|
127
|
+
<span class="property-type">string</span>
|
|
128
|
+
</dt>
|
|
129
|
+
<dd>The ID of the thread to which this message belongs.</dd>
|
|
130
|
+
</dl>
|
|
131
|
+
|
|
144
132
|
<h4 style="font-weight: bolder;"> ⋙ Modify Message</h4>
|
|
145
133
|
<p>Modifies a message.</p>
|
|
146
134
|
<dl class="message-properties">
|
|
@@ -148,27 +136,19 @@
|
|
|
148
136
|
|
|
149
137
|
<dt>
|
|
150
138
|
thread_id
|
|
151
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/modifyMessage#messages-modifymessage-thread_id"
|
|
152
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
153
139
|
<span class="property-type">string</span>
|
|
154
140
|
</dt>
|
|
155
141
|
<dd>The ID of the thread to which this message belongs.</dd>
|
|
156
142
|
<dt>
|
|
157
143
|
message_id
|
|
158
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/modifyMessage#messages-modifymessage-message_id"
|
|
159
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
160
144
|
<span class="property-type">string</span>
|
|
161
145
|
</dt>
|
|
162
146
|
<dd>The ID of the message to modify.</dd>
|
|
163
147
|
<dt class="optional">
|
|
164
148
|
metadata
|
|
165
|
-
<a href="https://platform.openai.com/docs/api-reference/messages/modifyMessage#messages-modifymessage-metadata"
|
|
166
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
167
149
|
<span class="property-type">object</span>
|
|
168
150
|
</dt>
|
|
169
151
|
<dd>Set of 16 key-value pairs that can be attached to an object.</dd>
|
|
170
152
|
</dl>
|
|
171
|
-
|
|
172
|
-
|
|
173
153
|
</details>
|
|
174
154
|
</section>
|
package/src/messages/methods.js
CHANGED
|
@@ -40,9 +40,22 @@ async function modifyMessage(parameters) {
|
|
|
40
40
|
return response;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
async function deleteMessage(parameters) {
|
|
44
|
+
const openai = new OpenAI(this.clientParams);
|
|
45
|
+
const { thread_id, message_id, ...params } = parameters.payload;
|
|
46
|
+
const response = await openai.beta.threads.messages.del(
|
|
47
|
+
thread_id,
|
|
48
|
+
message_id,
|
|
49
|
+
params
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
return response;
|
|
53
|
+
}
|
|
54
|
+
|
|
43
55
|
module.exports = {
|
|
44
56
|
listMessages,
|
|
45
57
|
createMessage,
|
|
46
58
|
getMessage,
|
|
47
59
|
modifyMessage,
|
|
60
|
+
deleteMessage,
|
|
48
61
|
};
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
data-i18n="OpenaiApi.parameters.createMessage"
|
|
9
|
-
></option>
|
|
10
|
-
<option
|
|
11
|
-
value="getMessage"
|
|
12
|
-
data-i18n="OpenaiApi.parameters.getMessage"
|
|
13
|
-
></option>
|
|
14
|
-
<option
|
|
15
|
-
value="modifyMessage"
|
|
16
|
-
data-i18n="OpenaiApi.parameters.modifyMessage"
|
|
17
|
-
></option>
|
|
18
|
-
</optgroup>
|
|
1
|
+
<optgroup style="font-style: normal;" label="📟 Messages (Beta)">
|
|
2
|
+
<option value="listMessages" data-i18n="OpenaiApi.parameters.listMessages"></option>
|
|
3
|
+
<option value="createMessage" data-i18n="OpenaiApi.parameters.createMessage"></option>
|
|
4
|
+
<option value="getMessage" data-i18n="OpenaiApi.parameters.getMessage"></option>
|
|
5
|
+
<option value="modifyMessage" data-i18n="OpenaiApi.parameters.modifyMessage"></option>
|
|
6
|
+
<option value="deleteMessage" data-i18n="OpenaiApi.parameters.deleteMessage"></option>
|
|
7
|
+
</optgroup>
|
package/src/models/help.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<section>
|
|
2
2
|
<details>
|
|
3
3
|
<summary style="font-weight: bold;">🧠 Models</summary>
|
|
4
|
-
<a href="https://
|
|
4
|
+
<a href="https://developers.openai.com/api/reference/typescript/resources/models/" target="_blank">Official Documentation
|
|
5
5
|
<i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
6
6
|
<h4 style="font-weight: bolder;"> ⋙ List Models</h4>
|
|
7
7
|
<p>
|
|
@@ -20,8 +20,6 @@
|
|
|
20
20
|
|
|
21
21
|
<dt>
|
|
22
22
|
model
|
|
23
|
-
<a href="https://platform.openai.com/docs/api-reference/models/retrieve#models-retrieve-model"
|
|
24
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
25
23
|
<span class="property-type">string</span>
|
|
26
24
|
</dt>
|
|
27
25
|
<dd>The ID of the model to use for this request</dd>
|
|
@@ -37,8 +35,6 @@
|
|
|
37
35
|
|
|
38
36
|
<dt>
|
|
39
37
|
model
|
|
40
|
-
<a href="https://platform.openai.com/docs/api-reference/models/delete#models-delete-model"
|
|
41
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
42
38
|
<span class="property-type">string</span>
|
|
43
39
|
</dt>
|
|
44
40
|
<dd>The model to delete</dd>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<section>
|
|
2
2
|
<details>
|
|
3
3
|
<summary style="font-weight: bold;">✅ Moderations</summary>
|
|
4
|
-
<a href="https://
|
|
4
|
+
<a href="https://developers.openai.com/api/reference/typescript/resources/moderations/" target="_blank">Official Documentation
|
|
5
5
|
<i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
6
6
|
<h4 style="font-weight: bolder;"> ⋙ Create Moderation</h4>
|
|
7
7
|
<p>Classifies if text violates OpenAI's Content Policy</p>
|
|
@@ -10,15 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
<dt>
|
|
12
12
|
input
|
|
13
|
-
<a href="https://platform.openai.com/docs/api-reference/moderations/create#moderations-create-input"
|
|
14
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
15
13
|
<span class="property-type">string | array</span>
|
|
16
14
|
</dt>
|
|
17
15
|
<dd>The input text to classify</dd>
|
|
18
16
|
<dt class="optional">
|
|
19
17
|
model
|
|
20
|
-
<a href="https://platform.openai.com/docs/api-reference/moderations/create#moderations-create-model"
|
|
21
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
22
18
|
<span class="property-type">string</span>
|
|
23
19
|
</dt>
|
|
24
20
|
<dd>
|