diff --git a/components/openai/actions/analyze-image-content/analyze-image-content.mjs b/components/openai/actions/analyze-image-content/analyze-image-content.mjs index f656b37f7da1e..8301a65a3ae57 100644 --- a/components/openai/actions/analyze-image-content/analyze-image-content.mjs +++ b/components/openai/actions/analyze-image-content/analyze-image-content.mjs @@ -8,7 +8,7 @@ export default { key: "openai-analyze-image-content", name: "Analyze Image Content", 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)", - version: "0.1.4", + version: "0.1.5", type: "action", props: { openai, diff --git a/components/openai/actions/cancel-run/cancel-run.mjs b/components/openai/actions/cancel-run/cancel-run.mjs index 54050850537d6..7d803eae3fb43 100644 --- a/components/openai/actions/cancel-run/cancel-run.mjs +++ b/components/openai/actions/cancel-run/cancel-run.mjs @@ -4,7 +4,7 @@ export default { key: "openai-cancel-run", name: "Cancel Run (Assistants)", description: "Cancels a run that is in progress. [See the documentation](https://platform.openai.com/docs/api-reference/runs/cancelRun)", - version: "0.0.13", + version: "0.0.14", type: "action", props: { openai, 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 new file mode 100644 index 0000000000000..25f92202a5ca5 --- /dev/null +++ b/components/openai/actions/chat-using-file-search/chat-using-file-search.mjs @@ -0,0 +1,229 @@ +import openai from "../../openai.app.mjs"; +import common from "../common/common.mjs"; +import constants from "../../common/constants.mjs"; + +export default { + ...common, + name: "Chat using File Search", + version: "0.0.1", + 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", + props: { + openai, + alert: { + type: "alert", + alertType: "info", + content: "To use this action, you need to have set up a knowledge base in a vector store and uploaded files to it. [More infomation here](https://platform.openai.com/docs/guides/tools-file-search?lang=javascript#overview).", + }, + modelId: { + propDefinition: [ + openai, + "chatCompletionModelId", + ], + }, + vectorStoreId: { + propDefinition: [ + openai, + "vectorStoreId", + ], + description: "The identifier of a vector store. Currently supports only one vector store at a time", + }, + input: { + type: "string", + label: "Chat Input", + description: "Text, image, or file inputs to the model, used to generate a response", + }, + instructions: { + type: "string", + label: "Instructions", + description: "Inserts a system (or developer) message as the first item in the model's context", + optional: true, + }, + includeSearchResults: { + type: "boolean", + label: "Include Search Results", + description: "Include the search results in the response", + default: false, + optional: true, + }, + maxNumResults: { + type: "integer", + label: "Max Number of Results", + description: "Customize the number of results you want to retrieve from the vector store", + optional: true, + }, + metadataFiltering: { + type: "boolean", + label: "Metadata Filtering", + description: "Configure how the search results are filtered based on file metadata", + optional: true, + reloadProps: true, + }, + previousResponseId: { + type: "string", + label: "Previous Response ID", + description: "The unique ID of the previous response to the model. Use this to create multi-turn conversations", + optional: true, + }, + truncation: { + type: "string", + label: "Truncation", + description: "Specifies the truncation mode for the response if it's larger than the context window size", + optional: true, + default: "auto", + options: [ + "auto", + "disabled", + ], + }, + responseFormat: { + type: "string", + label: "Response Format", + description: "Specify the format that the model must output. \n- **Text**: Returns unstructured text output.\n- **JSON Schema**: Enables you to define a [specific structure for the model's output using a JSON schema](https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses).", + options: [ + "text", + "json_schema", + ], + default: "text", + optional: true, + reloadProps: true, + }, + skipThisStep: { + type: "boolean", + label: "Skip This Step", + description: "Pass in a boolean custom expression to skip this step's execution at runtime", + optional: true, + default: false, + }, + }, + additionalProps() { + const { + modelId, + metadataFiltering, + responseFormat, + } = this; + const props = {}; + + if (this.openai.isReasoningModel(modelId)) { + props.reasoningEffort = { + type: "string", + label: "Reasoning Effort", + description: "Constrains effort on reasoning for reasoning models", + optional: true, + options: [ + "low", + "medium", + "high", + ], + }; + + // aparrently not supported yet as of 12/march/2025 + // props.generateSummary = { + // type: "string", + // label: "Generate Reasoning Summary", + // description: "A summary of the reasoning performed by the model", + // optional: true, + // options: [ + // "concise", + // "detailed", + // ], + // }; + } + + // TODO: make this configuration user-friendly + // https://platform.openai.com/docs/guides/retrieval?attributes-filter-example=region#attribute-filtering + if (metadataFiltering) { + props.filters = { + type: "object", + label: "Filters", + description: "Filter the search results based on file metadata. [See the documentation here](https://platform.openai.com/docs/guides/retrieval#attribute-filtering)", + }; + } + + if (responseFormat === constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value) { + props.jsonSchema = { + type: "string", + label: "JSON Schema", + description: "Define the schema that the model's output must adhere to. [Generate one here](https://platform.openai.com/docs/guides/structured-outputs/supported-schemas).", + }; + } + + return props; + }, + methods: { + ...common.methods, + }, + async run({ $ }) { + if (this.skipThisStep) { + $.export("$summary", "Step execution skipped"); + return; + } + + const data = { + model: this.modelId, + input: this.input, + instructions: this.instructions, + previous_response_id: this.previousResponseId, + truncation: this.truncation, + tools: [ + { + type: "file_search", + vector_store_ids: [ + this.vectorStoreId, + ], + max_num_results: this.maxNumResults, + }, + ], + }; + + if (this.includeSearchResults) { + data.include = [ + "output[*].file_search_call.search_results", + ]; + } + + if (this.filters) { + data.tools[0].filters = this.filters; + } + + if (this.openai.isReasoningModel(this.modelId) && this.reasoningEffort) { + data.reasoning = { + ...data.reasoning, + effort: this.reasoningEffort, + }; + } + + if (this.openai.isReasoningModel(this.modelId) && this.generateSummary) { + data.reasoning = { + ...data.reasoning, + generate_summary: this.generateSummary, + }; + } + + if (this.responseFormat === constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value) { + try { + data.text = { + format: { + type: this.responseFormat, + ...JSON.parse(this.jsonSchema), + }, + }; + } catch (error) { + throw new Error("Invalid JSON format in the provided JSON Schema"); + } + } + + const response = await this.openai.responses({ + $, + data, + }); + + if (response) { + $.export("$summary", `Successfully sent chat with id ${response.id}`); + $.export("chat_responses", response.output); + } + + return response; + }, +}; diff --git a/components/openai/actions/chat-using-functions/chat-using-functions.mjs b/components/openai/actions/chat-using-functions/chat-using-functions.mjs new file mode 100644 index 0000000000000..5a8ee3091f9bc --- /dev/null +++ b/components/openai/actions/chat-using-functions/chat-using-functions.mjs @@ -0,0 +1,255 @@ +import openai from "../../openai.app.mjs"; +import common from "../common/common.mjs"; +import constants from "../../common/constants.mjs"; + +export default { + ...common, + name: "Chat using Functions", + version: "0.0.1", + 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", + props: { + openai, + alert: { + type: "alert", + alertType: "info", + content: "Provide function names and parameters, and the model will either answer the question directly or decide to invoke one of the functions, returning a function call that adheres to your specified schema. Add a custom code step that includes all available functions which can be invoked based on the model's response - [you can even build an entire workflow as a function](https://pipedream.com/docs/workflows/building-workflows/code/nodejs/#invoke-another-workflow)! Once the appropriate function or workflow is executed, continue the overall execution or pass the result back to the model for further analysis. For more details, [see this guide](https://platform.openai.com/docs/guides/function-calling?api-mode=responses#overview).", + }, + modelId: { + propDefinition: [ + openai, + "chatCompletionModelId", + ], + }, + input: { + type: "string", + label: "Chat Input", + description: "Text, image, or file inputs to the model, used to generate a response", + }, + functions: { + type: "string", + label: "Functions", + description: "A valid JSON array of functions using OpenAI's function schema definition. [See guide here](https://platform.openai.com/docs/guides/function-calling?api-mode=responses&example=search-knowledge-base#defining-functions).", + default: +`[ + { + "type": "function", + "name": "your_function_name", + "description": "Details on when and how to use the function", + "strict": true, + "parameters": { + "type": "object", + "properties": { + "property_name": { + "type": "property_type", + "description": "A description for this property" + }, + "another_property_name": { + "type": "property_type", + "description": "A description for this property" + } + }, + "required": [ + "list", + "of", + "required", + "properties", + "for", + "this", + "object" + ], + "additionalProperties": false + } + } +]`, + }, + instructions: { + type: "string", + label: "Instructions", + description: "Inserts a system (or developer) message as the first item in the model's context", + optional: true, + }, + toolChoice: { + type: "string", + label: "Tool Choice", + description: "- **auto**: The model decides whether and how many functions to call.\n- **required**: The model must call one or more functions.\n- **function_name**: Enter a custom expression to force the model to call this specific function.", + optional: true, + default: "auto", + options: [ + "auto", + "required", + ], + }, + parallelToolCalls: { + type: "boolean", + label: "Parallel Function Calling", + description: "Allow or prevent the model to call multiple functions in a single turn", + optional: true, + default: true, + }, + previousResponseId: { + type: "string", + label: "Previous Response ID", + description: "The unique ID of the previous response to the model. Use this to create multi-turn conversations", + optional: true, + }, + truncation: { + type: "string", + label: "Truncation", + description: "Specifies the truncation mode for the response if it's larger than the context window size", + optional: true, + default: "auto", + options: [ + "auto", + "disabled", + ], + }, + responseFormat: { + type: "string", + label: "Response Format", + description: "Specify the format that the model must output. \n- **Text**: Returns unstructured text output.\n- **JSON Schema**: Enables you to define a [specific structure for the model's output using a JSON schema](https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses).", + options: [ + "text", + "json_schema", + ], + default: "text", + optional: true, + reloadProps: true, + }, + skipThisStep: { + type: "boolean", + label: "Skip This Step", + description: "Pass in a boolean custom expression to skip this step's execution at runtime", + optional: true, + default: false, + }, + }, + additionalProps() { + const { + modelId, + responseFormat, + } = this; + const props = {}; + + if (this.openai.isReasoningModel(modelId)) { + props.reasoningEffort = { + type: "string", + label: "Reasoning Effort", + description: "Constrains effort on reasoning for reasoning models", + optional: true, + options: [ + "low", + "medium", + "high", + ], + }; + + // aparrently not supported yet as of 12/march/2025 + // props.generateSummary = { + // type: "string", + // label: "Generate Reasoning Summary", + // description: "A summary of the reasoning performed by the model", + // optional: true, + // options: [ + // "concise", + // "detailed", + // ], + // }; + } + + if (responseFormat === constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value) { + props.jsonSchema = { + type: "string", + label: "JSON Schema", + description: "Define the schema that the model's output must adhere to. [Generate one here](https://platform.openai.com/docs/guides/structured-outputs/supported-schemas).", + }; + } + + return props; + }, + methods: { + ...common.methods, + }, + async run({ $ }) { + if (this.skipThisStep) { + $.export("$summary", "Step execution skipped"); + return; + } + + const data = { + model: this.modelId, + input: this.input, + instructions: this.instructions, + previous_response_id: this.previousResponseId, + truncation: this.truncation, + parallel_tool_calls: this.parallelToolCalls, + tools: [], + }; + + let functions = this.functions; + if (typeof functions === "string") { + try { + functions = JSON.parse(functions); + } catch (error) { + throw new Error("Invalid JSON format in the provided Functions Schema"); + } + } + + if (Array.isArray(functions)) { + data.tools.push(...functions); + } else { + data.tools.push(functions); + } + + if (this.toolChoice) { + if (this.toolChoice === "auto" || this.toolChoice === "required") { + data.tool_choice = this.toolChoice; + } else { + data.tool_choice = { + type: "function", + name: this.toolChoice, + }; + } + } + + if (this.openai.isReasoningModel(this.modelId) && this.reasoningEffort) { + data.reasoning = { + ...data.reasoning, + effort: this.reasoningEffort, + }; + } + + if (this.openai.isReasoningModel(this.modelId) && this.generateSummary) { + data.reasoning = { + ...data.reasoning, + generate_summary: this.generateSummary, + }; + } + + if (this.responseFormat === constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value) { + try { + data.text = { + format: { + type: this.responseFormat, + ...JSON.parse(this.jsonSchema), + }, + }; + } catch (error) { + throw new Error("Invalid JSON format in the provided JSON Schema"); + } + } + + const response = await this.openai.responses({ + $, + data, + }); + + if (response) { + $.export("$summary", `Successfully sent chat with id ${response.id}`); + $.export("chat_responses", response.output); + } + + return response; + }, +}; 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 new file mode 100644 index 0000000000000..b05befd915d9e --- /dev/null +++ b/components/openai/actions/chat-using-web-search/chat-using-web-search.mjs @@ -0,0 +1,200 @@ +import openai from "../../openai.app.mjs"; +import common from "../common/common.mjs"; +import constants from "../../common/constants.mjs"; + +export default { + ...common, + name: "Chat using Web Search", + version: "0.0.1", + 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", + props: { + openai, + modelId: { + type: "string", + label: "Model", + description: "Model used to generate the response", + default: "gpt-4o", + options: [ + "gpt-4o", + "gpt-4o-mini", + ], + }, + input: { + type: "string", + label: "Chat Input", + description: "Text, image, or file inputs to the model, used to generate a response", + }, + instructions: { + type: "string", + label: "Instructions", + description: "Inserts a system (or developer) message as the first item in the model's context", + optional: true, + }, + previousResponseId: { + type: "string", + label: "Previous Response ID", + description: "The unique ID of the previous response to the model. Use this to create multi-turn conversations", + optional: true, + }, + truncation: { + type: "string", + label: "Truncation", + description: "Specifies the truncation mode for the response if it's larger than the context window size", + optional: true, + default: "auto", + options: [ + "auto", + "disabled", + ], + }, + userLocation: { + type: "string[]", + label: "User Location", + description: "Additional configuration for approximate location parameters for the search", + optional: true, + options: [ + "City", + "Region", + "Country", + "Timezone", + ], + }, + searchContextSize: { + type: "string", + label: "Search Context Size", + description: "Determines the amount of context to use during the web search", + optional: true, + default: "medium", + options: [ + "low", + "medium", + "high", + ], + }, + responseFormat: { + type: "string", + label: "Response Format", + description: "Specify the format that the model must output. \n- **Text**: Returns unstructured text output.\n- **JSON Schema**: Enables you to define a [specific structure for the model's output using a JSON schema](https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses).", + options: [ + "text", + "json_schema", + ], + default: "text", + optional: true, + reloadProps: true, + }, + skipThisStep: { + type: "boolean", + label: "Skip This Step", + description: "Pass in a boolean custom expression to skip this step's execution at runtime", + optional: true, + default: false, + }, + }, + additionalProps() { + const { + responseFormat, + userLocation, + } = this; + const props = {}; + + if (userLocation?.includes("City")) { + props.city = { + type: "string", + label: "City", + description: "Free text input for the city of the user, e.g. `San Francisco`", + }; + } + + if (userLocation?.includes("Region")) { + props.region = { + type: "string", + label: "Region", + description: "Free text input for the region of the user, e.g. `California`", + }; + } + + if (userLocation?.includes("Country")) { + props.country = { + type: "string", + label: "Country", + description: "The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`", + }; + } + + if (userLocation?.includes("Timezone")) { + props.timezone = { + type: "string", + label: "Timezone", + description: "The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`", + }; + } + + if (responseFormat === constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value) { + props.jsonSchema = { + type: "string", + label: "JSON Schema", + description: "Define the schema that the model's output must adhere to. [Generate one here](https://platform.openai.com/docs/guides/structured-outputs/supported-schemas).", + }; + } + + return props; + }, + methods: { + ...common.methods, + }, + async run({ $ }) { + if (this.skipThisStep) { + $.export("$summary", "Step execution skipped"); + return; + } + + const data = { + model: this.modelId, + input: this.input, + instructions: this.instructions, + previous_response_id: this.previousResponseId, + truncation: this.truncation, + tools: [ + { + type: "web_search_preview", + user_location: { + type: "approximate", + city: this.city, + country: this.country, + region: this.region, + timezone: this.timezone, + }, + search_context_size: this.searchContextSize, + }, + ], + }; + + if (this.responseFormat === constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value) { + try { + data.text = { + format: { + type: this.responseFormat, + ...JSON.parse(this.jsonSchema), + }, + }; + } catch (error) { + throw new Error("Invalid JSON format in the provided JSON Schema"); + } + } + + const response = await this.openai.responses({ + $, + data, + }); + + if (response) { + $.export("$summary", `Successfully sent chat with id ${response.id}`); + $.export("chat_responses", response.output); + } + + return response; + }, +}; diff --git a/components/openai/actions/chat-with-assistant/chat-with-assistant.mjs b/components/openai/actions/chat-with-assistant/chat-with-assistant.mjs index 1cd63b709a694..ee0598fda3a01 100644 --- a/components/openai/actions/chat-with-assistant/chat-with-assistant.mjs +++ b/components/openai/actions/chat-with-assistant/chat-with-assistant.mjs @@ -6,10 +6,15 @@ export default { key: "openai-chat-with-assistant", name: "Chat with Assistant", 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)", - version: "0.0.9", + version: "0.0.10", type: "action", props: { openai, + alert: { + type: "alert", + alertType: "info", + content: "Looking to chat with your tools? Check out our individual actions: [Chat using Web Search](https://pipedream.com/apps/openai/actions/chat-using-web-search), [Chat using File Search](https://pipedream.com/apps/openai/actions/chat-using-file-search), and [Chat using Functions](https://pipedream.com/apps/openai/actions/chat-using-functions).", + }, message: { type: "string", label: "Message", diff --git a/components/openai/actions/chat/chat.mjs b/components/openai/actions/chat/chat.mjs index 7d6ec0786aa3a..0b79fa2e26840 100644 --- a/components/openai/actions/chat/chat.mjs +++ b/components/openai/actions/chat/chat.mjs @@ -6,12 +6,17 @@ import { ConfigurationError } from "@pipedream/platform"; export default { ...common, name: "Chat", - version: "0.2.5", + version: "0.2.6", 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", props: { openai, + alert: { + type: "alert", + alertType: "info", + content: "Looking to chat with your tools? Check out our individual actions: [Chat using Web Search](https://pipedream.com/apps/openai/actions/chat-using-web-search), [Chat using File Search](https://pipedream.com/apps/openai/actions/chat-using-file-search), and [Chat using Functions](https://pipedream.com/apps/openai/actions/chat-using-functions).", + }, modelId: { propDefinition: [ openai, 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 b1edf09015f78..2f93c93298041 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.4", + version: "0.1.5", 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/convert-text-to-speech/convert-text-to-speech.mjs b/components/openai/actions/convert-text-to-speech/convert-text-to-speech.mjs index 376e3e3c13cd7..7f7b6c9a96979 100644 --- a/components/openai/actions/convert-text-to-speech/convert-text-to-speech.mjs +++ b/components/openai/actions/convert-text-to-speech/convert-text-to-speech.mjs @@ -5,7 +5,7 @@ export default { key: "openai-convert-text-to-speech", name: "Convert Text to Speech (TTS)", description: "Generates audio from the input text. [See the documentation](https://platform.openai.com/docs/api-reference/audio/createSpeech)", - version: "0.0.12", + version: "0.0.13", type: "action", props: { openai, diff --git a/components/openai/actions/create-assistant/create-assistant.mjs b/components/openai/actions/create-assistant/create-assistant.mjs index b3d2227a95f56..41f32cb2eb79a 100644 --- a/components/openai/actions/create-assistant/create-assistant.mjs +++ b/components/openai/actions/create-assistant/create-assistant.mjs @@ -6,7 +6,7 @@ export default { key: "openai-create-assistant", name: "Create Assistant", description: "Creates an assistant with a model and instructions. [See the documentation](https://platform.openai.com/docs/api-reference/assistants/createAssistant)", - version: "0.1.11", + version: "0.1.12", type: "action", props: { openai, diff --git a/components/openai/actions/create-batch/create-batch.mjs b/components/openai/actions/create-batch/create-batch.mjs index 6277dfca0ed35..a48ed425497a6 100644 --- a/components/openai/actions/create-batch/create-batch.mjs +++ b/components/openai/actions/create-batch/create-batch.mjs @@ -8,7 +8,7 @@ export default { key: "openai-create-batch", name: "Create Batch", description: "Creates and executes a batch from an uploaded file of requests. [See the documentation](https://platform.openai.com/docs/api-reference/batch/create)", - version: "0.0.7", + version: "0.0.8", type: "action", props: { openai, diff --git a/components/openai/actions/create-embeddings/create-embeddings.mjs b/components/openai/actions/create-embeddings/create-embeddings.mjs index fdc3e30305f76..db0bc89ad9a08 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.16", + version: "0.0.17", 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/create-fine-tuning-job/create-fine-tuning-job.mjs b/components/openai/actions/create-fine-tuning-job/create-fine-tuning-job.mjs index d80be648e8aee..2a48596edc461 100644 --- a/components/openai/actions/create-fine-tuning-job/create-fine-tuning-job.mjs +++ b/components/openai/actions/create-fine-tuning-job/create-fine-tuning-job.mjs @@ -4,7 +4,7 @@ export default { key: "openai-create-fine-tuning-job", name: "Create Fine Tuning Job", 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)", - version: "0.0.12", + version: "0.0.13", type: "action", props: { openai, diff --git a/components/openai/actions/create-image/create-image.mjs b/components/openai/actions/create-image/create-image.mjs index 9e875bea571f6..cbb2d45fb0d5a 100644 --- a/components/openai/actions/create-image/create-image.mjs +++ b/components/openai/actions/create-image/create-image.mjs @@ -4,7 +4,7 @@ import fs from "fs"; export default { name: "Create Image (Dall-E)", - version: "0.1.20", + version: "0.1.21", key: "openai-create-image", description: "Creates an image given a prompt returning a URL to the image. [See the documentation](https://platform.openai.com/docs/api-reference/images)", type: "action", diff --git a/components/openai/actions/create-moderation/create-moderation.mjs b/components/openai/actions/create-moderation/create-moderation.mjs index 8b09cea1ff4ce..e7561691934e4 100644 --- a/components/openai/actions/create-moderation/create-moderation.mjs +++ b/components/openai/actions/create-moderation/create-moderation.mjs @@ -5,7 +5,7 @@ export default { key: "openai-create-moderation", name: "Create Moderation", description: "Classifies if text is potentially harmful. [See the documentation](https://platform.openai.com/docs/api-reference/moderations/create)", - version: "0.0.7", + version: "0.0.8", type: "action", props: { openai, diff --git a/components/openai/actions/create-thread/create-thread.mjs b/components/openai/actions/create-thread/create-thread.mjs index 2e43d3ba1b1ba..e5653c9fec7e4 100644 --- a/components/openai/actions/create-thread/create-thread.mjs +++ b/components/openai/actions/create-thread/create-thread.mjs @@ -6,7 +6,7 @@ export default { key: "openai-create-thread", name: "Create Thread (Assistants)", 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)", - version: "0.0.13", + version: "0.0.14", type: "action", props: { openai, diff --git a/components/openai/actions/create-vector-store-file/create-vector-store-file.mjs b/components/openai/actions/create-vector-store-file/create-vector-store-file.mjs index b6b1d4ee79a93..0fc6592f0a4f3 100644 --- a/components/openai/actions/create-vector-store-file/create-vector-store-file.mjs +++ b/components/openai/actions/create-vector-store-file/create-vector-store-file.mjs @@ -4,7 +4,7 @@ export default { key: "openai-create-vector-store-file", name: "Create Vector Store File", description: "Create a vector store file. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores-files/createFile)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { openai, diff --git a/components/openai/actions/create-vector-store/create-vector-store.mjs b/components/openai/actions/create-vector-store/create-vector-store.mjs index 5310772519f77..951c55c8435e2 100644 --- a/components/openai/actions/create-vector-store/create-vector-store.mjs +++ b/components/openai/actions/create-vector-store/create-vector-store.mjs @@ -4,7 +4,7 @@ export default { key: "openai-create-vector-store", name: "Create Vector Store", description: "Create a vector store. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores/create)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { openai, diff --git a/components/openai/actions/delete-file/delete-file.mjs b/components/openai/actions/delete-file/delete-file.mjs index 5aadc79614b40..39134cf69281f 100644 --- a/components/openai/actions/delete-file/delete-file.mjs +++ b/components/openai/actions/delete-file/delete-file.mjs @@ -4,7 +4,7 @@ export default { key: "openai-delete-file", name: "Delete File", description: "Deletes a specified file from OpenAI. [See the documentation](https://platform.openai.com/docs/api-reference/files/delete)", - version: "0.0.13", + version: "0.0.14", type: "action", props: { openai, diff --git a/components/openai/actions/delete-vector-store-file/delete-vector-store-file.mjs b/components/openai/actions/delete-vector-store-file/delete-vector-store-file.mjs index 44ee5a7ba7d45..7ce90f7be2185 100644 --- a/components/openai/actions/delete-vector-store-file/delete-vector-store-file.mjs +++ b/components/openai/actions/delete-vector-store-file/delete-vector-store-file.mjs @@ -4,7 +4,7 @@ export default { key: "openai-delete-vector-store-file", name: "Delete Vector Store File", description: "Deletes a vector store file. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores-files/deleteFile)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { openai, diff --git a/components/openai/actions/delete-vector-store/delete-vector-store.mjs b/components/openai/actions/delete-vector-store/delete-vector-store.mjs index 6e2183928501f..e715c31e63621 100644 --- a/components/openai/actions/delete-vector-store/delete-vector-store.mjs +++ b/components/openai/actions/delete-vector-store/delete-vector-store.mjs @@ -4,7 +4,7 @@ export default { key: "openai-delete-vector-store", name: "Delete Vector Store", description: "Delete a vector store. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores/delete)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { openai, diff --git a/components/openai/actions/list-files/list-files.mjs b/components/openai/actions/list-files/list-files.mjs index 07b8b74ca954d..eec681371f49b 100644 --- a/components/openai/actions/list-files/list-files.mjs +++ b/components/openai/actions/list-files/list-files.mjs @@ -4,7 +4,7 @@ export default { key: "openai-list-files", name: "List Files", 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)", - version: "0.0.13", + version: "0.0.14", type: "action", props: { openai, diff --git a/components/openai/actions/list-messages/list-messages.mjs b/components/openai/actions/list-messages/list-messages.mjs index 6e8ce277246fa..53cf1608dc703 100644 --- a/components/openai/actions/list-messages/list-messages.mjs +++ b/components/openai/actions/list-messages/list-messages.mjs @@ -4,7 +4,7 @@ export default { key: "openai-list-messages", name: "List Messages (Assistants)", description: "Lists the messages for a given thread. [See the documentation](https://platform.openai.com/docs/api-reference/messages/listMessages)", - version: "0.0.14", + version: "0.0.15", type: "action", props: { openai, diff --git a/components/openai/actions/list-run-steps/list-run-steps.mjs b/components/openai/actions/list-run-steps/list-run-steps.mjs index 604de4c8b692f..daa54aafb94d0 100644 --- a/components/openai/actions/list-run-steps/list-run-steps.mjs +++ b/components/openai/actions/list-run-steps/list-run-steps.mjs @@ -4,7 +4,7 @@ export default { key: "openai-list-run-steps", name: "List Run Steps (Assistants)", 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)", - version: "0.0.13", + version: "0.0.14", type: "action", props: { openai, diff --git a/components/openai/actions/list-runs/list-runs.mjs b/components/openai/actions/list-runs/list-runs.mjs index 1ed17dd1860b3..e4362d8fce27f 100644 --- a/components/openai/actions/list-runs/list-runs.mjs +++ b/components/openai/actions/list-runs/list-runs.mjs @@ -4,7 +4,7 @@ export default { key: "openai-list-runs", name: "List Runs (Assistants)", description: "Returns a list of runs belonging to a thread. [See the documentation](https://platform.openai.com/docs/api-reference/runs/list)", - version: "0.0.14", + version: "0.0.15", type: "action", props: { openai, diff --git a/components/openai/actions/list-vector-store-files/list-vector-store-files.mjs b/components/openai/actions/list-vector-store-files/list-vector-store-files.mjs index daff6a616cba9..aed4fbeadbdfb 100644 --- a/components/openai/actions/list-vector-store-files/list-vector-store-files.mjs +++ b/components/openai/actions/list-vector-store-files/list-vector-store-files.mjs @@ -4,7 +4,7 @@ export default { key: "openai-list-vector-store-files", name: "List Vector Store Files", description: "Returns a list of vector store file. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { openai, diff --git a/components/openai/actions/list-vector-stores/list-vector-stores.mjs b/components/openai/actions/list-vector-stores/list-vector-stores.mjs index 27295b2eca338..f2d68712cbcd2 100644 --- a/components/openai/actions/list-vector-stores/list-vector-stores.mjs +++ b/components/openai/actions/list-vector-stores/list-vector-stores.mjs @@ -4,7 +4,7 @@ export default { key: "openai-list-vector-stores", name: "List Vector Stores", description: "Returns a list of vector stores. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores/list)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { openai, diff --git a/components/openai/actions/modify-assistant/modify-assistant.mjs b/components/openai/actions/modify-assistant/modify-assistant.mjs index 07f0f30415e63..d939ee30279f5 100644 --- a/components/openai/actions/modify-assistant/modify-assistant.mjs +++ b/components/openai/actions/modify-assistant/modify-assistant.mjs @@ -6,7 +6,7 @@ export default { key: "openai-modify-assistant", name: "Modify an Assistant", description: "Modifies an existing OpenAI assistant. [See the documentation](https://platform.openai.com/docs/api-reference/assistants/modifyAssistant)", - version: "0.1.11", + version: "0.1.12", type: "action", props: { openai, diff --git a/components/openai/actions/retrieve-file-content/retrieve-file-content.mjs b/components/openai/actions/retrieve-file-content/retrieve-file-content.mjs index 35adcf4d256bc..d967e1ccbe86d 100644 --- a/components/openai/actions/retrieve-file-content/retrieve-file-content.mjs +++ b/components/openai/actions/retrieve-file-content/retrieve-file-content.mjs @@ -5,7 +5,7 @@ export default { key: "openai-retrieve-file-content", name: "Retrieve File Content", description: "Retrieves the contents of the specified file. [See the documentation](https://platform.openai.com/docs/api-reference/files/retrieve-content)", - version: "0.0.13", + version: "0.0.14", type: "action", props: { openai, diff --git a/components/openai/actions/retrieve-file/retrieve-file.mjs b/components/openai/actions/retrieve-file/retrieve-file.mjs index f88994a6994a9..40a817c7a3520 100644 --- a/components/openai/actions/retrieve-file/retrieve-file.mjs +++ b/components/openai/actions/retrieve-file/retrieve-file.mjs @@ -4,7 +4,7 @@ export default { key: "openai-retrieve-file", name: "Retrieve File", description: "Retrieves a specific file from OpenAI. [See the documentation](https://platform.openai.com/docs/api-reference/files/retrieve)", - version: "0.0.13", + version: "0.0.14", type: "action", props: { openai, diff --git a/components/openai/actions/retrieve-run-step/retrieve-run-step.mjs b/components/openai/actions/retrieve-run-step/retrieve-run-step.mjs index 3397c3f080218..ff3e744fd5393 100644 --- a/components/openai/actions/retrieve-run-step/retrieve-run-step.mjs +++ b/components/openai/actions/retrieve-run-step/retrieve-run-step.mjs @@ -4,7 +4,7 @@ export default { key: "openai-retrieve-run-step", name: "Retrieve Run Step (Assistants)", description: "Retrieve a specific run step in a thread. [See the documentation](https://platform.openai.com/docs/api-reference/runs/getRunStep)", - version: "0.0.13", + version: "0.0.14", type: "action", props: { openai, diff --git a/components/openai/actions/retrieve-run/retrieve-run.mjs b/components/openai/actions/retrieve-run/retrieve-run.mjs index 4f26c51a18876..5b225299973fd 100644 --- a/components/openai/actions/retrieve-run/retrieve-run.mjs +++ b/components/openai/actions/retrieve-run/retrieve-run.mjs @@ -4,7 +4,7 @@ export default { key: "openai-retrieve-run", name: "Retrieve Run (Assistants)", description: "Retrieves a specific run within a thread. [See the documentation](https://platform.openai.com/docs/api-reference/runs/getRun)", - version: "0.0.13", + version: "0.0.14", type: "action", props: { openai, diff --git a/components/openai/actions/retrieve-vector-store-file/retrieve-vector-store-file.mjs b/components/openai/actions/retrieve-vector-store-file/retrieve-vector-store-file.mjs index d9b0ee491f0f2..69a9b17f792b8 100644 --- a/components/openai/actions/retrieve-vector-store-file/retrieve-vector-store-file.mjs +++ b/components/openai/actions/retrieve-vector-store-file/retrieve-vector-store-file.mjs @@ -4,7 +4,7 @@ export default { key: "openai-retrieve-vector-store-file", name: "Retrieve Vector Store File", description: "Retrieve a vector store file. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores-files/getFile)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { openai, diff --git a/components/openai/actions/retrieve-vector-store/retrieve-vector-store.mjs b/components/openai/actions/retrieve-vector-store/retrieve-vector-store.mjs index 3330dd9242812..9c412c4db0bed 100644 --- a/components/openai/actions/retrieve-vector-store/retrieve-vector-store.mjs +++ b/components/openai/actions/retrieve-vector-store/retrieve-vector-store.mjs @@ -4,7 +4,7 @@ export default { key: "openai-retrieve-vector-store", name: "Retrieve Vector Store", description: "Retrieve a vector store. [See the documentation](https://platform.openai.com/docs/api-reference/vector-stores/retrieve)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { openai, diff --git a/components/openai/actions/send-prompt/send-prompt.mjs b/components/openai/actions/send-prompt/send-prompt.mjs index 561a2b1a594e6..f08cbfa4beb53 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.15", + version: "0.1.16", 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/submit-tool-outputs-to-run/submit-tool-outputs-to-run.mjs b/components/openai/actions/submit-tool-outputs-to-run/submit-tool-outputs-to-run.mjs index 88d5fa38085fb..7c4fca7b0cd8c 100644 --- a/components/openai/actions/submit-tool-outputs-to-run/submit-tool-outputs-to-run.mjs +++ b/components/openai/actions/submit-tool-outputs-to-run/submit-tool-outputs-to-run.mjs @@ -5,7 +5,7 @@ export default { key: "openai-submit-tool-outputs-to-run", name: "Submit Tool Outputs to Run (Assistants)", description: "Submits tool outputs to a run that requires action. [See the documentation](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs)", - version: "0.0.13", + version: "0.0.14", type: "action", props: { openai, diff --git a/components/openai/actions/summarize/summarize.mjs b/components/openai/actions/summarize/summarize.mjs index 7b27e33e278e2..54a4a6754c6a9 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.4", + version: "0.1.5", 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 406d8901d777e..fbc48f3e7fdbf 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.4", + version: "0.1.5", 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", diff --git a/components/openai/actions/upload-file/upload-file.mjs b/components/openai/actions/upload-file/upload-file.mjs index fc7d68bdd7b0d..a200766871842 100644 --- a/components/openai/actions/upload-file/upload-file.mjs +++ b/components/openai/actions/upload-file/upload-file.mjs @@ -6,7 +6,7 @@ export default { key: "openai-upload-file", name: "Upload File", 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)", - version: "0.0.16", + version: "0.0.17", type: "action", props: { openai, diff --git a/components/openai/openai.app.mjs b/components/openai/openai.app.mjs index c7d6c16ed4488..5851c920158a3 100644 --- a/components/openai/openai.app.mjs +++ b/components/openai/openai.app.mjs @@ -338,6 +338,9 @@ export default { maxBodyLength: Infinity, }); }, + isReasoningModel(model) { + return model.match(/^o[1-9]/gi)?.length; + }, async models({ $ }) { const { data: models } = await this._makeRequest({ $, @@ -764,6 +767,13 @@ export default { ...args, }); }, + responses(args = {}) { + return this._makeRequest({ + path: "/responses", + method: "POST", + ...args, + }); + }, async *paginate({ resourceFn, args = {}, diff --git a/components/openai/package.json b/components/openai/package.json index 12c47625d4832..4531001c3f437 100644 --- a/components/openai/package.json +++ b/components/openai/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/openai", - "version": "0.8.1", + "version": "0.9.0", "description": "Pipedream OpenAI Components", "main": "openai.app.mjs", "keywords": [ diff --git a/components/openai/sources/new-batch-completed/new-batch-completed.mjs b/components/openai/sources/new-batch-completed/new-batch-completed.mjs index b644f4e6d9678..97270cf42f502 100644 --- a/components/openai/sources/new-batch-completed/new-batch-completed.mjs +++ b/components/openai/sources/new-batch-completed/new-batch-completed.mjs @@ -6,7 +6,7 @@ export default { key: "openai-new-batch-completed", name: "New Batch Completed", description: "Emit new event when a new batch is completed in OpenAI. [See the documentation](https://platform.openai.com/docs/api-reference/batch/list)", - version: "0.0.7", + version: "0.0.8", type: "source", dedupe: "unique", methods: { diff --git a/components/openai/sources/new-file-created/new-file-created.mjs b/components/openai/sources/new-file-created/new-file-created.mjs index 069f8409e265e..42800ca5e77cd 100644 --- a/components/openai/sources/new-file-created/new-file-created.mjs +++ b/components/openai/sources/new-file-created/new-file-created.mjs @@ -6,7 +6,7 @@ export default { key: "openai-new-file-created", name: "New File Created", description: "Emit new event when a new file is created in OpenAI. [See the documentation](https://platform.openai.com/docs/api-reference/files/list)", - version: "0.0.12", + version: "0.0.13", type: "source", dedupe: "unique", props: { diff --git a/components/openai/sources/new-fine-tuning-job-created/new-fine-tuning-job-created.mjs b/components/openai/sources/new-fine-tuning-job-created/new-fine-tuning-job-created.mjs index 8c0649f1a5729..0933ed88ae49f 100644 --- a/components/openai/sources/new-fine-tuning-job-created/new-fine-tuning-job-created.mjs +++ b/components/openai/sources/new-fine-tuning-job-created/new-fine-tuning-job-created.mjs @@ -6,7 +6,7 @@ export default { key: "openai-new-fine-tuning-job-created", name: "New Fine Tuning Job Created", 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)", - version: "0.0.12", + version: "0.0.13", type: "source", dedupe: "unique", methods: { diff --git a/components/openai/sources/new-run-state-changed/new-run-state-changed.mjs b/components/openai/sources/new-run-state-changed/new-run-state-changed.mjs index add3270a5b8b2..cc688d31c7430 100644 --- a/components/openai/sources/new-run-state-changed/new-run-state-changed.mjs +++ b/components/openai/sources/new-run-state-changed/new-run-state-changed.mjs @@ -6,7 +6,7 @@ export default { key: "openai-new-run-state-changed", name: "New Run State Changed", description: "Emit new event every time a run changes its status. [See the documentation](https://platform.openai.com/docs/api-reference/runs/listRuns)", - version: "0.0.8", + version: "0.0.9", type: "source", dedupe: "unique", props: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e6abffc96351..271a9e7281879 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2347,8 +2347,7 @@ importers: components/claris_filemaker_server_odata_api: {} - components/classmarker: - specifiers: {} + components/classmarker: {} components/clear_books: dependencies: @@ -4163,8 +4162,7 @@ importers: specifier: ^3.0.3 version: 3.0.3 - components/evernote: - specifiers: {} + components/evernote: {} components/eversign: dependencies: @@ -5378,8 +5376,7 @@ importers: specifier: ^3.0.3 version: 3.0.3 - components/google_marketplace: - specifiers: {} + components/google_marketplace: {} components/google_meet: dependencies: @@ -7251,8 +7248,7 @@ importers: specifier: ^1.6.0 version: 1.6.6 - components/livespace: - specifiers: {} + components/livespace: {} components/livestorm: dependencies: @@ -7558,8 +7554,7 @@ importers: specifier: ^3.0.0 version: 3.0.3 - components/mailsoftly: - specifiers: {} + components/mailsoftly: {} components/mailtrap: {} @@ -12605,8 +12600,7 @@ importers: components/test_apps_for_checking_something_001: {} - components/test_apps_for_switching_appslug_009: - specifiers: {} + components/test_apps_for_switching_appslug_009: {} components/testmo: dependencies: