Supercharge Your Automation with UiPath and OpenAI Integration
Table of Contents:
- Introduction
- Overview of Open AI Connector
- Exploring Open AI Connector
- Step 1: Accessing Cloud Orchestrator
- Step 2: Navigating to Integration Service
- Step 3: Adding Open AI Connection
- Understanding Open AI Models
- Different Types of Models
- How to Utilize Models
- Getting API Key
- Logging in to Open AI Account
- Retrieving API Key
- Connecting Open AI Connector in Studio
- Using Generate Chat Completion Activity
- Configuring Properties
- Retrieving Response Text
- Using Generate Text Completion Activity
- Configuring Properties
- Retrieving Response Text
- Examining Token Usage
- Checking Completion Tokens
- Analyzing Total Tokens Used
- Use Case: Differentiating Chat Completion and Text Completion
- Conclusion
Exploring Open AI Connector
Open AI Connector is a powerful feature that has been recently integrated into version 23.4 of Automation Cloud Orchestrator. In this video, I will guide You step-by-step on how to use Open AI Connector and explore its various capabilities. We will cover topics such as accessing Cloud Orchestrator, navigating to the Integration Service, adding the Open AI connection, understanding different models, retrieving the API key, connecting Open AI Connector in Studio, and using both the Generate Chat Completion and Generate Text Completion activities. Additionally, we will analyze token usage and discuss a use case to highlight the differences between chat completion and text completion. So, let's dive in and explore the exciting world of Open AI Connector!
Introduction
Welcome to my Channel! In today's video, I will be discussing Open AI Connector, a powerful feature that has been integrated into version 23.4 of Automation Cloud Orchestrator. Open AI Connector allows users to make requests and get completions using large language models supported by Open AI. In this step-by-step tutorial, I will provide an overview of my experiences exploring this feature and demonstrate various actions and activities that can be performed using Open AI Connector. So, let's get started!
Step 1: Accessing Cloud Orchestrator
To begin using Open AI Connector, you need to access your Cloud Orchestrator account. Once logged in, navigate to the Integration Service, which can be found on the left side of the page.
Step 2: Navigating to Integration Service
Click on the Integration Service option to enter the Integration Service page. Here, you will find a range of connections, triggers, and other features. Look for the Open AI connector, which is currently in preview mode. Select the Open AI connector and proceed to the next step.
Step 3: Adding Open AI Connection
In the Open AI connector page, click on the "ADD CONNECTION" button. This will prompt you to provide an API key, which you can obtain from your Open AI account. Login to your Open AI account and navigate to the API references section. If you don't have an API key, Create a new one and copy it for later use. Paste the API key in the designated field and click "CONNECT". Once successfully connected, you will see the name of your Open AI connection in the Integration Service page.
Understanding Open AI Models
Open AI offers a variety of models that can be utilized with Open AI Connector. These models include text DaVinci, chat GPT, and many more. Each model serves different purposes and has its own unique capabilities. It is essential to understand the different models and choose the most suitable one Based on your requirements. If you are unfamiliar with these models, I recommend watching my comprehensive video on my channel, where I explain the concepts of chat GPT, Open AI, and the different language models available.
Getting API Key
To use Open AI Connector, you will need to retrieve your API key from your Open AI account. Simply log in to your Open AI account and go to the API references section. If you don't have an API key, create a new secret key and make a note of it. This API key will be used to establish the connection between Open AI Connector and your account. Remember to keep this key secure, as it grants access to your Open AI resources.
Connecting Open AI Connector in Studio
Once you have obtained the API key, go to the Studio and install the Open AI Package in your automation project. Make sure you are connected to the same tenant as the one in the Integration Service. After installing the package, you can access the Open AI activities. These activities allow you to Interact with Open AI Connector and perform various tasks. Select the desired activity based on your requirements and configure the properties accordingly.
Using Generate Chat Completion Activity
The Generate Chat Completion activity is used to make requests and receive completions from Open AI's language models. Configure the instruction, maximum number of tokens, temperature, and the number of responses. The instruction provides guidance to the model for generating a response. The maximum number of tokens determines the length of the response. The temperature controls the randomness of the response, where a lower value produces more focused output. The number of responses indicates the number of possible completions to generate. Retrieve the response text and analyze the output based on your needs.
Using Generate Text Completion Activity
Similar to the Generate Chat Completion activity, the Generate Text Completion activity enables you to make requests and receive completions. The properties and configurations are similar, but the Generate Text Completion activity is designed for simpler text generation tasks. Configure the instruction, maximum number of tokens, temperature, number of responses, and retrieve the response text for further analysis.
Examining Token Usage
Token usage refers to the number of tokens consumed by the Open AI models for a given request. Tokens represent pieces of text used for processing by the models. It is important to keep track of token usage, as excessive token consumption may result in increased costs. You can check the completion tokens and total tokens used to optimize and manage your resources effectively.
Use Case: Differentiating Chat Completion and Text Completion
To understand the differences between chat completion and text completion, consider a use case where the objective is to generate a pickup line for an ice cream shop brand. By utilizing the Generate Chat Completion activity, you can provide an instruction to generate a pickup line in a specific format. With the Generate Text Completion activity, you can generate text based on a given prompt. By comparing the results from both activities, you can observe the variations in output and choose the approach that best suits your requirements.
Conclusion
In this video, we explored the Open AI Connector feature and learned how to use it step-by-step. We covered topics such as accessing Cloud Orchestrator, navigating to the Integration Service, adding the Open AI connection, understanding models, retrieving API keys, connecting Open AI Connector in Studio, and using the Generate Chat Completion and Generate Text Completion activities. Additionally, we examined token usage and discussed a use case to differentiate between chat completion and text completion. Open AI Connector provides exciting possibilities for language processing and automation, allowing you to leverage the power of AI in your projects. If you found this video helpful, please like it and consider subscribing to my channel for more informative content. Thank you for watching, and I look forward to seeing you in the next video!