@pipedream/openai 0.4.0 → 0.4.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/actions/cancel-run/cancel-run.mjs +1 -1
- package/actions/chat/chat.mjs +1 -1
- package/actions/classify-items-into-categories/classify-items-into-categories.mjs +1 -1
- package/actions/common/common.mjs +9 -3
- package/actions/create-assistant/create-assistant.mjs +1 -1
- package/actions/create-embeddings/create-embeddings.mjs +2 -2
- 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-message/create-message.mjs +1 -1
- package/actions/create-run/create-run.mjs +1 -1
- package/actions/create-speech/create-speech.mjs +2 -2
- package/actions/create-thread/create-thread.mjs +1 -1
- package/actions/create-thread-and-run/create-thread-and-run.mjs +1 -1
- package/actions/create-transcription/create-transcription.mjs +10 -9
- package/actions/delete-file/delete-file.mjs +1 -1
- 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/modify-assistant/modify-assistant.mjs +1 -1
- package/actions/modify-message/modify-message.mjs +1 -1
- package/actions/modify-run/modify-run.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/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 +2 -2
- package/package.json +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
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-cancel-run",
|
|
5
5
|
name: "Cancel Run",
|
|
6
6
|
description: "Cancels a run that is in progress. [See the documentation](https://platform.openai.com/docs/api-reference)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
package/actions/chat/chat.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import common from "../common/common.mjs";
|
|
|
4
4
|
export default {
|
|
5
5
|
...common,
|
|
6
6
|
name: "Chat",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.7",
|
|
8
8
|
key: "openai-chat",
|
|
9
9
|
description: "The Chat API, using the `gpt-3.5-turbo` or `gpt-4` model. [See docs here](https://platform.openai.com/docs/api-reference/chat)",
|
|
10
10
|
type: "action",
|
|
@@ -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.0.
|
|
6
|
+
version: "0.0.8",
|
|
7
7
|
key: "openai-classify-items-into-categories",
|
|
8
8
|
description: "Classify items into specific categories using the Chat API",
|
|
9
9
|
type: "action",
|
|
@@ -146,11 +146,17 @@ export default {
|
|
|
146
146
|
"content": this._getUserMessageContent(),
|
|
147
147
|
});
|
|
148
148
|
|
|
149
|
+
const responseFormat = {};
|
|
150
|
+
|
|
151
|
+
if (this.modelId != "gpt-4-vision-preview") {
|
|
152
|
+
responseFormat["response_format"] = {
|
|
153
|
+
type: this.responseFormat,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
149
157
|
return {
|
|
150
158
|
...this._getCommonArgs(),
|
|
151
|
-
|
|
152
|
-
type: this.responseFormat,
|
|
153
|
-
},
|
|
159
|
+
...responseFormat,
|
|
154
160
|
messages,
|
|
155
161
|
};
|
|
156
162
|
},
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "openai-create-assistant",
|
|
6
6
|
name: "Create Assistant",
|
|
7
7
|
description: "Creates an assistant with a model and instructions. [See the docs here](https://platform.openai.com/docs/api-reference/assistants/createAssistant)",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
openai,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
1
2
|
import openai from "../../openai.app.mjs";
|
|
2
3
|
import common from "../common/common.mjs";
|
|
3
|
-
import { ConfigurationError } from "@pipedream/platform";
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
name: "Create Embeddings",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.6",
|
|
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 docs here](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.3",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -2,7 +2,7 @@ import openai from "../../openai.app.mjs";
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
name: "Create Image",
|
|
5
|
-
version: "0.1.
|
|
5
|
+
version: "0.1.10",
|
|
6
6
|
key: "openai-create-image",
|
|
7
7
|
description: "Creates an image given a prompt. returns a URL to the image. [See docs here](https://platform.openai.com/docs/api-reference/images)",
|
|
8
8
|
type: "action",
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-create-message",
|
|
5
5
|
name: "Create Message",
|
|
6
6
|
description: "Create a message in a thread. [See the documentation](https://platform.openai.com/docs/api-reference)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "openai-create-run",
|
|
6
6
|
name: "Create Run",
|
|
7
7
|
description: "Creates a run given a thread ID and assistant ID. [See the documentation](https://platform.openai.com/docs/api-reference/runs/create)",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
openai,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import openai from "../../openai.app.mjs";
|
|
2
1
|
import fs from "fs";
|
|
2
|
+
import openai from "../../openai.app.mjs";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "openai-create-speech",
|
|
6
6
|
name: "Create Speech",
|
|
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.3",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
openai,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-create-thread",
|
|
5
5
|
name: "Create Thread",
|
|
6
6
|
description: "Creates a thread with optional messages and metadata. [See the documentation](https://platform.openai.com/docs/api-reference/threads/createThread)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.3",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "openai-create-thread-and-run",
|
|
6
6
|
name: "Create Thread and Run",
|
|
7
7
|
description: "Create a thread and run it in one request using the specified assistant ID and optional parameters. [See the documentation](https://platform.openai.com/docs/api-reference)",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
openai,
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
+
import ffmpegInstaller from "@ffmpeg-installer/ffmpeg";
|
|
2
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
1
3
|
import axios from "axios";
|
|
2
4
|
import Bottleneck from "bottleneck";
|
|
5
|
+
import { exec } from "child_process";
|
|
6
|
+
import FormData from "form-data";
|
|
3
7
|
import fs from "fs";
|
|
4
8
|
import {
|
|
5
|
-
|
|
9
|
+
extname,
|
|
10
|
+
join,
|
|
6
11
|
} from "path";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
12
|
+
import stream from "stream";
|
|
13
|
+
import { promisify } from "util";
|
|
14
|
+
import openai from "../../openai.app.mjs";
|
|
9
15
|
import common from "../common/common.mjs";
|
|
10
16
|
import constants from "../common/constants.mjs";
|
|
11
17
|
import lang from "../common/lang.mjs";
|
|
12
|
-
import openai from "../../openai.app.mjs";
|
|
13
|
-
import { promisify } from "util";
|
|
14
|
-
import stream from "stream";
|
|
15
|
-
import { exec } from "child_process";
|
|
16
|
-
import ffmpegInstaller from "@ffmpeg-installer/ffmpeg";
|
|
17
18
|
|
|
18
19
|
const COMMON_AUDIO_FORMATS_TEXT = "Your audio file must be in one of these formats: mp3, mp4, mpeg, mpga, m4a, wav, or webm.";
|
|
19
20
|
|
|
@@ -22,7 +23,7 @@ const pipelineAsync = promisify(stream.pipeline);
|
|
|
22
23
|
|
|
23
24
|
export default {
|
|
24
25
|
name: "Create Transcription",
|
|
25
|
-
version: "0.1.
|
|
26
|
+
version: "0.1.4",
|
|
26
27
|
key: "openai-create-transcription",
|
|
27
28
|
description: "Transcribes audio into the input language. [See docs here](https://platform.openai.com/docs/api-reference/audio/create).",
|
|
28
29
|
type: "action",
|
|
@@ -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.4",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -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.4",
|
|
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",
|
|
6
6
|
description: "Lists the messages for a given thread. [See the documentation](https://platform.openai.com/docs/api-reference)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.5",
|
|
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",
|
|
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.4",
|
|
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",
|
|
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.5",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "openai-modify-assistant",
|
|
6
6
|
name: "Modify an Assistant",
|
|
7
7
|
description: "Modifies an existing OpenAI assistant. [See the documentation](https://platform.openai.com/docs/api-reference/assistants/modifyAssistant)",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
openai,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-modify-message",
|
|
5
5
|
name: "Modify Message",
|
|
6
6
|
description: "Modifies an existing message in a thread. [See the documentation](https://platform.openai.com/docs/api-reference)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.5",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
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.4",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-retrieve-file-content",
|
|
5
5
|
name: "Retrieve File Content",
|
|
6
6
|
description: "Retrieves the contents of the specified file. [See the documentation](https://platform.openai.com/docs/api-reference/files/retrieve-content)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-retrieve-run",
|
|
5
5
|
name: "Retrieve Run",
|
|
6
6
|
description: "Retrieves a specific run within a thread. [See the documentation](https://platform.openai.com/docs/api-reference)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
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",
|
|
6
6
|
description: "Retrieve a specific run step in a thread. [See the documentation](https://platform.openai.com/docs/api-reference)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -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.5",
|
|
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 docs here](https://beta.openai.com/docs/api-reference/completions/create)",
|
|
10
10
|
type: "action",
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "openai-submit-tool-outputs-to-run",
|
|
5
5
|
name: "Submit Tool Outputs to Run",
|
|
6
6
|
description: "Submits tool outputs to a run that requires action. [See the documentation](https://platform.openai.com/docs/api-reference)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
openai,
|
|
@@ -9,7 +9,7 @@ const langOptions = lang.LANGUAGES.map((l) => ({
|
|
|
9
9
|
export default {
|
|
10
10
|
...common,
|
|
11
11
|
name: "Translate Text",
|
|
12
|
-
version: "0.0.
|
|
12
|
+
version: "0.0.10",
|
|
13
13
|
key: "openai-translate-text",
|
|
14
14
|
description: "Translate text from one language to another using the Chat API",
|
|
15
15
|
type: "action",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import openai from "../../openai.app.mjs";
|
|
2
1
|
import FormData from "form-data";
|
|
3
2
|
import fs from "fs";
|
|
3
|
+
import openai from "../../openai.app.mjs";
|
|
4
4
|
|
|
5
5
|
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.7",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
openai,
|
package/package.json
CHANGED
|
@@ -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.3",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "openai-new-fine-tuning-job-created",
|
|
6
6
|
name: "New Fine Tuning Job Created",
|
|
7
7
|
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)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.3",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
methods: {
|