OpenAI library

Overview

Overview

The OpenAI library allows users to perform TextCompletion and ChatCompletion in conjunction with the OpenAI server.

The features provided by the OpenAI library are as follows:

Common Properties

Common Properties

MORE OPTIONS

MORE OPTIONS properties

Properties

Type

Required

Unit

Auto-setting

Description

On Error

Combination box

N

-

N

Specify an action to carry out when an error occurs at the time of execution.

- If not specified: Output errors and exit the task.

- --Ignore--: Ignore the error.

- --Retry--: Try the activity one more time.

- --Goto--: Try the scenario for the specified time if the activity fails.

- _Event: Select an event created within the project.

DESCRIPTION

Properties

Type

Required

Unit

Auto-Setting

Description

DESCRIPTION

Text

N

-

N

Enter the description for the activity card. The Description entered in the DESCRIPTION field is used as an description of the property. A representative value will be displayed in the absence of the DESCRIPTION input.

MaxTokens first checks the range of tokens to be set when calling in advance.

All Tokens, including Header and Prompt, are judged by the solution, and all Tokens can be known as the result of the call.

TextCompletion

TextCompletion

Overview

This activity card calls the OpenAI Text Completion API.

Application procedures

  1. In the [Output] field, enter the variable to store the response result in RESULT.

  2. In the [Output] field, brings the first text result in choices among the response results to TextRESULT.

  3. Enter API Token in API Token.

Card properties

Common

Properties

Type

Required

Unit

Auto-setting

Description

N

[Output] RESULT

Variable

Y

-

Y

Enter a variable to save the entire response result.

N

[Output] TextRESULT

Variable

Y

-

Y

Enter a variable to store the first text result in choices.

N

API Token

Variable

Y

-

N

Enter the API Token.

- Normal: The entered API Token is saved as plain text.

- Credential: The entered API Token is encrypted. (Retrieved from shared resources.)

- Secure: The entered API Token is encrypted and stored.

N

Model

Combo Box

Y

-

Y

Select the model to use.

- text-ada-001

- text-babbage-001

- text-curie-001

- text-davinci-002

- text-davinci-003

N

MaxTokens

Number

N

-

Y

Enter MaxTokens.

N

Prompt

String

N

-

Y

Enter Prompt.

N

Suffix

String

N

-

N

Enter the Suffix (the suffix after which the inserted text is complete). It is visible only when the model is text-davinci-002 or text-davinci-003.

N

Temperature

Number

N

-

Y

Enter Temperature (random).

N

TopP

Number

N

-

Y

Enter the TopP (how much to consider a token in its upper probability mass).

N

N

Number

N

-

Y

Enter N (the number of completions to generate for each prompt).

N

LogProbs

Number

N

-

N

Enter LogProbs (which contains the most likely token and log probabilities for the selected token).

N

Echo

Toggle button

N

-

N

Select Echo (Repeat Prompt with Done?).

N

Stop

String

N

-

N

Enter Stop (list of tokens to stop generating).

N

PresencePenalty

Number

N

-

Y

Enter a PresencePenalty (which increases the likelihood of speaking on a new topic).

N

FrequencyPenalty

Number

N

-

Y

Enter a FrequencyPenalty (reduces the chance of repeating the same line verbatim).

N

BestOf

Number

N

-

Y

Enter BestOf (the number of item candidate completions with the highest log probability per token).

N

User

String

N

-

N

Enter User.

Y

MORE OPTIONS

-

-

-

-

Common property of OpenAI libraries.

Y

DESCRIPTION

-

-

-

-

Common property of OpenAI libraries.

Example of utilization

Call the OpenAI Text Completion API.

TextCompletion_OpenAI

Sample file

Used variables

RESULT = variable to store the entire response result
TextRESULT = A variable to store the first text result in choices among response results
Global.apiToken = API Token

Used Properties

Related/Similar Activities

ChatCompletion

ChatCompletion

ChatCompletion

Overview

This activity card calls the OpenAI Chat Completion API.

Application procedures

  1. In the [Output] field, enter a variable to save the response result in RESULT.

  2. The [Output] field, brings the first text result in choices among response results to TextRESULT.

  3. Enter API Token in API Token.

Card properties

Common

Properties

Type

Required

Unit

Auto-settings

Description

N

[Output] RESULT

Variable

Y

-

Y

Enter a variable to save the entire response result.

N

[Output] TextRESULT

Variable

Y

-

Y

Enter a variable to store the first text result in choices.

N

API Token

Variable

Y

-

N

Enter the API Token.

- Normal: The entered API Token is saved as plain text.

- Credential: The entered API Token is encrypted. (Retrieved from shared resources.)

- Secure: The entered API Token is encrypted and stored.

N

Model

Combo box

Y

-

Y

Select the model to use.

-gpt-3.5-turbo

- gpt-3.5-turbo-0301

-gpt -4-gpt -4-0314

- gpt-4-32k

- gpt-4-32k-0314

N

MaxTokens

Number

N

-

Y

Enter MaxTokens.

N

Prompt

String

Y

-

Y

Enter Prompt.

N

Instruction

String

N

-

N

Enter a description and instructions for the system role.

N

Temperature

Number

N

-

Y

Enter Temperature (random).

N

TopP

Number

N

-

Y

Enter the TopP.

N

N

Number

N

-

Y

Enter N (the number of completions to generate for each prompt).

N

Stop

String

N

-

N

Enter Stop (list of tokens to stop generating).

N

PresencePenalty

Number

N

-

Y

Enter a PresencePenalty (which increases the likelihood of speaking on a new topic).

N

FrequencyPenalty

Number

N

-

Y

Enter a FrequencyPenalty (reduces the chance of repeating the same line verbatim).

N

User

String

N

-

N

Enter User.

Y

MORE OPTIONS

-

-

-

-

Common property of OpenAI libraries.

Y

DESCRIPTION

-

-

-

-

Common property of OpenAI libraries.

Example of utilization

Call the OpenAI Text Completion API.

Chatcompletion

Sample file

Used variables

RESULT = variable to store the entire response result
TextRESULT = A variable to store the first text result in choices among response results
Global.apiToken = API Token

Used Properties

Related/Similar Activities

TextCompletion