diff --git a/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/assistant-operations.md b/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/assistant-operations.md index b32a0ca4a..1eeb93519 100644 --- a/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/assistant-operations.md +++ b/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/assistant-operations.md @@ -9,6 +9,10 @@ priority: critical Use this operation to create, delete, list, message, or update an assistant in OpenAI. Refer to [OpenAI](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/index.md) for more information on the OpenAI node itself. +/// note | Assistant operations deprecated in OpenAI node V2 +n8n version 1.117.0 introduces V2 of the OpenAI node that supports the OpenAI Responses API and removes support for the [to-be-deprecated Assistants API](https://platform.openai.com/docs/assistants/migration). +/// + ## Create an Assistant Use this operation to create a new assistant. diff --git a/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/conversation-operations.md b/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/conversation-operations.md new file mode 100644 index 000000000..78780278b --- /dev/null +++ b/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/conversation-operations.md @@ -0,0 +1,70 @@ +--- +title: OpenAI Conversation operations +description: Documentation for the Conversation operations in OpenAI node in n8n, a workflow automation platform. Includes details of operations and configuration, and links to examples and credentials information. +contentType: [integration, reference] +priority: critical +--- + +# OpenAI Conversation operations + +Use this operation to create, get, update, or remove a conversation in OpenAI. Refer to [OpenAI](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/index.md) for more information on the OpenAI node itself. + +## Create a Conversation + +Use this operation to create a new conversation. + +Enter these parameters: + +- **Credential to connect with**: Create or select an existing [OpenAI credential](/integrations/builtin/credentials/openai.md). +- **Resource**: Select **Conversation**. +- **Operation**: Select **Create a Conversation**. +- **Messages**: A message input to the model. Messages with the `system` role take precedence over instructions given with the `user` role. Messages with the `assistant` role will be assumed to have been generated by the model in previous interactions. + +### Options + +- **Metadata**: A set of key-value pairs for storing structured information. You can attach up to 16 pairs to an object, which is useful for adding custom data that can be used for searching via the API or in the dashboard. + +Refer to [Conversations | OpenAI](https://platform.openai.com/docs/api-reference/conversations/create) documentation for more information. + +## Get a Conversation + +Use this operation to retrieve an existing conversation. + +Enter these parameters: + +- **Credential to connect with**: Create or select an existing [OpenAI credential](/integrations/builtin/credentials/openai.md). +- **Resource**: Select **Conversation**. +- **Operation**: Select **Get Conversation**. +- **Conversation ID**: The ID of the conversation to retrieve. + +Refer to [Conversations | OpenAI](https://platform.openai.com/docs/api-reference/conversations/create) documentation for more information. + +## Remove a Conversation + +Use this operation to remove an existing conversation. + +Enter these parameters: + +- **Credential to connect with**: Create or select an existing [OpenAI credential](/integrations/builtin/credentials/openai.md). +- **Resource**: Select **Conversation**. +- **Operation**: Select **Remove Conversation**. +- **Conversation ID**: The ID of the conversation to remove. + +Refer to [Conversations | OpenAI](https://platform.openai.com/docs/api-reference/conversations/create) documentation for more information. + +## Update a Conversation + +Use this operation to update an existing conversation. + +Enter these parameters: + +- **Credential to connect with**: Create or select an existing [OpenAI credential](/integrations/builtin/credentials/openai.md). +- **Resource**: Select **Conversation**. +- **Operation**: Select **Update a Conversation**. +- **Conversation ID**: The ID of the conversation to update. + +### Options + +- **Metadata**: A set of key-value pairs for storing structured information. You can attach up to 16 pairs to an object, which is useful for adding custom data that can be used for searching via the API or in the dashboard. + +Refer to [Conversations | OpenAI](https://platform.openai.com/docs/api-reference/conversations/create) documentation for more information. \ No newline at end of file diff --git a/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/image-operations.md b/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/image-operations.md index bf6356a04..a0bec35ac 100644 --- a/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/image-operations.md +++ b/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/image-operations.md @@ -18,7 +18,7 @@ Enter these parameters: - **Credential to connect with**: Create or select an existing [OpenAI credential](/integrations/builtin/credentials/openai.md). - **Resource**: Select **Image**. - **Operation**: Select **Analayze Image**. -- **Model**: Select the model you want to use to generate an image. +- **Model**: Select the model you want to use to analyze an image. - **Text Input**: Ask a question about the image. - **Input Type**: Select how you'd like to input the image. Options include: - **Image URL(s)**: Enter the **URL(s)** of the image(s) to analyze. Add multiple URLs in a comma-separated list. @@ -55,6 +55,30 @@ Enter these parameters: Refer to [Create image | OpenAI](https://platform.openai.com/docs/api-reference/images/create) documentation for more information. +## Edit an Image + +Use this operation to edit an image from a text prompt. + +Enter these parameters: + +- **Credential to connect with**: Create or select an existing [OpenAI credential](/integrations/builtin/credentials/openai.md). +- **Resource**: Select **Image**. +- **Operation**: Select **Edit Image**. +- **Model**: Select the model you want to use to generate an image. Supports `dall-e-2` and `gpt-image-1`. +- **Prompt**: Enter the text description of the desired edits to the input image(s). +- **Image(s)**: Add one or more binary fields to include images with your prompt. Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images. +- **Number of Images**: The number of images to generate. Must be between 1 and 10. +- **Size**: The size and dimensions of the generated images (in px). +- **Quality**: The quality of the image that will be generated (auto, low, medium, high, standard). Only supported for `gpt-image-1`. +- **Output Format**: The format in which the generated images are returned (png, webp, or jpg). Only supported for gpt-image-1. +- **Output Compression**: The compression level (0-100%) for the generated images. Only supported for `gpt-image-1` with webp or jpeg output formats. + +### Options +- **Background**: Allows to set transparency for the background of the generated image(s). Only supported for `gpt-image-1`. +- **Input Fidelity**: Control how much effort the model will exert to match the style and features of input images. Only supported for `gpt-image-1`. +- **Image Mask**: Name of the binary property that contains the image. A second image whose fully transparent areas (for example, where alpha is zero) shows where the image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image. +- **User**: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. + ## Common issues For common errors or issues and suggested resolution steps, refer to [Common Issues](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/common-issues.md). diff --git a/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/index.md b/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/index.md index d94f8797b..4307fd48d 100644 --- a/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/index.md +++ b/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/index.md @@ -13,8 +13,9 @@ Use the OpenAI node to automate work in OpenAI and integrate OpenAI with other a On this page, you'll find a list of operations the OpenAI node supports and links to more resources. -/// note | OpenAI Assistant node +/// note | Previous node versions The OpenAI node replaces the OpenAI assistant node from version 1.29.0 on. +n8n version 1.117.0 introduces V2 of the OpenAI node that supports the OpenAI Responses API and removes support for the [to-be-deprecated Assistants API](https://platform.openai.com/docs/assistants/migration). /// /// note | Credentials @@ -23,18 +24,14 @@ Refer to [OpenAI credentials](/integrations/builtin/credentials/openai.md) for g ## Operations -- **Assistant** - - [**Create an Assistant**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/assistant-operations.md#create-an-assistant) - - [**Delete an Assistant**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/assistant-operations.md#delete-an-assistant) - - [**List Assistants**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/assistant-operations.md#list-assistants) - - [**Message an Assistant**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/assistant-operations.md#message-an-assistant) - - [**Update an Assistant**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/assistant-operations.md#update-an-assistant) - **Text** - - [**Message a Model**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/text-operations.md#message-a-model) + - [**Generate a Chat Completion**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/text-operations.md#generate-a-chat-completion) + - [**Generate a Model Response**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/text-operations.md#generate-a-model-response) - [**Classify Text for Violations**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/text-operations.md#classify-text-for-violations) - **Image** - [**Analyze Image**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/image-operations.md#analyze-image) - [**Generate an Image**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/image-operations.md#generate-an-image) + - [**Edit an Image**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/image-operations.md#edit-an-image) - **Audio** - [**Generate Audio**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/audio-operations.md#generate-audio) - [**Transcribe a Recording**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/audio-operations.md#transcribe-a-recording) @@ -43,6 +40,14 @@ Refer to [OpenAI credentials](/integrations/builtin/credentials/openai.md) for g - [**Delete a File**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/file-operations.md#delete-a-file) - [**List Files**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/file-operations.md#list-files) - [**Upload a File**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/file-operations.md#upload-a-file) +- **Video** + - [**Generate a Video**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/video-operations.md#generate-video) +- **Conversation** + - [**Create a Conversation**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/conversation-operations.md#create-a-conversation) + - [**Get a Conversation**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/conversation-operations.md#get-a-conversation) + - [**Update a Conversation**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/conversation-operations.md#update-a-conversation) + - [**Remove a Conversation**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/conversation-operations.md#remove-a-conversation) + ## Templates and examples @@ -69,10 +74,9 @@ Once you add a tool connection, the OpenAI node becomes a [root node](/glossary. ### Operations that support tool connectors -- **Assistant** - - [**Message an Assistant**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/assistant-operations.md#message-an-assistant) - **Text** - - [**Message a Model**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/text-operations.md#message-a-model) + - [**Generate a Chat Completion**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/text-operations.md#generate-a-chat-completion) + - [**Generate a Model Response**](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/text-operations.md#generate-a-model-response) ## Common issues diff --git a/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/text-operations.md b/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/text-operations.md index 92e70898a..5abf83c6f 100644 --- a/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/text-operations.md +++ b/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/text-operations.md @@ -9,20 +9,24 @@ priority: critical Use this operation to message a model or classify text for violations in OpenAI. Refer to [OpenAI](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/index.md) for more information on the OpenAI node itself. -## Message a Model +/// note | Previous node versions +n8n version 1.117.0 introduces the OpenAI node V2 that supports the OpenAI Responses API. It renames the 'Message a Model' operation to 'Generate a Chat Completion' to clarify its association with the Chat Completions API and introduces a separate 'Generate a Model Response' operation that uses the Responses API. +/// -Use this operation to send a message or prompt to an OpenAI model and receive a response. +## Generate a Chat Completion + +Use this operation to send a message or prompt to an OpenAI model - using the Chat Completions API - and receive a response. Enter these parameters: - **Credential to connect with**: Create or select an existing [OpenAI credential](/integrations/builtin/credentials/openai.md). - **Resource**: Select **Text**. -- **Operation**: Select **Message a Model**. +- **Operation**: Select **Generate a Chat Completion**. - **Model**: Select the model you want to use. If you’re not sure which model to use, try `gpt-4o` if you need high intelligence or `gpt-4o-mini` if you need the fastest speed and lowest cost. Refer to [Models overview | OpenAI Platform](https://platform.openai.com/docs/models) for more information. - **Messages**: Enter a **Text** prompt and assign a **Role** that the model will use to generate responses. Refer to [Prompt engineering | OpenAI](https://platform.openai.com/docs/guides/prompt-engineering) for more information on how to write a better prompt by using these roles. Choose from one of these roles: - **User**: Sends a message as a user and gets a response from the model. - **Assistant**: Tells the model to adopt a specific tone or personality. - - **System**: By default, the system message is `"You are a helpful assistant"`. You can define instructions in the user message, but the instructions set in the system message are more effective. You can only set one system message per conversation. Use this to set the model's behavior or context for the next user message. + - **System**: By default, there is no system message. You can define instructions in the user message, but the instructions set in the system message are more effective. You can set more than one system message per conversation. Use this to set the model's behavior or context for the next user message. - **Simplify Output**: Turn on to return a simplified version of the response instead of the raw data. - **Output Content as JSON**: Turn on to attempt to return the response in JSON format. Compatible with `GPT-4 Turbo` and all `GPT-3.5 Turbo` models newer than `gpt-3.5-turbo-1106`. @@ -35,7 +39,49 @@ Enter these parameters: - **Output Randomness (Temperature)**: Adjust the randomness of the response. The range is between `0.0` (deterministic) and `1.0` (maximum randomness). We recommend altering this or **Output Randomness (Top P)** but not both. Start with a medium temperature (around `0.7`) and adjust based on the outputs you observe. If the responses are too repetitive or rigid, increase the temperature. If they’re too chaotic or off-track, decrease it. Defaults to `1.0`. - **Output Randomness (Top P)**: Adjust the Top P setting to control the diversity of the assistant's responses. For example, `0.5` means half of all likelihood-weighted options are considered. We recommend altering this or **Output Randomness (Temperature)** but not both. Defaults to `1.0`. -Refer to [Message a Model | OpenAI](https://platform.openai.com/docs/api-reference/text-completion/create) documentation for more information. +Refer to [Chat Completions | OpenAI](https://platform.openai.com/docs/api-reference/chat) documentation for more information. + +## Generate a Model Response + +Use this operation to send a message or prompt to an OpenAI model - using the Responses API - and receive a response. + +Enter these parameters: + +- **Credential to connect with**: Create or select an existing [OpenAI credential](/integrations/builtin/credentials/openai.md). +- **Resource**: Select **Text**. +- **Operation**: Select **Generate a Model Response**. +- **Model**: Select the model you want to use. Refer to [Models overview | OpenAI Platform](https://platform.openai.com/docs/models) for an overview. +- **Messages**: Choose from one of these a **Message Types**: + - **Text**: Enter a **Text** prompt and assign a **Role** that the model will use to generate responses. Refer to [Prompt engineering | OpenAI](https://platform.openai.com/docs/guides/prompt-engineering) for more information on how to write a better prompt by using these roles. + - **Image**: Provide an **Image** either through an Image URL, a File ID (using the [OpenAI Files API](https://platform.openai.com/docs/api-reference/files)) or by passing binary data from an earlier node in your workflow. + - **File**: Provide a **File** in a supported format (currently: PDF only), either through a File URL, a File ID (using the [OpenAI Files API](https://platform.openai.com/docs/api-reference/files)) or by passing binary data from an earlier node in your workflow. + - For any message type, you can choose from one of these roles: + - **User**: Sends a message as a user and gets a response from the model. + - **Assistant**: Tells the model to adopt a specific tone or personality. + - **System**: By default, the system message is `"You are a helpful assistant"`. You can define instructions in the user message, but the instructions set in the system message are more effective. You can only set one system message per conversation. Use this to set the model's behavior or context for the next user message. +- **Simplify Output**: Turn on to return a simplified version of the response instead of the raw data. + +### Built-in Tools +The OpenAI Responses API provides a range of [built-in tools](https://platform.openai.com/docs/guides/tools) to enrich the model's response: + +- **Web Search**: Allows models to search the web for the latest information before generating a response. +- **MCP Servers**: Allows models to connect to remote MCP servers. Find out more about using remote MCP servers as tools [here](https://platform.openai.com/docs/guides/tools-connectors-mcp). +- **File Search**: Allow models to search your knowledgebase from previously uploaded files for relevant information before generating a response. Refer to the [OpenAI documentation](https://platform.openai.com/docs/guides/tools-file-search) for more information. +- **Code Interpreter**: Allows models to write and run Python code in a sandboxed environment. + +### Options + +- **Maximum Number of Tokens**: Set the maximum number of tokens for the response. One token is roughly four characters for standard English text. Use this to limit the length of the output. +- **Output Randomness (Temperature)**: Adjust the randomness of the response. The range is between `0.0` (deterministic) and `1.0` (maximum randomness). We recommend altering this or **Output Randomness (Top P)** but not both. Start with a medium temperature (around `0.7`) and adjust based on the outputs you observe. If the responses are too repetitive or rigid, increase the temperature. If they’re too chaotic or off-track, decrease it. Defaults to `1.0`. +- **Output Randomness (Top P)**: Adjust the Top P setting to control the diversity of the assistant's responses. For example, `0.5` means half of all likelihood-weighted options are considered. We recommend altering this or **Output Randomness (Temperature)** but not both. Defaults to `1.0`. +- **Conversation ID**: The conversation that this response belongs to. Input items and output items from this response are automatically added to this conversation after this response completes. +- **Previous Response ID**: The ID of the previous response to continue from. Can't be used in conjunction with Conversation ID. +- **Reasoning**: The level of reasoning effort the model should spend to generate the response. Includes the ability to return a **Summary** of the reasoning performed by the model (for example, for debugging purposes). +- **Store**: Whether to store the generated model response for later retrieval via API. Defaults to `true`. +- **Output Format**: Whether to return the response as **Text**, in a specified **JSON Schema** or as a **JSON Object**. +- **Background**: Whether to run the model in [background mode](https://platform.openai.com/docs/guides/background). This allows executing long-running tasks more reliably. + +Refer to [Responses | OpenAI](https://platform.openai.com/docs/api-reference/responses/create) documentation for more information. ## Classify Text for Violations diff --git a/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/video-operations.md b/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/video-operations.md new file mode 100644 index 000000000..d71347d8a --- /dev/null +++ b/docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/video-operations.md @@ -0,0 +1,32 @@ +--- +title: OpenAI Video operations +description: Documentation for the Video operations in OpenAI node in n8n, a workflow automation platform. Includes details of operations and configuration, and links to examples and credentials information. +contentType: [integration, reference] +priority: critical +--- + +# OpenAI Video operations + +Use this operation to generate a video in OpenAI. Refer to [OpenAI](/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/index.md) for more information on the OpenAI node itself. + +## Generate Video + +Use this operation to generate a video from a text prompt. + +Enter these parameters: + +- **Credential to connect with**: Create or select an existing [OpenAI credential](/integrations/builtin/credentials/openai.md). +- **Resource**: Select **Video**. +- **Operation**: Select **Generate Video**. +- **Model**: Select the model you want to use to generate a video. Currently supports `sora-2` and `sora-2-pro`. +- **Prompt**: The prompt to generate a video from. +- **Seconds**: Clip duration in seconds (up to 25). +- **Size**: Output resolution formatted as width x height. 1024x1792 and 1792x1024 are only supported by Sora 2 Pro. + +### Options + +- **Reference**: Optional image reference that guides generation. Has to be passed in as a binary item. +- **Wait Timeout**: Time to wait for the video to be generated in seconds. Defaults to 300. +- **Output Field Name**: The name of the output field to put the binary file data in. Defaults to `data`. + +Refer to [Video Generation | OpenAI](https://platform.openai.com/docs/guides/video-generation) for more information. \ No newline at end of file diff --git a/nav.yml b/nav.yml index 6446cf554..d8037fb1a 100644 --- a/nav.yml +++ b/nav.yml @@ -472,9 +472,11 @@ nav: - OpenAI: integrations/builtin/app-nodes/n8n-nodes-langchain.openai/index.md - Assistant operations: integrations/builtin/app-nodes/n8n-nodes-langchain.openai/assistant-operations.md - Audio operations: integrations/builtin/app-nodes/n8n-nodes-langchain.openai/audio-operations.md + - Conversation operations: integrations/builtin/app-nodes/n8n-nodes-langchain.openai/conversation-operations.md - File operations: integrations/builtin/app-nodes/n8n-nodes-langchain.openai/file-operations.md - Image operations: integrations/builtin/app-nodes/n8n-nodes-langchain.openai/image-operations.md - Text operations: integrations/builtin/app-nodes/n8n-nodes-langchain.openai/text-operations.md + - Video operations: integrations/builtin/app-nodes/n8n-nodes-langchain.openai/video-operations.md - Common issues: integrations/builtin/app-nodes/n8n-nodes-langchain.openai/common-issues.md - OpenThesaurus: integrations/builtin/app-nodes/n8n-nodes-base.openthesaurus.md - OpenWeatherMap: integrations/builtin/app-nodes/n8n-nodes-base.openweathermap.md