@pipedream/openai 0.6.1 → 0.7.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/actions/analyze-image-content/analyze-image-content.mjs +1 -1
- package/actions/cancel-run/cancel-run.mjs +1 -1
- package/actions/chat/chat.mjs +1 -1
- package/actions/chat-with-assistant/chat-with-assistant.mjs +1 -1
- package/actions/classify-items-into-categories/classify-items-into-categories.mjs +1 -1
- package/actions/convert-text-to-speech/convert-text-to-speech.mjs +1 -1
- package/actions/create-assistant/create-assistant.mjs +1 -1
- package/actions/create-batch/create-batch.mjs +1 -1
- package/actions/create-embeddings/create-embeddings.mjs +1 -1
- package/actions/create-fine-tuning-job/create-fine-tuning-job.mjs +1 -1
- package/actions/create-image/create-image.mjs +1 -1
- package/actions/create-moderation/create-moderation.mjs +1 -1
- package/actions/create-thread/create-thread.mjs +1 -1
- package/actions/create-transcription/create-transcription.mjs +1 -1
- package/actions/create-vector-store/create-vector-store.mjs +103 -0
- package/actions/create-vector-store-file/create-vector-store-file.mjs +77 -0
- package/actions/delete-file/delete-file.mjs +1 -1
- package/actions/delete-vector-store/delete-vector-store.mjs +26 -0
- package/actions/delete-vector-store-file/delete-vector-store-file.mjs +36 -0
- package/actions/list-files/list-files.mjs +1 -1
- package/actions/list-messages/list-messages.mjs +1 -1
- package/actions/list-run-steps/list-run-steps.mjs +1 -1
- package/actions/list-runs/list-runs.mjs +1 -1
- package/actions/list-vector-store-files/list-vector-store-files.mjs +53 -0
- package/actions/list-vector-stores/list-vector-stores.mjs +46 -0
- package/actions/modify-assistant/modify-assistant.mjs +1 -1
- package/actions/retrieve-file/retrieve-file.mjs +1 -1
- package/actions/retrieve-file-content/retrieve-file-content.mjs +1 -1
- package/actions/retrieve-run/retrieve-run.mjs +1 -1
- package/actions/retrieve-run-step/retrieve-run-step.mjs +1 -1
- package/actions/retrieve-vector-store/retrieve-vector-store.mjs +26 -0
- package/actions/retrieve-vector-store-file/retrieve-vector-store-file.mjs +36 -0
- package/actions/send-prompt/send-prompt.mjs +1 -1
- package/actions/submit-tool-outputs-to-run/submit-tool-outputs-to-run.mjs +1 -1
- package/actions/summarize/summarize.mjs +1 -1
- package/actions/translate-text/translate-text.mjs +1 -1
- package/actions/upload-file/upload-file.mjs +1 -1
- package/openai.app.mjs +117 -0
- package/package.json +1 -1
- package/sources/new-batch-completed/new-batch-completed.mjs +1 -1
- package/sources/new-file-created/new-file-created.mjs +1 -1
- package/sources/new-fine-tuning-job-created/new-fine-tuning-job-created.mjs +1 -1
- package/sources/new-run-state-changed/new-run-state-changed.mjs +1 -1
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "openai-analyze-image-content",
|
|
9
9
|
name: "Analyze Image Content",
|
|
10
10
|
description: "Send a message or question about an image and receive a response. [See the documentation](https://platform.openai.com/docs/api-reference/runs/createThreadAndRun)",
|
|
11
|
-
version: "0.1.
|
|
11
|
+
version: "0.1.1",
|
|
12
12
|
type: "action",
|
|
13
13
|
props: {
|
|
14
14
|
openai,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-cancel-run",
|
|
5
5
|
name: "Cancel Run (Assistants)",
|
|
6
6
|
description: "Cancels a run that is in progress. [See the documentation](https://platform.openai.com/docs/api-reference/runs/cancelRun)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.11",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
package/actions/chat/chat.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { ConfigurationError } from "@pipedream/platform";
|
|
|
6
6
|
export default {
|
|
7
7
|
...common,
|
|
8
8
|
name: "Chat",
|
|
9
|
-
version: "0.2.
|
|
9
|
+
version: "0.2.2",
|
|
10
10
|
key: "openai-chat",
|
|
11
11
|
description: "The Chat API, using the `gpt-3.5-turbo` or `gpt-4` model. [See the documentation](https://platform.openai.com/docs/api-reference/chat)",
|
|
12
12
|
type: "action",
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "openai-chat-with-assistant",
|
|
7
7
|
name: "Chat with Assistant",
|
|
8
8
|
description: "Sends a message and generates a response, storing the message history for a continuous conversation. [See the documentation](https://platform.openai.com/docs/api-reference/runs/createThreadAndRun)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.6",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
openai,
|
|
@@ -3,7 +3,7 @@ import common from "../common/common-helper.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
...common,
|
|
5
5
|
name: "Classify Items into Categories",
|
|
6
|
-
version: "0.1.
|
|
6
|
+
version: "0.1.2",
|
|
7
7
|
key: "openai-classify-items-into-categories",
|
|
8
8
|
description: "Classify items into specific categories using the Chat API. [See the documentation](https://platform.openai.com/docs/api-reference/chat)",
|
|
9
9
|
type: "action",
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "openai-convert-text-to-speech",
|
|
6
6
|
name: "Convert Text to Speech (TTS)",
|
|
7
7
|
description: "Generates audio from the input text. [See the documentation](https://platform.openai.com/docs/api-reference/audio/createSpeech)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.10",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
openai,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "openai-create-assistant",
|
|
7
7
|
name: "Create Assistant",
|
|
8
8
|
description: "Creates an assistant with a model and instructions. [See the documentation](https://platform.openai.com/docs/api-reference/assistants/createAssistant)",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.8",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
openai,
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "openai-create-batch",
|
|
9
9
|
name: "Create Batch",
|
|
10
10
|
description: "Creates and executes a batch from an uploaded file of requests. [See the documentation](https://platform.openai.com/docs/api-reference/batch/create)",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.5",
|
|
12
12
|
type: "action",
|
|
13
13
|
props: {
|
|
14
14
|
openai,
|
|
@@ -4,7 +4,7 @@ import common from "../common/common.mjs";
|
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
name: "Create Embeddings",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.14",
|
|
8
8
|
key: "openai-create-embeddings",
|
|
9
9
|
description: "Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. [See the documentation](https://platform.openai.com/docs/api-reference/embeddings)",
|
|
10
10
|
type: "action",
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-create-fine-tuning-job",
|
|
5
5
|
name: "Create Fine Tuning Job",
|
|
6
6
|
description: "Creates a job that fine-tunes a specified model from a given dataset. [See the documentation](https://platform.openai.com/docs/api-reference/fine-tuning/create)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.10",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -4,7 +4,7 @@ import fs from "fs";
|
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
name: "Create Image (Dall-E)",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.18",
|
|
8
8
|
key: "openai-create-image",
|
|
9
9
|
description: "Creates an image given a prompt returning a URL to the image. [See the documentation](https://platform.openai.com/docs/api-reference/images)",
|
|
10
10
|
type: "action",
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "openai-create-moderation",
|
|
6
6
|
name: "Create Moderation",
|
|
7
7
|
description: "Classifies if text is potentially harmful. [See the documentation](https://platform.openai.com/docs/api-reference/moderations/create)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.5",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
openai,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "openai-create-thread",
|
|
7
7
|
name: "Create Thread (Assistants)",
|
|
8
8
|
description: "Creates a thread with optional messages and metadata, and optionally runs the thread using the specified assistant. [See the documentation](https://platform.openai.com/docs/api-reference/threads/createThread)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.10",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
openai,
|
|
@@ -24,7 +24,7 @@ const pipelineAsync = promisify(stream.pipeline);
|
|
|
24
24
|
|
|
25
25
|
export default {
|
|
26
26
|
name: "Create Transcription (Whisper)",
|
|
27
|
-
version: "0.1.
|
|
27
|
+
version: "0.1.14",
|
|
28
28
|
key: "openai-create-transcription",
|
|
29
29
|
description: "Transcribes audio into the input language. [See the documentation](https://platform.openai.com/docs/api-reference/audio/create).",
|
|
30
30
|
type: "action",
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import openai from "../../openai.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "openai-create-vector-store",
|
|
5
|
+
name: "Create Vector Store",
|
|
6
|
+
description: "Create a vector store. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores/create)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
openai,
|
|
11
|
+
fileIds: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
openai,
|
|
14
|
+
"fileId",
|
|
15
|
+
],
|
|
16
|
+
type: "string[]",
|
|
17
|
+
label: "File IDs",
|
|
18
|
+
description: "An array of File IDs that the vector store should use",
|
|
19
|
+
optional: true,
|
|
20
|
+
reloadProps: true,
|
|
21
|
+
},
|
|
22
|
+
name: {
|
|
23
|
+
type: "string",
|
|
24
|
+
label: "Name",
|
|
25
|
+
description: "Name of the vector store",
|
|
26
|
+
optional: true,
|
|
27
|
+
},
|
|
28
|
+
expiryDays: {
|
|
29
|
+
type: "integer",
|
|
30
|
+
label: "Expiration Days",
|
|
31
|
+
description: "The number of days after the `last_active_at` time that the vector store will expire",
|
|
32
|
+
optional: true,
|
|
33
|
+
},
|
|
34
|
+
metadata: {
|
|
35
|
+
type: "object",
|
|
36
|
+
label: "Metadata",
|
|
37
|
+
description: "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format",
|
|
38
|
+
optional: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
additionalProps() {
|
|
42
|
+
const props = {};
|
|
43
|
+
if (!this.fileIds?.length) {
|
|
44
|
+
return props;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
props.chunkingStrategy = {
|
|
48
|
+
type: "string",
|
|
49
|
+
label: "Chunking Strategy",
|
|
50
|
+
description: "The chunking strategy used to chunk the file(s)",
|
|
51
|
+
options: [
|
|
52
|
+
"auto",
|
|
53
|
+
"static",
|
|
54
|
+
],
|
|
55
|
+
optional: true,
|
|
56
|
+
reloadProps: true,
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
if (this?.chunkingStrategy === "static") {
|
|
60
|
+
props.maxChunkSizeTokens = {
|
|
61
|
+
type: "integer",
|
|
62
|
+
label: "Max Chunk Size Tokens",
|
|
63
|
+
description: "The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.",
|
|
64
|
+
default: 800,
|
|
65
|
+
optional: true,
|
|
66
|
+
};
|
|
67
|
+
props.chunkOverlapTokens = {
|
|
68
|
+
type: "integer",
|
|
69
|
+
label: "Chunk Overlap Tokens",
|
|
70
|
+
description: "The number of tokens that overlap between chunks. The default value is `400`. Note that the overlap must not exceed half of max_chunk_size_tokens.",
|
|
71
|
+
default: 400,
|
|
72
|
+
optional: true,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return props;
|
|
77
|
+
},
|
|
78
|
+
async run({ $ }) {
|
|
79
|
+
const response = await this.openai.createVectorStore({
|
|
80
|
+
$,
|
|
81
|
+
data: {
|
|
82
|
+
file_ids: this.fileIds,
|
|
83
|
+
name: this.name,
|
|
84
|
+
expires_after: this.expiryDays && {
|
|
85
|
+
anchor: "last_active_at",
|
|
86
|
+
days: this.expiryDays,
|
|
87
|
+
},
|
|
88
|
+
chunking_strategy: this.chunkingStrategy && {
|
|
89
|
+
type: this.chunkingStrategy,
|
|
90
|
+
static: this.chunkingStrategy === "static"
|
|
91
|
+
? {
|
|
92
|
+
max_chunk_size_tokens: this.maxChunkSizeTokens,
|
|
93
|
+
chunk_overlap_tokens: this.chunkOverlapTokens,
|
|
94
|
+
}
|
|
95
|
+
: undefined,
|
|
96
|
+
},
|
|
97
|
+
metadata: this.metadata,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
$.export("$summary", `Successfully created vector store with ID: ${response.id}`);
|
|
101
|
+
return response;
|
|
102
|
+
},
|
|
103
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import openai from "../../openai.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "openai-create-vector-store-file",
|
|
5
|
+
name: "Create Vector Store File",
|
|
6
|
+
description: "Create a vector store file. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores-files/createFile)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
openai,
|
|
11
|
+
vectorStoreId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
openai,
|
|
14
|
+
"vectorStoreId",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
fileId: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
openai,
|
|
20
|
+
"fileId",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
chunkingStrategy: {
|
|
24
|
+
type: "string",
|
|
25
|
+
label: "Chunking Strategy",
|
|
26
|
+
description: "The chunking strategy used to chunk the file",
|
|
27
|
+
options: [
|
|
28
|
+
"auto",
|
|
29
|
+
"static",
|
|
30
|
+
],
|
|
31
|
+
optional: true,
|
|
32
|
+
reloadProps: true,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
additionalProps() {
|
|
36
|
+
const props = {};
|
|
37
|
+
|
|
38
|
+
if (this?.chunkingStrategy === "static") {
|
|
39
|
+
props.maxChunkSizeTokens = {
|
|
40
|
+
type: "integer",
|
|
41
|
+
label: "Max Chunk Size Tokens",
|
|
42
|
+
description: "The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`.",
|
|
43
|
+
default: 800,
|
|
44
|
+
optional: true,
|
|
45
|
+
};
|
|
46
|
+
props.chunkOverlapTokens = {
|
|
47
|
+
type: "integer",
|
|
48
|
+
label: "Chunk Overlap Tokens",
|
|
49
|
+
description: "The number of tokens that overlap between chunks. The default value is `400`. Note that the overlap must not exceed half of max_chunk_size_tokens.",
|
|
50
|
+
default: 400,
|
|
51
|
+
optional: true,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return props;
|
|
56
|
+
},
|
|
57
|
+
async run({ $ }) {
|
|
58
|
+
const response = await this.openai.createVectorStoreFile({
|
|
59
|
+
$,
|
|
60
|
+
vectorStoreId: this.vectorStoreId,
|
|
61
|
+
data: {
|
|
62
|
+
file_id: this.fileId,
|
|
63
|
+
chunking_strategy: this.chunkingStrategy && {
|
|
64
|
+
type: this.chunkingStrategy,
|
|
65
|
+
static: this.chunkingStrategy === "static"
|
|
66
|
+
? {
|
|
67
|
+
max_chunk_size_tokens: this.maxChunkSizeTokens,
|
|
68
|
+
chunk_overlap_tokens: this.chunkOverlapTokens,
|
|
69
|
+
}
|
|
70
|
+
: undefined,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
$.export("$summary", `Successfully created vector store file with ID: ${response.id}`);
|
|
75
|
+
return response;
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-delete-file",
|
|
5
5
|
name: "Delete File",
|
|
6
6
|
description: "Deletes a specified file from OpenAI. [See the documentation](https://platform.openai.com/docs/api-reference/files/delete)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.11",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import openai from "../../openai.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "openai-delete-vector-store",
|
|
5
|
+
name: "Delete Vector Store",
|
|
6
|
+
description: "Delete a vector store. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores/delete)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
openai,
|
|
11
|
+
vectorStoreId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
openai,
|
|
14
|
+
"vectorStoreId",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
async run({ $ }) {
|
|
19
|
+
const response = await this.openai.deleteVectorStore({
|
|
20
|
+
$,
|
|
21
|
+
vectorStoreId: this.vectorStoreId,
|
|
22
|
+
});
|
|
23
|
+
$.export("$summary", `Successfully deleted vector store with ID: ${this.vectorStoreId}`);
|
|
24
|
+
return response;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import openai from "../../openai.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "openai-delete-vector-store-file",
|
|
5
|
+
name: "Delete Vector Store File",
|
|
6
|
+
description: "Deletes a vector store file. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores-files/deleteFile)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
openai,
|
|
11
|
+
vectorStoreId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
openai,
|
|
14
|
+
"vectorStoreId",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
vectorStoreFileId: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
openai,
|
|
20
|
+
"vectorStoreFileId",
|
|
21
|
+
(c) => ({
|
|
22
|
+
vectorStoreId: c.vectorStoreId,
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
async run({ $ }) {
|
|
28
|
+
const response = await this.openai.deleteVectorStoreFile({
|
|
29
|
+
$,
|
|
30
|
+
vectorStoreId: this.vectorStoreId,
|
|
31
|
+
vectorStoreFileId: this.vectorStoreFileId,
|
|
32
|
+
});
|
|
33
|
+
$.export("$summary", `Successfully deleted vector store file with ID: ${this.vectorStoreFileId}`);
|
|
34
|
+
return response;
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-list-files",
|
|
5
5
|
name: "List Files",
|
|
6
6
|
description: "Returns a list of files that belong to the user's organization. [See the documentation](https://platform.openai.com/docs/api-reference/files/list)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.11",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-list-messages",
|
|
5
5
|
name: "List Messages (Assistants)",
|
|
6
6
|
description: "Lists the messages for a given thread. [See the documentation](https://platform.openai.com/docs/api-reference/messages/listMessages)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.12",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-list-run-steps",
|
|
5
5
|
name: "List Run Steps (Assistants)",
|
|
6
6
|
description: "Returns a list of run steps belonging to a run. [See the documentation](https://platform.openai.com/docs/api-reference/runs/list-run-steps)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.11",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-list-runs",
|
|
5
5
|
name: "List Runs (Assistants)",
|
|
6
6
|
description: "Returns a list of runs belonging to a thread. [See the documentation](https://platform.openai.com/docs/api-reference/runs/list)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.12",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import openai from "../../openai.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "openai-list-vector-store-files",
|
|
5
|
+
name: "List Vector Store Files",
|
|
6
|
+
description: "Returns a list of vector store file. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
openai,
|
|
11
|
+
vectorStoreId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
openai,
|
|
14
|
+
"vectorStoreId",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
limit: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
openai,
|
|
20
|
+
"limit",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
order: {
|
|
24
|
+
propDefinition: [
|
|
25
|
+
openai,
|
|
26
|
+
"order",
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
async run({ $ }) {
|
|
31
|
+
const response = this.openai.paginate({
|
|
32
|
+
resourceFn: this.openai.listVectorStoreFiles,
|
|
33
|
+
args: {
|
|
34
|
+
$,
|
|
35
|
+
vectorStoreId: this.vectorStoreId,
|
|
36
|
+
params: {
|
|
37
|
+
order: this.order,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
max: this.limit,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const vectorStoreFiles = [];
|
|
44
|
+
for await (const vectorStoreFile of response) {
|
|
45
|
+
vectorStoreFiles.push(vectorStoreFile);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
$.export("$summary", `Successfully retrieved ${vectorStoreFiles.length} vector store file${vectorStoreFiles.length === 1
|
|
49
|
+
? ""
|
|
50
|
+
: "s"}`);
|
|
51
|
+
return vectorStoreFiles;
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import openai from "../../openai.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "openai-list-vector-stores",
|
|
5
|
+
name: "List Vector Stores",
|
|
6
|
+
description: "Returns a list of vector stores. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores/list)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
openai,
|
|
11
|
+
limit: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
openai,
|
|
14
|
+
"limit",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
order: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
openai,
|
|
20
|
+
"order",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const response = this.openai.paginate({
|
|
26
|
+
resourceFn: this.openai.listVectorStores,
|
|
27
|
+
args: {
|
|
28
|
+
$,
|
|
29
|
+
params: {
|
|
30
|
+
order: this.order,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
max: this.limit,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const vectorStores = [];
|
|
37
|
+
for await (const vectorStore of response) {
|
|
38
|
+
vectorStores.push(vectorStore);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
$.export("$summary", `Successfully retrieved ${vectorStores.length} vector store${vectorStores.length === 1
|
|
42
|
+
? ""
|
|
43
|
+
: "s"}`);
|
|
44
|
+
return vectorStores;
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "openai-modify-assistant",
|
|
7
7
|
name: "Modify an Assistant",
|
|
8
8
|
description: "Modifies an existing OpenAI assistant. [See the documentation](https://platform.openai.com/docs/api-reference/assistants/modifyAssistant)",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.8",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
openai,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-retrieve-file",
|
|
5
5
|
name: "Retrieve File",
|
|
6
6
|
description: "Retrieves a specific file from OpenAI. [See the documentation](https://platform.openai.com/docs/api-reference/files/retrieve)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.11",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "openai-retrieve-file-content",
|
|
6
6
|
name: "Retrieve File Content",
|
|
7
7
|
description: "Retrieves the contents of the specified file. [See the documentation](https://platform.openai.com/docs/api-reference/files/retrieve-content)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.11",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
openai,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-retrieve-run",
|
|
5
5
|
name: "Retrieve Run (Assistants)",
|
|
6
6
|
description: "Retrieves a specific run within a thread. [See the documentation](https://platform.openai.com/docs/api-reference/runs/getRun)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.11",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-retrieve-run-step",
|
|
5
5
|
name: "Retrieve Run Step (Assistants)",
|
|
6
6
|
description: "Retrieve a specific run step in a thread. [See the documentation](https://platform.openai.com/docs/api-reference/runs/getRunStep)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.11",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import openai from "../../openai.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "openai-retrieve-vector-store",
|
|
5
|
+
name: "Retrieve Vector Store",
|
|
6
|
+
description: "Retrieve a vector store. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores/retrieve)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
openai,
|
|
11
|
+
vectorStoreId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
openai,
|
|
14
|
+
"vectorStoreId",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
async run({ $ }) {
|
|
19
|
+
const response = await this.openai.getVectorStore({
|
|
20
|
+
$,
|
|
21
|
+
vectorStoreId: this.vectorStoreId,
|
|
22
|
+
});
|
|
23
|
+
$.export("$summary", `Successfully retrieved vector store with ID: ${this.vectorStoreId}`);
|
|
24
|
+
return response;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import openai from "../../openai.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "openai-retrieve-vector-store-file",
|
|
5
|
+
name: "Retrieve Vector Store File",
|
|
6
|
+
description: "Retrieve a vector store file. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores-files/getFile)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
openai,
|
|
11
|
+
vectorStoreId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
openai,
|
|
14
|
+
"vectorStoreId",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
vectorStoreFileId: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
openai,
|
|
20
|
+
"vectorStoreFileId",
|
|
21
|
+
(c) => ({
|
|
22
|
+
vectorStoreId: c.vectorStoreId,
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
async run({ $ }) {
|
|
28
|
+
const response = await this.openai.getVectorStoreFile({
|
|
29
|
+
$,
|
|
30
|
+
vectorStoreId: this.vectorStoreId,
|
|
31
|
+
vectorStoreFileId: this.vectorStoreFileId,
|
|
32
|
+
});
|
|
33
|
+
$.export("$summary", `Successfully retrieved vector store file with ID: ${this.vectorStoreFileId}`);
|
|
34
|
+
return response;
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -4,7 +4,7 @@ import common from "../common/common.mjs";
|
|
|
4
4
|
export default {
|
|
5
5
|
...common,
|
|
6
6
|
name: "Create Completion (Send Prompt)",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.13",
|
|
8
8
|
key: "openai-send-prompt",
|
|
9
9
|
description: "OpenAI recommends using the **Chat** action for the latest `gpt-3.5-turbo` API, since it's faster and 10x cheaper. This action creates a completion for the provided prompt and parameters using the older `/completions` API. [See the documentation](https://beta.openai.com/docs/api-reference/completions/create)",
|
|
10
10
|
type: "action",
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "openai-submit-tool-outputs-to-run",
|
|
6
6
|
name: "Submit Tool Outputs to Run (Assistants)",
|
|
7
7
|
description: "Submits tool outputs to a run that requires action. [See the documentation](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.11",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
openai,
|
|
@@ -4,7 +4,7 @@ import constants from "../../common/constants.mjs";
|
|
|
4
4
|
export default {
|
|
5
5
|
...common,
|
|
6
6
|
name: "Summarize Text",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.2",
|
|
8
8
|
key: "openai-summarize",
|
|
9
9
|
description: "Summarizes text using the Chat API. [See the documentation](https://platform.openai.com/docs/api-reference/chat)",
|
|
10
10
|
type: "action",
|
|
@@ -9,7 +9,7 @@ const langOptions = lang.LANGUAGES.map((l) => ({
|
|
|
9
9
|
export default {
|
|
10
10
|
...common,
|
|
11
11
|
name: "Translate Text (Whisper)",
|
|
12
|
-
version: "0.1.
|
|
12
|
+
version: "0.1.2",
|
|
13
13
|
key: "openai-translate-text",
|
|
14
14
|
description: "Translate text from one language to another using the Chat API. [See the documentation](https://platform.openai.com/docs/api-reference/chat)",
|
|
15
15
|
type: "action",
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "openai-upload-file",
|
|
7
7
|
name: "Upload File",
|
|
8
8
|
description: "Upload a file that can be used across various endpoints/features. The size of individual files can be a maximum of 512mb. [See the documentation](https://platform.openai.com/docs/api-reference/files/create)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.14",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
openai,
|
package/openai.app.mjs
CHANGED
|
@@ -67,6 +67,58 @@ export default {
|
|
|
67
67
|
};
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
|
+
vectorStoreId: {
|
|
71
|
+
type: "string",
|
|
72
|
+
label: "Vector Store ID",
|
|
73
|
+
description: "The identifier of a vector store",
|
|
74
|
+
async options({ prevContext }) {
|
|
75
|
+
const params = prevContext?.after
|
|
76
|
+
? {
|
|
77
|
+
after: prevContext.after,
|
|
78
|
+
}
|
|
79
|
+
: {};
|
|
80
|
+
const {
|
|
81
|
+
data: vectorStores, last_id: after,
|
|
82
|
+
} = await this.listVectorStores({
|
|
83
|
+
params,
|
|
84
|
+
});
|
|
85
|
+
return {
|
|
86
|
+
options: vectorStores.map((vectorStore) => ({
|
|
87
|
+
label: vectorStore.name || vectorStore.id,
|
|
88
|
+
value: vectorStore.id,
|
|
89
|
+
})),
|
|
90
|
+
context: {
|
|
91
|
+
after,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
vectorStoreFileId: {
|
|
97
|
+
type: "string",
|
|
98
|
+
label: "Vector Store File ID",
|
|
99
|
+
description: "The identifier of a vector store file",
|
|
100
|
+
async options({
|
|
101
|
+
vectorStoreId, prevContext,
|
|
102
|
+
}) {
|
|
103
|
+
const params = prevContext?.after
|
|
104
|
+
? {
|
|
105
|
+
after: prevContext.after,
|
|
106
|
+
}
|
|
107
|
+
: {};
|
|
108
|
+
const {
|
|
109
|
+
data: vectorStoreFiles, last_id: after,
|
|
110
|
+
} = await this.listVectorStoreFiles({
|
|
111
|
+
vectorStoreId,
|
|
112
|
+
params,
|
|
113
|
+
});
|
|
114
|
+
return {
|
|
115
|
+
options: vectorStoreFiles.map((vectorStoreFile) => vectorStoreFile.id),
|
|
116
|
+
context: {
|
|
117
|
+
after,
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
},
|
|
70
122
|
name: {
|
|
71
123
|
type: "string",
|
|
72
124
|
label: "Name",
|
|
@@ -620,6 +672,15 @@ export default {
|
|
|
620
672
|
...args,
|
|
621
673
|
});
|
|
622
674
|
},
|
|
675
|
+
getVectorStore({
|
|
676
|
+
vectorStoreId, ...args
|
|
677
|
+
}) {
|
|
678
|
+
return this._makeRequest({
|
|
679
|
+
path: `/vector_stores/${vectorStoreId}`,
|
|
680
|
+
headers: this._betaHeaders("v2"),
|
|
681
|
+
...args,
|
|
682
|
+
});
|
|
683
|
+
},
|
|
623
684
|
listVectorStores(args = {}) {
|
|
624
685
|
return this._makeRequest({
|
|
625
686
|
path: "/vector_stores",
|
|
@@ -627,6 +688,62 @@ export default {
|
|
|
627
688
|
...args,
|
|
628
689
|
});
|
|
629
690
|
},
|
|
691
|
+
createVectorStore(args = {}) {
|
|
692
|
+
return this._makeRequest({
|
|
693
|
+
method: "POST",
|
|
694
|
+
path: "/vector_stores",
|
|
695
|
+
headers: this._betaHeaders("v2"),
|
|
696
|
+
...args,
|
|
697
|
+
});
|
|
698
|
+
},
|
|
699
|
+
deleteVectorStore({
|
|
700
|
+
vectorStoreId, ...args
|
|
701
|
+
}) {
|
|
702
|
+
return this._makeRequest({
|
|
703
|
+
method: "DELETE",
|
|
704
|
+
path: `/vector_stores/${vectorStoreId}`,
|
|
705
|
+
headers: this._betaHeaders("v2"),
|
|
706
|
+
...args,
|
|
707
|
+
});
|
|
708
|
+
},
|
|
709
|
+
getVectorStoreFile({
|
|
710
|
+
vectorStoreId, vectorStoreFileId, ...args
|
|
711
|
+
}) {
|
|
712
|
+
return this._makeRequest({
|
|
713
|
+
path: `/vector_stores/${vectorStoreId}/files/${vectorStoreFileId}`,
|
|
714
|
+
headers: this._betaHeaders("v2"),
|
|
715
|
+
...args,
|
|
716
|
+
});
|
|
717
|
+
},
|
|
718
|
+
listVectorStoreFiles({
|
|
719
|
+
vectorStoreId, ...args
|
|
720
|
+
}) {
|
|
721
|
+
return this._makeRequest({
|
|
722
|
+
path: `/vector_stores/${vectorStoreId}/files`,
|
|
723
|
+
headers: this._betaHeaders("v2"),
|
|
724
|
+
...args,
|
|
725
|
+
});
|
|
726
|
+
},
|
|
727
|
+
createVectorStoreFile({
|
|
728
|
+
vectorStoreId, ...args
|
|
729
|
+
}) {
|
|
730
|
+
return this._makeRequest({
|
|
731
|
+
method: "POST",
|
|
732
|
+
path: `/vector_stores/${vectorStoreId}/files`,
|
|
733
|
+
headers: this._betaHeaders("v2"),
|
|
734
|
+
...args,
|
|
735
|
+
});
|
|
736
|
+
},
|
|
737
|
+
deleteVectorStoreFile({
|
|
738
|
+
vectorStoreId, vectorStoreFileId, ...args
|
|
739
|
+
}) {
|
|
740
|
+
return this._makeRequest({
|
|
741
|
+
method: "DELETE",
|
|
742
|
+
path: `/vector_stores/${vectorStoreId}/files/${vectorStoreFileId}`,
|
|
743
|
+
headers: this._betaHeaders("v2"),
|
|
744
|
+
...args,
|
|
745
|
+
});
|
|
746
|
+
},
|
|
630
747
|
createModeration(args = {}) {
|
|
631
748
|
return this._makeRequest({
|
|
632
749
|
method: "POST",
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "openai-new-batch-completed",
|
|
7
7
|
name: "New Batch Completed",
|
|
8
8
|
description: "Emit new event when a new batch is completed in OpenAI. [See the documentation](https://platform.openai.com/docs/api-reference/batch/list)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.5",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
methods: {
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "openai-new-file-created",
|
|
7
7
|
name: "New File Created",
|
|
8
8
|
description: "Emit new event when a new file is created in OpenAI. [See the documentation](https://platform.openai.com/docs/api-reference/files/list)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.10",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "openai-new-fine-tuning-job-created",
|
|
7
7
|
name: "New Fine Tuning Job Created",
|
|
8
8
|
description: "Emit new event when a new fine-tuning job is created in OpenAI. [See the documentation](https://platform.openai.com/docs/api-reference/fine-tuning/list)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.10",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
methods: {
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "openai-new-run-state-changed",
|
|
7
7
|
name: "New Run State Changed",
|
|
8
8
|
description: "Emit new event every time a run changes its status. [See the documentation](https://platform.openai.com/docs/api-reference/runs/listRuns)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.6",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|