@pipedream/openai 1.0.0 → 1.0.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/chat/chat.mjs +1 -1
- package/actions/chat-using-file-search/chat-using-file-search.mjs +1 -1
- package/actions/chat-using-functions/chat-using-functions.mjs +1 -1
- package/actions/chat-using-web-search/chat-using-web-search.mjs +1 -1
- package/actions/classify-items-into-categories/classify-items-into-categories.mjs +1 -1
- package/actions/common/common.mjs +7 -2
- package/actions/create-embeddings/create-embeddings.mjs +1 -1
- package/actions/send-prompt/send-prompt.mjs +1 -1
- package/actions/summarize/summarize.mjs +1 -1
- package/actions/translate-text/translate-text.mjs +1 -1
- package/package.json +1 -1
package/actions/chat/chat.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import constants from "../../common/constants.mjs";
|
|
|
5
5
|
export default {
|
|
6
6
|
...common,
|
|
7
7
|
name: "Chat",
|
|
8
|
-
version: "0.3.
|
|
8
|
+
version: "0.3.1",
|
|
9
9
|
key: "openai-chat",
|
|
10
10
|
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)",
|
|
11
11
|
type: "action",
|
|
@@ -5,7 +5,7 @@ import constants from "../../common/constants.mjs";
|
|
|
5
5
|
export default {
|
|
6
6
|
...common,
|
|
7
7
|
name: "Chat using File Search",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.5",
|
|
9
9
|
key: "openai-chat-using-file-search",
|
|
10
10
|
description: "Chat with your files knowledge base (vector stores). [See the documentation](https://platform.openai.com/docs/guides/tools-file-search)",
|
|
11
11
|
type: "action",
|
|
@@ -5,7 +5,7 @@ import constants from "../../common/constants.mjs";
|
|
|
5
5
|
export default {
|
|
6
6
|
...common,
|
|
7
7
|
name: "Chat using Functions",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.6",
|
|
9
9
|
key: "openai-chat-using-functions",
|
|
10
10
|
description: "Chat with your models and allow them to invoke functions. Optionally, you can build and invoke workflows as functions. [See the documentation](https://platform.openai.com/docs/guides/function-calling)",
|
|
11
11
|
type: "action",
|
|
@@ -5,7 +5,7 @@ import constants from "../../common/constants.mjs";
|
|
|
5
5
|
export default {
|
|
6
6
|
...common,
|
|
7
7
|
name: "Chat using Web Search",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.5",
|
|
9
9
|
key: "openai-chat-using-web-search",
|
|
10
10
|
description: "Chat using the web search tool. [See the documentation](https://platform.openai.com/docs/guides/tools-web-search)",
|
|
11
11
|
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.1.
|
|
6
|
+
version: "0.1.7",
|
|
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",
|
|
@@ -59,10 +59,9 @@ export default {
|
|
|
59
59
|
},
|
|
60
60
|
methods: {
|
|
61
61
|
_getCommonArgs() {
|
|
62
|
-
|
|
62
|
+
const args = {
|
|
63
63
|
model: this.modelId,
|
|
64
64
|
prompt: this.prompt,
|
|
65
|
-
max_tokens: this.maxTokens,
|
|
66
65
|
temperature: this.temperature
|
|
67
66
|
? +this.temperature
|
|
68
67
|
: this.temperature,
|
|
@@ -80,6 +79,12 @@ export default {
|
|
|
80
79
|
best_of: this.bestOf,
|
|
81
80
|
user: this.user,
|
|
82
81
|
};
|
|
82
|
+
if (this.modelId.startsWith("o1") || this.modelId.startsWith("o3") || this.modelId.startsWith("o4")) {
|
|
83
|
+
args.max_completion_tokens = this.maxTokens;
|
|
84
|
+
} else {
|
|
85
|
+
args.max_tokens = this.maxTokens;
|
|
86
|
+
}
|
|
87
|
+
return args;
|
|
83
88
|
},
|
|
84
89
|
async _getUserMessageContent() {
|
|
85
90
|
let content = [];
|
|
@@ -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.19",
|
|
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 @@ 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.18",
|
|
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",
|
|
@@ -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.7",
|
|
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.7",
|
|
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",
|