Links

OpenAI

Basic documentation to get you started with the OpenAI node

Introduction

With the OpenAI Node, you can tap into the advanced natural language processing capabilities of the OpenAI API, which utilizes cutting-edge machine learning techniques to generate responses to a variety of different inputs. The OpenAI Node has a few different versions for different uses, such as transcribing or translating audio, creating images, completing and editing text, and chat completion.
The Node has two exits: the default exit is used when the API returns a good response, and the Error exit is used when the OpenAI API does not return a proper response. This can happen for a lot of reasons, for example, if the API is used too much, if the prompt or response is too long, or if it is not accepted.

How to use AI

The usefulness and experienced quality of AI and its different models are dependent on how you use it and what you expect. The model generates text responses based on patterns and information it has learned from a dataset of responses created by humans. This means it will respond to the text but not to its meaning. This is especially evident when asking mathematical questions; it will confidently respond with numbers not knowing if it is the actual result of the math problem.
Here are a few tips to get the best results
  • Provide plenty of context or details to help it better understand what you want as response.
  • Be specific in your request and provide as much detail as possible. This will yield more precise answers.
  • Cross-check information from other reliable sources, especially for critical or factual information.
  • Provide context to your question; this will help recieve more tailored responses.
  • Do not combine questions; instead, break them up into multiple requests. This will result in more focused responses.
If you want to learn more about how to get most out of the OpenAI models, visit the OpenAI documentation here. They offer excellent tips and guides to help you use it as a powerfull tool rather than a gimmick. There are also very useful examples on this page.

Models

Text completion

The most recent version of the GPT model is called "GPT-3", and it is currently available in several different sizes or "variants" ranging from 125 million to 175 billion parameters. The names of the specific API endpoints that correspond to the different GPT-3 variants are as follows:
  • "ada" (with 0.6 billion parameters) (default)
  • "babbage" (with 1.5 billion parameters)
  • "curie" (with 6.7 billion parameters)
  • "davinci" (the largest and most powerful variant, with 175 billion parameters)
So, if you were to use the GPT-3 API, you would specify the variant you want to use by specifying the corresponding API endpoint, such as "davinci" for the largest variant.

Text edits

The text version is trained specifically on large amounts of natural language text, and is particularly adept at generating high-quality, human-like responses to prompts. It can be used for a wide range of natural language processing tasks, such as language translation, summarization, and sentiment analysis.
The code version of the Davinci model is specifically designed to work with programming languages and code. It can be used to generate code snippets based on natural language prompts, and can also be used for code completion and other related tasks. This model is particularly useful for developers and anyone working with code who needs help generating complex code structures quickly.

Image

The image generator uses the DALL-E model, this is a version of GPT-3 trained to generate images from text descriptions, using a dataset of text-image pairs.

Properties

Properties starting with with a * are required inputs.

Chat Completion

This node allows you to create a conversational chatbot that can respond to user input. It uses OpenAI's language model to generate responses based on user input, making it ideal for customer service or other types of conversational applications.
Item
Description
Text Input *Prompt
The text(field) that the AI responds to
Instruction
Give an instruction on how the bot needs to behave.
Model
Choose the AI-model that is used by the node for now only GPT 3.5 Turbo is supported.
Temperature
Level of risk and creativity in generated text. A value between 0 and 2, default is 1, default for chat.openai.com is 0.7.
Maximum number of tokens
Amount of units of text. This can be words, phrases, or individual characters depending on level of granularity.
OpenAI API key
The OpenAI API uses API keys for authentication. Visit the OpenAI website to retrieve the API key you need to use in your requests.
Output Response
Text field from your datamodel. This is where the response of the AI is stored.

Edit Text

The Text version allows you to input a text prompt, and OpenAI will generate an edited version of that text based on the input parameters you provide. This can be useful for tasks such as copy, editing or generating variations of marketing messages.
The Code version, on the other hand, allows you to input a code snippet, and OpenAI will generate an edited version of that code. This can be useful for tasks such as optimizing code or generating new ideas for algorithms.
Item
Description
Text Input *Input
The text(field) that is edited by the AI.
*Instruction
Give an instruction as to what to modify of the existing text.
Model
Choose the AI-model that is used by the node, you can choose between Text or Code Davinci.
Temperature
Level of risk and creativity in generated text. A value between 0 and 2, default is 1, default for chat.openai.com is 0.7.
OpenAI API key
The OpenAI API uses API keys for authentication. Visit the OpenAI website to retrieve the API key you need to use in your requests.
Output Response
Text field from your datamodel. This is where the response of the AI is stored.

Complete Text

This Node allows you to generate a complete text based on a given prompt. This is useful for generating text for various applications like customer service responses and content creation. This Node uses a model that is less powerful for chatbots than the Chat Completion Node.
Item
Description
Text Input *Prompt
The text you want ChatGPT to complete or answer.
Model
Choose the AI-model used on the text. The default is "Ada". Other models.
Temperature
Level of risk and creativity in generated text. A value between 0 and 2, default is 1, default for chat.openai.com is 0.7.
Maximum number of tokens
Amount of units of text. This can be words, phrases, or individual characters depending on level of granularity.
OpenAI API key
The OpenAI API uses API keys for authentication. Visit the OpenAI website to retrieve the API key you need to use in your requests.
Output Response
Text field from your datamodel. This is where the response of the AI is stored.

Create image

This node enables you to generate images using OpenAI's generative model. You can input a text prompt and the node will generate an image based on that text. This is useful for generating graphics, logos, and other types of images.
Item
Description
Text Input *Prompt
Use text or a text field to make a prompt, this is the context you give for the image you want to create.
*File Name
The name for the generated file.
Image Size
The size of the created image in pixels. You can choose 256, 512 or 1024 pixels. Images are always square, with default as default 256 pixels.
OpenAI API key
The OpenAI API uses API keys for authentication. Visit the OpenAI website to retrieve the API key you need to use in your requests.
Output Image
This for a data model field where the image is stored.

Translate audio

This node enables you to translate audio from one language to another. It uses OpenAI's GPT-3 natural language processing capabilities to recognize and translate the spoken language.
Item
Description
Audio Input *File
Audio file in the format of mp3, mp4, mpeg, mpga, m4a, wav or webm.
Prompt
Text to guide the model's style or instruction to continue a previous audio segment. The prompt should be in English
Temperature
Level of risk and creativity in generated text. A value between 0 and 1, default is 1, default for chat.openai.com is 0.7.
OpenAI API key
The OpenAI API uses API keys for authentication. Visit the OpenAI website to retrieve the API key you need to use in your requests.
Output Response
Text field from your datamodel. This is where the response of the AI is stored.

Transcribe Audio

This node transcribes audio files into written text using OpenAI's speech-to-text technology. This is useful for transcribing audio notes, podcasts, or videos. You can find some great tips on how to get better responses here.
Item
Description
Audio Input *File
Audio file in the format of mp3, mp4, mpeg, mpga, m4a, wav or webm.
Prompt
Text to guide the model's style or continue a previous audio segment. The prompt should be in English
Language
The language of the input audio in English. The name has to match with ISO-639-1 format name.
Temperature
Level of risk and creativity in generated text. A value between 0 and 1, default is 1.
OpenAI API key
The OpenAI API uses API keys for authentication. Visit the OpenAI website to retrieve the API key you need to use in your requests.
Output Response
Text field from your datamodel. This is where the response of the AI is stored.