From 7ad0ed7f545fc9c138f4c51234686d99ec39975f Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Wed, 25 Jun 2025 12:21:55 -0400 Subject: [PATCH 1/3] use max_completion_tokens for o1, o2, & o3 models --- components/openai/actions/chat/chat.mjs | 2 +- components/openai/actions/common/common.mjs | 9 +++++++-- components/openai/package.json | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/components/openai/actions/chat/chat.mjs b/components/openai/actions/chat/chat.mjs index 872646e188989..1e8ce7a22b575 100644 --- a/components/openai/actions/chat/chat.mjs +++ b/components/openai/actions/chat/chat.mjs @@ -5,7 +5,7 @@ import constants from "../../common/constants.mjs"; export default { ...common, name: "Chat", - version: "0.3.0", + version: "0.3.1", key: "openai-chat", 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)", type: "action", diff --git a/components/openai/actions/common/common.mjs b/components/openai/actions/common/common.mjs index c8a81c2ac5997..2244b2e05fbd7 100644 --- a/components/openai/actions/common/common.mjs +++ b/components/openai/actions/common/common.mjs @@ -59,10 +59,9 @@ export default { }, methods: { _getCommonArgs() { - return { + const args = { model: this.modelId, prompt: this.prompt, - max_tokens: this.maxTokens, temperature: this.temperature ? +this.temperature : this.temperature, @@ -80,6 +79,12 @@ export default { best_of: this.bestOf, user: this.user, }; + if (this.modelId.startsWith("o1") || this.modelId.startsWith("o3") || this.modelId.startsWith("o4")) { + args.max_completion_tokens = this.maxTokens; + } else { + args.max_tokens = this.maxTokens; + } + return args; }, async _getUserMessageContent() { let content = []; diff --git a/components/openai/package.json b/components/openai/package.json index 2f001194200d3..9c56b68f9e48a 100644 --- a/components/openai/package.json +++ b/components/openai/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/openai", - "version": "1.0.0", + "version": "1.0.1", "description": "Pipedream OpenAI Components", "main": "openai.app.mjs", "keywords": [ From a09023f1f98fa51a9e13822fb39ed3e974ac1281 Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Wed, 25 Jun 2025 12:22:33 -0400 Subject: [PATCH 2/3] pnpm-lock.yaml --- pnpm-lock.yaml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 30a05bb898595..3735cba00fd6c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5396,8 +5396,7 @@ importers: components/godial: {} - components/goformz: - specifiers: {} + components/goformz: {} components/gohighlevel: dependencies: @@ -7288,8 +7287,7 @@ importers: specifier: ^3.0.0 version: 3.0.3 - components/lark: - specifiers: {} + components/lark: {} components/lastpass: dependencies: @@ -8494,8 +8492,7 @@ importers: components/mollie: {} - components/momentum_ams: - specifiers: {} + components/momentum_ams: {} components/monday: dependencies: @@ -9478,8 +9475,7 @@ importers: components/order_sender: {} - components/orderspace: - specifiers: {} + components/orderspace: {} components/originality_ai: dependencies: @@ -11556,8 +11552,7 @@ importers: components/ryver: {} - components/sage_accounting: - specifiers: {} + components/sage_accounting: {} components/sage_intacct: {} @@ -12974,8 +12969,7 @@ importers: components/stealthseminar: {} - components/stiply: - specifiers: {} + components/stiply: {} components/storeganise: dependencies: From fc2f65559e3adf193d1a92487b5f0466309aaf5d Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Wed, 25 Jun 2025 12:25:24 -0400 Subject: [PATCH 3/3] versions --- .../actions/chat-using-file-search/chat-using-file-search.mjs | 2 +- .../actions/chat-using-functions/chat-using-functions.mjs | 2 +- .../actions/chat-using-web-search/chat-using-web-search.mjs | 2 +- .../classify-items-into-categories.mjs | 2 +- .../openai/actions/create-embeddings/create-embeddings.mjs | 2 +- components/openai/actions/send-prompt/send-prompt.mjs | 2 +- components/openai/actions/summarize/summarize.mjs | 2 +- components/openai/actions/translate-text/translate-text.mjs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/openai/actions/chat-using-file-search/chat-using-file-search.mjs b/components/openai/actions/chat-using-file-search/chat-using-file-search.mjs index a646b09f4bc46..6e2951b359ead 100644 --- a/components/openai/actions/chat-using-file-search/chat-using-file-search.mjs +++ b/components/openai/actions/chat-using-file-search/chat-using-file-search.mjs @@ -5,7 +5,7 @@ import constants from "../../common/constants.mjs"; export default { ...common, name: "Chat using File Search", - version: "0.0.4", + version: "0.0.5", key: "openai-chat-using-file-search", description: "Chat with your files knowledge base (vector stores). [See the documentation](https://platform.openai.com/docs/guides/tools-file-search)", type: "action", diff --git a/components/openai/actions/chat-using-functions/chat-using-functions.mjs b/components/openai/actions/chat-using-functions/chat-using-functions.mjs index e61bc3105837e..c667bf03780db 100644 --- a/components/openai/actions/chat-using-functions/chat-using-functions.mjs +++ b/components/openai/actions/chat-using-functions/chat-using-functions.mjs @@ -5,7 +5,7 @@ import constants from "../../common/constants.mjs"; export default { ...common, name: "Chat using Functions", - version: "0.0.5", + version: "0.0.6", key: "openai-chat-using-functions", 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)", type: "action", diff --git a/components/openai/actions/chat-using-web-search/chat-using-web-search.mjs b/components/openai/actions/chat-using-web-search/chat-using-web-search.mjs index a9dbb509fc4de..eff989903678c 100644 --- a/components/openai/actions/chat-using-web-search/chat-using-web-search.mjs +++ b/components/openai/actions/chat-using-web-search/chat-using-web-search.mjs @@ -5,7 +5,7 @@ import constants from "../../common/constants.mjs"; export default { ...common, name: "Chat using Web Search", - version: "0.0.4", + version: "0.0.5", key: "openai-chat-using-web-search", description: "Chat using the web search tool. [See the documentation](https://platform.openai.com/docs/guides/tools-web-search)", type: "action", diff --git a/components/openai/actions/classify-items-into-categories/classify-items-into-categories.mjs b/components/openai/actions/classify-items-into-categories/classify-items-into-categories.mjs index 2b70783abfa1b..34826e091b76e 100644 --- a/components/openai/actions/classify-items-into-categories/classify-items-into-categories.mjs +++ b/components/openai/actions/classify-items-into-categories/classify-items-into-categories.mjs @@ -3,7 +3,7 @@ import common from "../common/common-helper.mjs"; export default { ...common, name: "Classify Items into Categories", - version: "0.1.6", + version: "0.1.7", key: "openai-classify-items-into-categories", description: "Classify items into specific categories using the Chat API. [See the documentation](https://platform.openai.com/docs/api-reference/chat)", type: "action", diff --git a/components/openai/actions/create-embeddings/create-embeddings.mjs b/components/openai/actions/create-embeddings/create-embeddings.mjs index 4f42319046a6f..d620786cc696d 100644 --- a/components/openai/actions/create-embeddings/create-embeddings.mjs +++ b/components/openai/actions/create-embeddings/create-embeddings.mjs @@ -4,7 +4,7 @@ import common from "../common/common.mjs"; export default { name: "Create Embeddings", - version: "0.0.18", + version: "0.0.19", key: "openai-create-embeddings", 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)", type: "action", diff --git a/components/openai/actions/send-prompt/send-prompt.mjs b/components/openai/actions/send-prompt/send-prompt.mjs index f6be198da306b..77cdb8469dd43 100644 --- a/components/openai/actions/send-prompt/send-prompt.mjs +++ b/components/openai/actions/send-prompt/send-prompt.mjs @@ -4,7 +4,7 @@ import common from "../common/common.mjs"; export default { ...common, name: "Create Completion (Send Prompt)", - version: "0.1.17", + version: "0.1.18", key: "openai-send-prompt", 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)", type: "action", diff --git a/components/openai/actions/summarize/summarize.mjs b/components/openai/actions/summarize/summarize.mjs index b9a407330d43b..49b5d11ac3989 100644 --- a/components/openai/actions/summarize/summarize.mjs +++ b/components/openai/actions/summarize/summarize.mjs @@ -4,7 +4,7 @@ import constants from "../../common/constants.mjs"; export default { ...common, name: "Summarize Text", - version: "0.1.6", + version: "0.1.7", key: "openai-summarize", description: "Summarizes text using the Chat API. [See the documentation](https://platform.openai.com/docs/api-reference/chat)", type: "action", diff --git a/components/openai/actions/translate-text/translate-text.mjs b/components/openai/actions/translate-text/translate-text.mjs index 0dfac35f74db9..ad4491d870fe4 100644 --- a/components/openai/actions/translate-text/translate-text.mjs +++ b/components/openai/actions/translate-text/translate-text.mjs @@ -9,7 +9,7 @@ const langOptions = lang.LANGUAGES.map((l) => ({ export default { ...common, name: "Translate Text (Whisper)", - version: "0.1.6", + version: "0.1.7", key: "openai-translate-text", description: "Translate text from one language to another using the Chat API. [See the documentation](https://platform.openai.com/docs/api-reference/chat)", type: "action",