RPA.OpenAI

Library to support OpenAI and Azure OpenAI services.

Library is not included in the rpaframework package, so in order to use it you have to add rpaframework-openai with the desired version in your conda.yaml file.

Robot Framework example usage

*** Settings *** Library RPA.Robocorp.Vault Library RPA.OpenAI *** Tasks *** Create a text completion ${secrets} Get Secret secret_name=OpenAI Authorize To OpenAI api_key=${secrets}[key] ${completion} Completion Create ... Write a tagline for an ice cream shop ... temperature=0.6 Log ${completion}

Python example usage

from RPA.Robocorp.Vault import Vault from RPA.OpenAI import OpenAI secrets = Vault().get_secret("OpenAI") baselib = OpenAI() baselib.authorize_to_openai(secrets["key"]) result = baselib.completion_create( Create a tagline for icecream shop', temperature=0.6, ) print(result)