@inductiv/node-red-openai-api 1.87.3 → 1.103.0-patch.1
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 +20 -40
- package/examples/responses/mcp.json +87 -0
- package/gulpfile.js +15 -0
- package/lib.js +16420 -538
- package/locales/en-US/node.json +10 -0
- package/node.html +3050 -3842
- package/node.js +3 -2
- package/package.json +13 -2
- package/src/assistants/help.html +353 -0
- package/src/assistants/methods.js +47 -0
- package/src/assistants/template.html +38 -0
- package/src/audio/help.html +193 -0
- package/src/audio/methods.js +38 -0
- package/src/audio/template.html +14 -0
- package/src/batch/help.html +97 -0
- package/src/batch/methods.js +39 -0
- package/src/batch/template.html +19 -0
- package/src/chat/help.html +436 -0
- package/src/chat/methods.js +82 -0
- package/src/chat/template.html +30 -0
- package/src/container-files/help.html +144 -0
- package/src/container-files/methods.js +60 -0
- package/src/container-files/template.html +7 -0
- package/src/containers/help.html +96 -0
- package/src/containers/methods.js +34 -0
- package/src/containers/template.html +6 -0
- package/src/embeddings/help.html +57 -0
- package/src/embeddings/methods.js +12 -0
- package/src/embeddings/template.html +6 -0
- package/src/files/help.html +102 -0
- package/src/files/methods.js +52 -0
- package/src/files/template.html +22 -0
- package/src/fine-tuning/help.html +187 -0
- package/src/fine-tuning/methods.js +68 -0
- package/src/fine-tuning/template.html +26 -0
- package/src/images/help.html +208 -0
- package/src/images/methods.js +38 -0
- package/src/images/template.html +14 -0
- package/src/lib.js +60 -0
- package/src/messages/help.html +194 -0
- package/src/messages/methods.js +61 -0
- package/src/messages/template.html +7 -0
- package/src/models/help.html +47 -0
- package/src/models/methods.js +30 -0
- package/src/models/template.html +14 -0
- package/src/moderations/help.html +31 -0
- package/src/moderations/methods.js +11 -0
- package/src/moderations/template.html +6 -0
- package/src/node.html +250 -0
- package/src/responses/help.html +248 -0
- package/src/responses/methods.js +55 -0
- package/src/responses/template.html +22 -0
- package/src/runs/help.html +563 -0
- package/src/runs/methods.js +157 -0
- package/src/runs/template.html +35 -0
- package/src/threads/help.html +88 -0
- package/src/threads/methods.js +39 -0
- package/src/threads/template.html +18 -0
- package/src/uploads/help.html +116 -0
- package/src/uploads/methods.js +121 -0
- package/src/uploads/template.html +21 -0
- package/src/vector-store-file-batches/help.html +156 -0
- package/src/vector-store-file-batches/methods.js +84 -0
- package/src/vector-store-file-batches/template.html +22 -0
- package/src/vector-store-files/help.html +133 -0
- package/src/vector-store-files/methods.js +53 -0
- package/src/vector-store-files/template.html +18 -0
- package/src/vector-stores/help.html +162 -0
- package/src/vector-stores/methods.js +48 -0
- package/src/vector-stores/template.html +7 -0
- package/locales/de-DE/node.json +0 -144
- package/locales/ja/node.json +0 -144
- package/locales/zh-CN/node.json +0 -144
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
<section>
|
|
2
|
+
<details>
|
|
3
|
+
<summary style="font-weight: bold;">📥 Vector Store File Batches</summary>
|
|
4
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches" target="_blank">Official
|
|
5
|
+
Documentation
|
|
6
|
+
<i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
7
|
+
<h4 style="font-weight: bolder;"> ⋙ Create Vector Store File Batch</h4>
|
|
8
|
+
<p>Create a vector store file batch.</p>
|
|
9
|
+
<dl class="message-properties">
|
|
10
|
+
<h4>msg.payload Properties</h4>
|
|
11
|
+
<dt>
|
|
12
|
+
vector_store_id
|
|
13
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch#vector-stores-file-batches-createbatch-vector_store_id"
|
|
14
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
15
|
+
<span class="property-type">string</span>
|
|
16
|
+
</dt>
|
|
17
|
+
<dd>The ID of the vector store for which to create a File Batch.</dd>
|
|
18
|
+
|
|
19
|
+
<dt>
|
|
20
|
+
file_ids
|
|
21
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch#vector-stores-file-batches-createbatch-file_ids"
|
|
22
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
23
|
+
<span class="property-type">array</span>
|
|
24
|
+
</dt>
|
|
25
|
+
<dd>A list of File IDs that the vector store should use. Useful for tools like file_search that can access
|
|
26
|
+
files.</dd>
|
|
27
|
+
</dl>
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
<h4 style="font-weight: bolder;"> ⋙ Retrieve Vector Store File Batch</h4>
|
|
31
|
+
<p>Retrieves a vector store file batch.</p>
|
|
32
|
+
<dl class="message-properties">
|
|
33
|
+
<h4>msg.payload Properties</h4>
|
|
34
|
+
<dt>
|
|
35
|
+
vector_store_id
|
|
36
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches/getBatch#vector-stores-file-batches-getbatch-vector_store_id"
|
|
37
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
38
|
+
<span class="property-type">string</span>
|
|
39
|
+
</dt>
|
|
40
|
+
<dd>The ID of the vector store that the file batch belongs to.</dd>
|
|
41
|
+
|
|
42
|
+
<dt>
|
|
43
|
+
batch_id
|
|
44
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches/getBatch#vector-stores-file-batches-getbatch-batch_id"
|
|
45
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
46
|
+
<span class="property-type">string</span>
|
|
47
|
+
</dt>
|
|
48
|
+
<dd>The ID of the file batch being retrieved.</dd>
|
|
49
|
+
</dl>
|
|
50
|
+
|
|
51
|
+
<h4 style="font-weight: bolder;"> ⋙ Cancel Vector Store File Batch</h4>
|
|
52
|
+
<p>Cancel a vector store file batch.</p>
|
|
53
|
+
<dl class="message-properties">
|
|
54
|
+
<h4>msg.payload Properties</h4>
|
|
55
|
+
<dt>
|
|
56
|
+
vector_store_id
|
|
57
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches/cancelBatch#vector-stores-file-batches-cancelbatch-vector_store_id"
|
|
58
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
59
|
+
<span class="property-type">string</span>
|
|
60
|
+
</dt>
|
|
61
|
+
<dd>The ID of the vector store that the file batch belongs to.</dd>
|
|
62
|
+
|
|
63
|
+
<dt>
|
|
64
|
+
batch_id
|
|
65
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches/cancelBatch#vector-stores-file-batches-cancelbatch-batch_id"
|
|
66
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
67
|
+
<span class="property-type">string</span>
|
|
68
|
+
</dt>
|
|
69
|
+
<dd>The ID of the file batch to cancel.</dd>
|
|
70
|
+
</dl>
|
|
71
|
+
|
|
72
|
+
<h4 style="font-weight: bolder;"> ⋙ List Vector Store Batch Files</h4>
|
|
73
|
+
<p>Returns a list of vector store files in a batch.</p>
|
|
74
|
+
<dl class="message-properties">
|
|
75
|
+
<h4>msg.payload Properties</h4>
|
|
76
|
+
<dt>
|
|
77
|
+
vector_store_id
|
|
78
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles#vector-stores-file-batches-listbatchfiles-vector_store_id"
|
|
79
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
80
|
+
<span class="property-type">string</span>
|
|
81
|
+
</dt>
|
|
82
|
+
<dd>The ID of the vector store that the files belong to.</dd>
|
|
83
|
+
|
|
84
|
+
<dt>
|
|
85
|
+
batch_id
|
|
86
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles#vector-stores-file-batches-listbatchfiles-batch_id"
|
|
87
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
88
|
+
<span class="property-type">string</span>
|
|
89
|
+
</dt>
|
|
90
|
+
<dd>The ID of the file batch that the files belong to.</dd>
|
|
91
|
+
|
|
92
|
+
<dt class="optional">
|
|
93
|
+
limit
|
|
94
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles#vector-stores-file-batches-listbatchfiles-limit"
|
|
95
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
96
|
+
<span class="property-type">integer</span>
|
|
97
|
+
</dt>
|
|
98
|
+
<dd>A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is
|
|
99
|
+
20.</dd>
|
|
100
|
+
|
|
101
|
+
<dt class="optional">
|
|
102
|
+
order
|
|
103
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles#vector-stores-file-batches-listbatchfiles-order"
|
|
104
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
105
|
+
<span class="property-type">string</span>
|
|
106
|
+
</dt>
|
|
107
|
+
<dd>Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending
|
|
108
|
+
order.</dd>
|
|
109
|
+
|
|
110
|
+
<dt class="optional">
|
|
111
|
+
after
|
|
112
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles#vector-stores-file-batches-listbatchfiles-after"
|
|
113
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
114
|
+
<span class="property-type">string</span>
|
|
115
|
+
</dt>
|
|
116
|
+
<dd>A cursor for use in pagination. after is an object ID that defines your place in the list.</dd>
|
|
117
|
+
|
|
118
|
+
<dt class="optional">
|
|
119
|
+
before
|
|
120
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles#vector-stores-file-batches-listbatchfiles-before"
|
|
121
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
122
|
+
<span class="property-type">string</span>
|
|
123
|
+
</dt>
|
|
124
|
+
<dd>A cursor for use in pagination. before is an object ID that defines your place in the list.</dd>
|
|
125
|
+
|
|
126
|
+
<dt class="optional">
|
|
127
|
+
filter
|
|
128
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles#vector-stores-file-batches-listbatchfiles-filter"
|
|
129
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
130
|
+
<span class="property-type">string</span>
|
|
131
|
+
</dt>
|
|
132
|
+
<dd>Filter by file status. One of in_progress, completed, failed, cancelled.</dd>
|
|
133
|
+
|
|
134
|
+
<h4 style="font-weight: bolder;"> ⋙ Upload and Poll File Batch [undocumented]</h4>
|
|
135
|
+
<p>Uploads the given files concurrently and then creates a vector store file batch.</p>
|
|
136
|
+
<dl class="message-properties">
|
|
137
|
+
<h4>msg.payload Properties</h4>
|
|
138
|
+
<dt>
|
|
139
|
+
vector_store_id
|
|
140
|
+
<span class="property-type">string</span>
|
|
141
|
+
</dt>
|
|
142
|
+
<dd>The id of the vector store to which the files are being uploaded.</dd>
|
|
143
|
+
<dt>
|
|
144
|
+
files
|
|
145
|
+
<span class="property-type">array</span>
|
|
146
|
+
</dt>
|
|
147
|
+
<dd>A list of absolute file paths to the files that are being uploaded.</dd>
|
|
148
|
+
<dt class="optional">
|
|
149
|
+
file_ids
|
|
150
|
+
<span class="property-type">array</span>
|
|
151
|
+
</dt>
|
|
152
|
+
<dd>A list of previously uploaded file ids.</dd>
|
|
153
|
+
</dl>
|
|
154
|
+
|
|
155
|
+
</details>
|
|
156
|
+
</section>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const OpenAI = require("openai").OpenAI;
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
|
|
4
|
+
async function createVectorStoreFileBatch(parameters) {
|
|
5
|
+
const openai = new OpenAI(this.clientParams);
|
|
6
|
+
const { vector_store_id, ...params } = parameters.payload;
|
|
7
|
+
const response = await openai.vectorStores.fileBatches.create(
|
|
8
|
+
vector_store_id,
|
|
9
|
+
params
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
return response;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async function retrieveVectorStoreFileBatch(parameters) {
|
|
16
|
+
const openai = new OpenAI(this.clientParams);
|
|
17
|
+
const { vector_store_id, batch_id, ...params } = parameters.payload;
|
|
18
|
+
const response = await openai.vectorStores.fileBatches.retrieve(
|
|
19
|
+
vector_store_id,
|
|
20
|
+
batch_id,
|
|
21
|
+
params
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function cancelVectorStoreFileBatch(parameters) {
|
|
28
|
+
const openai = new OpenAI(this.clientParams);
|
|
29
|
+
const { vector_store_id, batch_id, ...params } = parameters.payload;
|
|
30
|
+
const response = await openai.vectorStores.fileBatches.retrieve(
|
|
31
|
+
vector_store_id,
|
|
32
|
+
batch_id,
|
|
33
|
+
params
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
return response;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function listVectorStoreBatchFiles(parameters) {
|
|
40
|
+
const openai = new OpenAI(this.clientParams);
|
|
41
|
+
const { vector_store_id, batch_id, ...params } = parameters.payload;
|
|
42
|
+
const list = await openai.vectorStores.fileBatches.listFiles(
|
|
43
|
+
vector_store_id,
|
|
44
|
+
batch_id,
|
|
45
|
+
params
|
|
46
|
+
);
|
|
47
|
+
const batchFiles = [...list.data];
|
|
48
|
+
|
|
49
|
+
return batchFiles;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function uploadAndPollVectorStoreFileBatch(parameters) {
|
|
53
|
+
const openai = new OpenAI(this.clientParams);
|
|
54
|
+
const { vector_store_id, files, file_ids, ...params } = parameters.payload;
|
|
55
|
+
|
|
56
|
+
if (!files || !Array.isArray(files)) {
|
|
57
|
+
throw new Error("Files is not defined or not an array");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Validate file paths
|
|
61
|
+
files.forEach((path) => {
|
|
62
|
+
if (!fs.existsSync(path)) {
|
|
63
|
+
throw new Error(`File does not exist: ${path}`);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const fileStreams = files.map((path) => fs.createReadStream(path));
|
|
68
|
+
|
|
69
|
+
const response = await openai.vectorStores.fileBatches.uploadAndPoll(
|
|
70
|
+
vector_store_id,
|
|
71
|
+
{ files: fileStreams, fileIds: file_ids },
|
|
72
|
+
params
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
return response;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
module.exports = {
|
|
79
|
+
createVectorStoreFileBatch,
|
|
80
|
+
retrieveVectorStoreFileBatch,
|
|
81
|
+
cancelVectorStoreFileBatch,
|
|
82
|
+
listVectorStoreBatchFiles,
|
|
83
|
+
uploadAndPollVectorStoreFileBatch,
|
|
84
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<optgroup style="font-style: normal;" label="🗄️ Vector Store File Batches (Beta)">
|
|
2
|
+
<option
|
|
3
|
+
value="createVectorStoreFileBatch"
|
|
4
|
+
data-i18n="OpenaiApi.parameters.createVectorStoreFileBatch"
|
|
5
|
+
></option>
|
|
6
|
+
<option
|
|
7
|
+
value="retrieveVectorStoreFileBatch"
|
|
8
|
+
data-i18n="OpenaiApi.parameters.retrieveVectorStoreFileBatch"
|
|
9
|
+
></option>
|
|
10
|
+
<option
|
|
11
|
+
value="cancelVectorStoreFileBatch"
|
|
12
|
+
data-i18n="OpenaiApi.parameters.cancelVectorStoreFileBatch"
|
|
13
|
+
></option>
|
|
14
|
+
<option
|
|
15
|
+
value="listVectorStoreBatchFiles"
|
|
16
|
+
data-i18n="OpenaiApi.parameters.listVectorStoreBatchFiles"
|
|
17
|
+
></option>
|
|
18
|
+
<option
|
|
19
|
+
value="uploadAndPollVectorStoreFileBatch"
|
|
20
|
+
data-i18n="OpenaiApi.parameters.uploadAndPollVectorStoreFileBatch"
|
|
21
|
+
></option>
|
|
22
|
+
</optgroup>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<section>
|
|
2
|
+
<details>
|
|
3
|
+
<summary style="font-weight: bold;">📑 Vector Store Files</summary>
|
|
4
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-files" target="_blank">Official
|
|
5
|
+
Documentation
|
|
6
|
+
<i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
7
|
+
|
|
8
|
+
<h4 style="font-weight: bolder;"> ⋙ Create Vector Store File</h4>
|
|
9
|
+
<p>Create a vector store file by attaching a File to a vector store.</p>
|
|
10
|
+
<dl class="message-properties">
|
|
11
|
+
<h4>msg.payload Properties</h4>
|
|
12
|
+
<dt>
|
|
13
|
+
vector_store_id
|
|
14
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-files/createFile#vector-stores-files-createfile-vector_store_id"
|
|
15
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
16
|
+
<span class="property-type">string</span>
|
|
17
|
+
</dt>
|
|
18
|
+
<dd>The ID of the vector store for which to create a File.</dd>
|
|
19
|
+
|
|
20
|
+
<dt>
|
|
21
|
+
file_id
|
|
22
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-files/createFile#vector-stores-files-createfile-file_id"
|
|
23
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
24
|
+
<span class="property-type">string</span>
|
|
25
|
+
</dt>
|
|
26
|
+
<dd>A File ID that the vector store should use. Useful for tools like file_search that can access files.
|
|
27
|
+
</dd>
|
|
28
|
+
</dl>
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<h4 style="font-weight: bolder;"> ⋙ List Vector Store Files</h4>
|
|
32
|
+
<p>Returns a list of vector store files.</p>
|
|
33
|
+
<dl class="message-properties">
|
|
34
|
+
<h4>msg.payload Properties</h4>
|
|
35
|
+
<dt>
|
|
36
|
+
vector_store_id
|
|
37
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles#vector-stores-files-listfiles-vector_store_id"
|
|
38
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
39
|
+
<span class="property-type">string</span>
|
|
40
|
+
</dt>
|
|
41
|
+
<dd>The ID of the vector store that the files belong to.</dd>
|
|
42
|
+
|
|
43
|
+
<dt class="optional">
|
|
44
|
+
limit
|
|
45
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles#vector-stores-files-listfiles-limit"
|
|
46
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
47
|
+
<span class="property-type">integer</span>
|
|
48
|
+
</dt>
|
|
49
|
+
<dd>A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is
|
|
50
|
+
20.</dd>
|
|
51
|
+
|
|
52
|
+
<dt class="optional">
|
|
53
|
+
order
|
|
54
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles#vector-stores-files-listfiles-order"
|
|
55
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
56
|
+
<span class="property-type">string</span>
|
|
57
|
+
</dt>
|
|
58
|
+
<dd>Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending
|
|
59
|
+
order.</dd>
|
|
60
|
+
|
|
61
|
+
<dt class="optional">
|
|
62
|
+
before
|
|
63
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles#vector-stores-files-listfiles-before"
|
|
64
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
65
|
+
<span class="property-type">string</span>
|
|
66
|
+
</dt>
|
|
67
|
+
<dd>A cursor for use in pagination. before is an object ID that defines your place in the list.</dd>
|
|
68
|
+
|
|
69
|
+
<dt class="optional">
|
|
70
|
+
after
|
|
71
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles#vector-stores-files-listfiles-after"
|
|
72
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
73
|
+
<span class="property-type">string</span>
|
|
74
|
+
</dt>
|
|
75
|
+
<dd>A cursor for use in pagination. after is an object ID that defines your place in the list.</dd>
|
|
76
|
+
|
|
77
|
+
<dt class="optional">
|
|
78
|
+
filter
|
|
79
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles#vector-stores-files-listfiles-filter"
|
|
80
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
81
|
+
<span class="property-type">string</span>
|
|
82
|
+
</dt>
|
|
83
|
+
<dd>Filter by file status. One of in_progress, completed, failed, cancelled.</dd>
|
|
84
|
+
|
|
85
|
+
</dl>
|
|
86
|
+
|
|
87
|
+
<h4 style="font-weight: bolder;"> ⋙ Retrieve Vector Store File</h4>
|
|
88
|
+
<p>Retrieves a vector store file.</p>
|
|
89
|
+
<dl class="message-properties">
|
|
90
|
+
<h4>msg.payload Properties</h4>
|
|
91
|
+
<dt>
|
|
92
|
+
vector_store_id
|
|
93
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-files/getFile#vector-stores-files-getfile-vector_store_id"
|
|
94
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
95
|
+
<span class="property-type">string</span>
|
|
96
|
+
</dt>
|
|
97
|
+
<dd>The ID of the vector store that the file belongs to.</dd>
|
|
98
|
+
|
|
99
|
+
<dt>
|
|
100
|
+
file_id
|
|
101
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-files/getFile#vector-stores-files-getfile-file_id"
|
|
102
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
103
|
+
<span class="property-type">string</span>
|
|
104
|
+
</dt>
|
|
105
|
+
<dd>The ID of the file being retrieved.</dd>
|
|
106
|
+
|
|
107
|
+
</dl>
|
|
108
|
+
|
|
109
|
+
<h4 style="font-weight: bolder;"> ⋙ Delete Vector Store File</h4>
|
|
110
|
+
<p>Remove a file from a vector store.</p>
|
|
111
|
+
<dl class="message-properties">
|
|
112
|
+
<h4>msg.payload Properties</h4>
|
|
113
|
+
<dt>
|
|
114
|
+
vector_store_id
|
|
115
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-files/deleteFile#vector-stores-files-deletefile-vector_store_id"
|
|
116
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
117
|
+
<span class="property-type">string</span>
|
|
118
|
+
</dt>
|
|
119
|
+
<dd>The ID of the vector store that the file belongs to.</dd>
|
|
120
|
+
|
|
121
|
+
<dt>
|
|
122
|
+
file_id
|
|
123
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores-files/deleteFile#vector-stores-files-deletefile-file_id"
|
|
124
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
125
|
+
<span class="property-type">string</span>
|
|
126
|
+
</dt>
|
|
127
|
+
<dd>The ID of the file to remove from the vector store.</dd>
|
|
128
|
+
|
|
129
|
+
</dl>
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
</details>
|
|
133
|
+
</section>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const OpenAI = require("openai").OpenAI;
|
|
2
|
+
|
|
3
|
+
async function createVectorStoreFile(parameters) {
|
|
4
|
+
const openai = new OpenAI(this.clientParams);
|
|
5
|
+
const { vector_store_id, ...params } = parameters.payload;
|
|
6
|
+
const response = await openai.vectorStores.files.create(
|
|
7
|
+
vector_store_id,
|
|
8
|
+
params
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
return response;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async function listVectorStoreFiles(parameters) {
|
|
15
|
+
/* Returns a list of vector store files. */
|
|
16
|
+
|
|
17
|
+
const openai = new OpenAI(this.clientParams);
|
|
18
|
+
const { vector_store_id, ...params } = parameters.payload;
|
|
19
|
+
const list = await openai.vectorStores.files.list(vector_store_id, params);
|
|
20
|
+
|
|
21
|
+
return [...list.data];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async function retrieveVectorStoreFile(parameters) {
|
|
25
|
+
/* Retrieves a vector store file. */
|
|
26
|
+
|
|
27
|
+
const openai = new OpenAI(this.clientParams);
|
|
28
|
+
const { vector_store_id, file_id } = parameters.payload;
|
|
29
|
+
const response = openai.vectorStores.files.retrieve(vector_store_id, file_id);
|
|
30
|
+
|
|
31
|
+
return response;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async function deleteVectorStoreFile(parameters) {
|
|
35
|
+
/* Removes a file from the vector store. */
|
|
36
|
+
|
|
37
|
+
const openai = new OpenAI(this.clientParams);
|
|
38
|
+
const { vector_store_id, file_id, ...params } = parameters.payload;
|
|
39
|
+
const response = openai.vectorStores.files.del(
|
|
40
|
+
vector_store_id,
|
|
41
|
+
file_id,
|
|
42
|
+
params
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
return response;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
module.exports = {
|
|
49
|
+
createVectorStoreFile,
|
|
50
|
+
listVectorStoreFiles,
|
|
51
|
+
retrieveVectorStoreFile,
|
|
52
|
+
deleteVectorStoreFile,
|
|
53
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<optgroup style="font-style: normal;" label="🗃️ Vector Store Files (Beta)">
|
|
2
|
+
<option
|
|
3
|
+
value="createVectorStoreFile"
|
|
4
|
+
data-i18n="OpenaiApi.parameters.createVectorStoreFile"
|
|
5
|
+
></option>
|
|
6
|
+
<option
|
|
7
|
+
value="listVectorStoreFiles"
|
|
8
|
+
data-i18n="OpenaiApi.parameters.listVectorStoreFiles"
|
|
9
|
+
></option>
|
|
10
|
+
<option
|
|
11
|
+
value="retrieveVectorStoreFile"
|
|
12
|
+
data-i18n="OpenaiApi.parameters.retrieveVectorStoreFile"
|
|
13
|
+
></option>
|
|
14
|
+
<option
|
|
15
|
+
value="deleteVectorStoreFile"
|
|
16
|
+
data-i18n="OpenaiApi.parameters.deleteVectorStoreFile"
|
|
17
|
+
></option>
|
|
18
|
+
</optgroup>
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<section>
|
|
2
|
+
<details>
|
|
3
|
+
<summary style="font-weight: bold;">🗃️ Vector Stores</summary>
|
|
4
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores" target="_blank">Official Documentation
|
|
5
|
+
<i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
6
|
+
<h4 style="font-weight: bolder;"> ⋙ Create Vector Store</h4>
|
|
7
|
+
<p>Create a vector store.</p>
|
|
8
|
+
<dl class="message-properties">
|
|
9
|
+
<h4>msg.payload Properties</h4>
|
|
10
|
+
<dt class="optional">
|
|
11
|
+
file_ids
|
|
12
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/create" target="_blank"><i
|
|
13
|
+
class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
14
|
+
<span class="property-type">array</span>
|
|
15
|
+
</dt>
|
|
16
|
+
<dd>A list of File IDs that the vector store should use. Useful for tools like file_search that can access
|
|
17
|
+
files.</dd>
|
|
18
|
+
|
|
19
|
+
<dt class="optional">
|
|
20
|
+
name
|
|
21
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/create#vector-stores-create-name"
|
|
22
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
23
|
+
<span class="property-type">string</span>
|
|
24
|
+
</dt>
|
|
25
|
+
<dd>The name of the vector store.</dd>
|
|
26
|
+
|
|
27
|
+
<dt class="optional">
|
|
28
|
+
expires_after
|
|
29
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/create#vector-stores-create-expires_after"
|
|
30
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
31
|
+
<span class="property-type">object</span>
|
|
32
|
+
</dt>
|
|
33
|
+
<dd>The expiration policy for a vector store.</dd>
|
|
34
|
+
|
|
35
|
+
<dt class="optional">
|
|
36
|
+
chunking_strategy
|
|
37
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/create#vector-stores-create-chunking_strategy"
|
|
38
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
39
|
+
<span class="property-type">object</span>
|
|
40
|
+
</dt>
|
|
41
|
+
<dd>The chunking strategy used to chunk the file(s).</dd>
|
|
42
|
+
|
|
43
|
+
<dt class="optional">
|
|
44
|
+
metadata
|
|
45
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/create#vector-stores-create-metadata"
|
|
46
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
47
|
+
<span class="property-type">object</span>
|
|
48
|
+
</dt>
|
|
49
|
+
<dd>Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional
|
|
50
|
+
information about the object in a structured format. Keys can be a maximum of 64 characters long and
|
|
51
|
+
values can be a maximum of 512 characters long.</dd>
|
|
52
|
+
</dl>
|
|
53
|
+
|
|
54
|
+
<h4 style="font-weight: bolder;"> ⋙ List Vector Stores</h4>
|
|
55
|
+
<p>Returns a list of vector stores.</p>
|
|
56
|
+
<dl class="message-properties">
|
|
57
|
+
<h4>msg.payload Properties</h4>
|
|
58
|
+
|
|
59
|
+
<dt class="optional">
|
|
60
|
+
limit
|
|
61
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/list#vector-stores-list-limit"
|
|
62
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
63
|
+
<span class="property-type">integer</span>
|
|
64
|
+
</dt>
|
|
65
|
+
<dd>A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is
|
|
66
|
+
20.</dd>
|
|
67
|
+
|
|
68
|
+
<dt class="optional">
|
|
69
|
+
order
|
|
70
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/list#vector-stores-list-order"
|
|
71
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
72
|
+
<span class="property-type">string</span>
|
|
73
|
+
</dt>
|
|
74
|
+
<dd>Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending
|
|
75
|
+
order.</dd>
|
|
76
|
+
|
|
77
|
+
<dt class="optional">
|
|
78
|
+
after
|
|
79
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/list#vector-stores-list-after"
|
|
80
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
81
|
+
<span class="property-type">string</span>
|
|
82
|
+
</dt>
|
|
83
|
+
<dd>A cursor for use in pagination. after is an object ID that defines your place in the list.</dd>
|
|
84
|
+
|
|
85
|
+
<dt class="optional">
|
|
86
|
+
before
|
|
87
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/list#vector-stores-list-before"
|
|
88
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
89
|
+
<span class="property-type">string</span>
|
|
90
|
+
</dt>
|
|
91
|
+
<dd>A cursor for use in pagination. before is an object ID that defines your place in the list.</dd>
|
|
92
|
+
</dl>
|
|
93
|
+
|
|
94
|
+
<h4 style="font-weight: bolder;"> ⋙ Retrieve Vector Store</h4>
|
|
95
|
+
<p>Retrieves a vector store.</p>
|
|
96
|
+
<dl class="message-properties">
|
|
97
|
+
<h4>msg.payload Properties</h4>
|
|
98
|
+
|
|
99
|
+
<dt>
|
|
100
|
+
vector_store_id
|
|
101
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/retrieve#vector-stores-retrieve-vector_store_id"
|
|
102
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
103
|
+
<span class="property-type">string</span>
|
|
104
|
+
</dt>
|
|
105
|
+
<dd>The ID of the vector store to retrieve.</dd>
|
|
106
|
+
</dl>
|
|
107
|
+
|
|
108
|
+
<h4 style="font-weight: bolder;"> ⋙ Modify Vector Store</h4>
|
|
109
|
+
<p>Modifies a vector store.</p>
|
|
110
|
+
<dl class="message-properties">
|
|
111
|
+
<h4>msg.payload Properties</h4>
|
|
112
|
+
|
|
113
|
+
<dt>
|
|
114
|
+
vector_store_id
|
|
115
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/modify#vector-stores-modify-vector_store_id"
|
|
116
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
117
|
+
<span class="property-type">string</span>
|
|
118
|
+
</dt>
|
|
119
|
+
<dd>The ID of the vector store to modify.</dd>
|
|
120
|
+
|
|
121
|
+
<dt class="optional">
|
|
122
|
+
name
|
|
123
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/modify#vector-stores-modify-name"
|
|
124
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
125
|
+
<span class="property-type">string</span>
|
|
126
|
+
</dt>
|
|
127
|
+
<dd>The name of the vector store.</dd>
|
|
128
|
+
|
|
129
|
+
<dt class="optional">
|
|
130
|
+
expires_after
|
|
131
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/modify#vector-stores-modify-expires_after"
|
|
132
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
133
|
+
<span class="property-type">object</span>
|
|
134
|
+
</dt>
|
|
135
|
+
<dd>The expiration policy for a vector store.</dd>
|
|
136
|
+
|
|
137
|
+
<dt class="optional">
|
|
138
|
+
metadata
|
|
139
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/modify#vector-stores-modify-metadata"
|
|
140
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
141
|
+
<span class="property-type">object</span>
|
|
142
|
+
</dt>
|
|
143
|
+
<dd>Set of 16 key-value pairs that can be attached to an object.</dd>
|
|
144
|
+
</dl>
|
|
145
|
+
<dl>
|
|
146
|
+
<h4 style="font-weight: bolder;"> ⋙ Delete Vector Store</h4>
|
|
147
|
+
<p>Delete a vector store.</p>
|
|
148
|
+
<dl class="message-properties">
|
|
149
|
+
<h4>msg.payload Properties</h4>
|
|
150
|
+
|
|
151
|
+
<dt>
|
|
152
|
+
vector_store_id
|
|
153
|
+
<a href="https://platform.openai.com/docs/api-reference/vector-stores/delete#vector-stores-delete-vector_store_id"
|
|
154
|
+
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
155
|
+
<span class="property-type">string</span>
|
|
156
|
+
</dt>
|
|
157
|
+
<dd>The ID of the vector store to delete.</dd>
|
|
158
|
+
</dl>
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
</details>
|
|
162
|
+
</section>
|