OpenAI
The OpenAI piece in ZBrain Flow provides direct access to OpenAI's powerful artificial intelligence capabilities. This versatile connector allows you to integrate various OpenAI models and services into your workflows, enabling advanced natural language processing, image generation, audio processing, and structured data extraction. With OpenAI integration, you can enhance your automation with AI-powered text generation, visual understanding, audio transcription, and data transformation capabilities, all without requiring specialized technical knowledge or custom coding.
How to Use OpenAI in ZBrain Flow?
Step 1: Select OpenAI as Your Connection
Click on the '+' button in the Flow and search for OpenAI.
Select OpenAI.
Decide on the action you need, then select it. ZBrain Flow provides several options:
Ask ChatGPT – Interact with OpenAI's ChatGPT models for text generation and conversations.
Ask Assistant – Query OpenAI assistants for specialized responses.
Generate Image – Create images from text descriptions using DALL-E models.
Vision Prompt – Ask questions about or analyze images using multimodal models.
Text-to-Speech – Convert text into natural-sounding speech audio.
Transcribe Audio – Convert speech in audio files to text.
Translate Audio – Convert speech in audio files to translated text.
Extract Structured Data from Text – Transform unstructured text into structured formats.
Custom API Call – Make specialized requests to the OpenAI API.
How to Create AI-generated Text with ChatGPT
Step 1: Connect to OpenAI
From the 'API Key' dropdown, click on 'Select a connection'.
Click ‘Create Connection’ to open the setup window.
Enter the following details:
Connection Name: Enter a recognizable name for your connection.
API Key: Paste your OpenAI API Key, which is required to authenticate and access OpenAI's services.
Click ‘Save’ to complete the connection setup.
Step 2: Select AI Model
Once connected, choose your preferred ChatGPT model from the 'Model' dropdown.
Step 3: Enter Your Prompt
In the 'Question' field, enter the text prompt, request, or question you want ChatGPT to respond to. Be as specific as possible to get the most relevant response.
Step 4: Configure Generation Parameters
Adjust 'Temperature': Higher values (e.g., 0.9) produce more creative responses, while lower values produce more deterministic answers.
Set 'Maximum Tokens' (e.g., 2048): This limits the length of the generated response.
Optional advanced settings:
'Top P': Controls diversity via nucleus sampling.
'Frequency penalty' (0): Reduces repetition of phrases.
'Presence penalty' (0.6): Encourages exploring new topics.
Step 5: Set Up Memory (Optional)
In the 'Memory Key' field, enter a unique identifier if you want to maintain conversation context across multiple steps or workflow runs. Leave empty for stateless, independent responses.
Step 6: Define System Role (Optional)
The 'Roles' field can be inputted with a JSON array that defines how ChatGPT should behave.
How to Query OpenAI Assistants
Step 1: Connect to OpenAI
To connect to your OpenAI account, follow the first step in the "How to Create AI-generated Text with ChatGPT" section above.
Step 2: Select Assistant
Once connected, choose your custom assistant from the 'Assistant' dropdown. This will display all assistants you've created in your OpenAI account.
Step 3: Enter Your Prompt
In the 'Question' field, enter the text prompt, request, or question you want to ask your assistant. Tailor your question to match the assistant's specialized knowledge area.
Step 4: Set Up Memory (Optional)
In the 'Memory Key' field, enter a unique identifier if you want to maintain conversation context across multiple steps or workflow runs.
Leave empty for stateless, independent responses.
How to Generate Images
Step 1: Connect to OpenAI
To connect to your OpenAI account, follow the first step in the "How to Create AI-generated Text with ChatGPT" section above.
Step 2: Configure Image Generation
Select the model you want from the 'Model' field. It should show 'dall-e-3' by default, which is OpenAI's advanced image generation model.
In the 'Prompt' field, enter a detailed description of the image you want to create.
From the 'Resolution' dropdown, select your preferred image size (default is '1024x1024').
From the 'Quality' dropdown, choose between:
'standard' for faster generation with good quality
'hd' for higher detail and quality (takes longer to generate)
How to Analyze Images with AI
Step 1: Connect to OpenAI
To connect to your OpenAI account, follow the first step in the "How to Create AI-generated Text with ChatGPT" section above.
Step 2: Provide an Image
In the 'Image' field, upload an image file or enter a URL to an image you want analyzed.
Step 3: Ask About the Image
In the 'Question' field, enter what you want to know about the image. Be specific to get the most relevant analysis (e.g., "What objects are in this image?").
Step 4: Configure Vision Settings
From the 'Detail' dropdown, select how thoroughly the model should analyze the image:
'auto' (default) lets the model decide based on the image
'low' for faster, more general analysis
'high' for detailed analysis of text and fine details
Step 5: Adjust Response Parameters (Optional)
Set advanced parameters as needed:
'Temperature' controls creativity (default 0.9)
'Maximum Tokens' limits response length
'Top P', 'Frequency penalty', and 'Presence penalty' fine-tune the response style
Step 6: Customize System Role (Optional)
The 'Roles' field allows you to adjust how the AI approaches image analysis.
How to Convert Text to Spoken Audio
Step 1: Connect to OpenAI
To connect to your OpenAI account, follow the first step in the "How to Create AI-generated Text with ChatGPT" section above.
Step 2: Enter Content for Speech
In the 'Text' field, type or paste the content you want converted to speech.
Step 3: Configure Voice Settings
From the 'Model' dropdown, select the text-to-speech model (default is 'tts-1').
Use the 'Speed' field to adjust how quickly the text is spoken (default is 1.0).
From the 'Voice' dropdown, choose your preferred voice style.
Step 4: Set Output Options
From the 'Output Format' dropdown, select your preferred audio format (default is 'mp3').
In the 'File Name' field, enter a name for the generated audio file (without extension).
How to Convert Speech to Text
Step 1: Connect to OpenAI
To connect to your OpenAI account, follow the first step in the "How to Create AI-generated Text with ChatGPT" section above.
Step 2: Upload Audio
In the 'Audio' field, upload the audio file you want to transcribe.
Step 3: Specify Language (Optional)
From the 'Language of the Audio' dropdown, select the spoken language in your recording.
How to Translate Speech to English Text
Step 1: Connect to OpenAI
To connect to your OpenAI account, follow the first step in the "How to Create AI-generated Text with ChatGPT" section above.
Step 2: Upload Audio
In the 'Audio' field, upload the audio file containing the speech.
How to Extract Structured Data from Text
Step 1: Connect to OpenAI
To connect to your OpenAI account, follow the first step in the "How to Create AI-generated Text with ChatGPT" section above.
Step 2: Select AI Model
Once connected, choose your preferred OpenAI model from the 'Model' dropdown.
Step 3: Provide Source Content
In the 'Unstructured Text' field, enter or paste the raw text from which you want to extract structured data. This could be receipts, invoices, reports, articles, or any text containing specific types of information.
Step 4: Define Data Structure
Click 'Add Item' in the 'Data Definition' section to specify each field you want to extract.
For each item, define:
The field name
A description of what the field represents and how to identify it
The data type (string, number, boolean, etc.)
How to Make Custom OpenAI API Requests
Step 1: Connect to OpenAI
To connect to your OpenAI account, follow the first step in the "How to Create AI-generated Text with ChatGPT" section above.
Step 2: Enter API Endpoint
In the 'URL' field, enter the full OpenAI API endpoint you want to call.
Step 3: Select Request Method
From the 'Method' dropdown, choose the appropriate HTTP method (GET, POST, etc.).
Step 4: Configure Headers (Optional)
Click 'Add Item' in the 'Headers' section to add any custom headers. Note that authorization headers are automatically included in your connection.
Step 5: Add Query Parameters (Optional)
Click 'Add Item' in the 'Query Parameters' section to add URL parameters.
Step 6: Specify Request Body
For POST requests, enter the JSON body content according to the OpenAI API documentation.
Step 7: Configure Error Handling (Optional)
Enable 'No Error on Failure' if you want the flow to treat error responses as valid.
Set a 'Timeout' value (in seconds) to limit how long to wait for a response.
Last updated