# OpenAI

The OpenAI actions allow you to interact with OpenAI API endpoints. These actions work with specified OpenAI accounts which are defined in a given scenario.

This connector uses an API key to authenticate with the API endpoints. The API key can be retrieved while logged into the OpenAI website. It is found via the "View API keys" selection on the account menu.

# Completions

Action Function: This action calls the "completions" OpenAI endpoint

Endpoint API Documentation (opens new window)

Action Properties:

Label

A label for the action

Scenario

The name of the scenario in the connector configuration document.

Model

The ID of the model to use.

Prompt

The prompt for which to generate completions.

Temperature

The value of the sampling temperature to use. Values range from 0-1. The higher the value, the more the model will take risks.

Max Tokens

The maximum number of tokens the model will generate for the completion.

Top P

An alternative to sampling with temperature. See the link below for more details.

Top P Definition Link (opens new window)

Frequency Penalty

A number value between -2.0 and 2.0. See the link below for more details.

Frequency Penalty Link (opens new window)

Presence Penalty

A number value between -2.0 and 2.0. See the link below for more details.

Presence Penalty Link (opens new window)

Web Timeout

The length of time the request is given before it times out. Leave blank for a default timeout.

Request Status Variable

The HTTP status will be returned in this variable.

Response Variable

The HTTP response will be returned in this variable.

Error Message Variable

An error message (if an error occurred) will be returned in this variable.

Action Outputs

  • Success - The action executed successfully

  • Failure - An issue was encountered

# Completions Request

Action Function: This action also calls the "completions" OpenAI endpoint. This action allows the designer to pass in a JSON request body instead of specifying values in separate properties.

Endpoint API Documentation (opens new window)

Action Properties:

Label

A label for the action

Scenario

The name of the scenario in the connector configuration document.

Request Body

The JSON request body. See the link below for more details.

Request Body Link (opens new window)

Web Timeout

The length of time the request is given before it times out. Leave blank for a default timeout.

Request Status Variable

The HTTP status will be returned in this variable.

Response Variable

The HTTP response will be returned in this variable.

Error Message Variable

An error message (if an error occurred) will be returned in this variable.

Action Outputs

  • Success - The action executed successfully

  • Failure - An issue was encountered