/
Robot Framework's OpenAI Library

Robot Framework's OpenAI Library

The OpenAI library of Robot Framework provides a set of keywords to leverage the capabilities of OpenAI and Azure OpenAI programmatically.

 

Prerequisites

Before using this library, please note the following points:

  • An OpenAI or Azure OpenAI account is required to use this library. It is essential to set up an API key in the corresponding account.

  • The use of the library is subject to the restrictions of the OpenAI subscription.

  • Available features are limited to data accessible through OpenAI.

 

Available Keywords

The Robot Framework OpenAI library offers the following keywords:

  1. Authorize To Azure Openai

    • Authorizes access to Azure OpenAI.

  2. Authorize To Openai

    • Authorizes access to OpenAI using your API key obtained from your account.

  3. Chat Completion Create

    • Creates ChatGPT text completions using OpenAI or Azure OpenAI.

    • Returns the response as a string and message history as a list.

  4. Completion Create

    • Creates text completions using OpenAI and Azure OpenAI.

    • Returns a text string.

  5. Image Create

    • Creates one or more images using OpenAI.

    • Returns a list of URLs for the created images.

    • Not supported for Azure OpenAI.

  6. Image Create Variation

    • Creates one or more variations of an image.

    • Returns a list of URLs for the created images.

    • The source file must be a valid PNG file, less than 4 MB, and square-shaped.

    • Not supported for Azure OpenAI.

 Comprehensive documentation for this library is available on the Robot Framework website.

 

Usage

To use this feature, use the appropriate keywords from the Robot Framework OpenAI library to access the functionalities of OpenAI and Azure OpenAI.

 

Example Usage

image-20240311-232746.png
image-20240311-233036.png

Remember to create a secret variable in which you will put your OpenAI API key.

 

Related content

Script Runner
Script Runner
Read with this
Librairie OpenAI de Robot Framework
Librairie OpenAI de Robot Framework
More like this
Version 3.5.0 (2024/03/14)
Version 3.5.0 (2024/03/14)
More like this
Version 3.0.8 (2022/07/01)
Version 3.0.8 (2022/07/01)
More like this
Version 3.4.0 (2023/09/19) 
Version 3.4.0 (2023/09/19) 
More like this

©️2023 Alithya GoTest - All Rights Reserved
Need Help? You have a suggestion?