XenoGuard 4.0 Documentation

Generate Text

ActionStep Reference » OpenAI » Text » Generate Text

The OpenAI Text Generation ActionStep is an advanced automation feature designed for generating text using OpenAI's language models. Text generation can serve various purposes, including content creation, language translation, summarization, and chatbot dialogue. For example, it can generate articles, stories, or poems based on a given theme, translate sentences into different languages, condense long documents into concise summaries, or simulate conversation by providing responses in a chat. The command instructs the AI on how to craft the text, ensuring that the output is aligned with the intended use case, such as drafting an email, composing creative writing, or generating technical reports.

[-] Hide
  1. Open the OpenAI node in the Workspace Explorer.
  2. In the OpenAI node, select the Generate Text ActionStep.

Parameters:

The ActionStep has the following input parameters:


Name Description
API Key
The unique identifier required to authenticate and use OpenAI's API services.

Allowed Context Scopes
 [Fixed, Local, Global, Reference]
Allowed Context Types [Fixed, Variable, Parameter, Result, Enum]
Allowed Context Values [String]
Output Type
Specifies the format of the generated content (e.g., text, HTML, JSON).

Allowed Context Scopes
 [Fixed, Local, Global, Reference]
Allowed Context Types [Fixed, Variable, Parameter, Result, Enum]
Allowed Context Values [String]
Document Name
The name assigned to the document where the generated text will be stored.

Allowed Context Scopes
 [Fixed, Local, Global, Reference]
Allowed Context Types [Fixed, Variable, Parameter, Result, Enum]
Allowed Context Values [String]
Destination Path
File path where the document will be saved.

Allowed Context Scopes
 [Fixed, Local, Global, Reference]
Allowed Context Types [Fixed, Variable, Parameter, Result, Enum]
Allowed Context Values [String]
Command
The specific text command or prompt to be processed by OpenAI's model.

Allowed Context Scopes
 [Fixed, Local, Global, Reference]
Allowed Context Types [Fixed, Variable, Parameter, Result, Enum]
Allowed Context Values [String]
Timeout
The maximum duration in milliseconds for the API request to wait for a response.

Allowed Context Scopes
 [Fixed, Local, Global, Reference]
Allowed Context Types [Fixed, Variable, Parameter, Result, Enum]
Allowed Context Values [Int64]
Model
Designates which OpenAI model to use for text generation (e.g., GPT-3, GPT-4).

Allowed Context Scopes
 [Fixed, Local, Global, Reference]
Allowed Context Types [Fixed, Variable, Parameter, Result, Enum]
Allowed Context Values [String]
Temperature
A parameter ranging from 0 to 1 that controls the randomness of the generated text. A higher temperature results in more creative responses.

Allowed Context Scopes
 [Fixed, Local, Global, Reference]
Allowed Context Types [Fixed, Variable, Parameter, Result, Enum]
Allowed Context Values [Double]
Maximum Tokens
The upper limit on the number of tokens (words and characters) in the generated response.

Allowed Context Scopes
 [Fixed, Local, Global, Reference]
Allowed Context Types [Fixed, Variable, Parameter, Result, Enum]
Allowed Context Values [Int64]
Placeholders
Optional placeholders that can be included in the text for specific purposes.

Allowed Context Scopes
 [Fixed]
Allowed Context Types [Fixed]

Results:

The ActionStep returns the following results:

name Description
Success
A boolean value indicating whether the OpenAI request was successful.

Allowed Context Scopes
 [Fixed]
Allowed Context Types [Fixed]
Allowed Context Values [Boolean]
Number Of Lines
The count of sentences or lines in the generated text.

Allowed Context Scopes
 [Fixed]
Allowed Context Types [Fixed]
Allowed Context Values [Int64]
Lines
A result list containing the individual sentences or lines of the generated text.

Allowed Context Scopes
 [Fixed]
Allowed Context Types [Fixed]

Example 1 (Generate Fantasy Dutch User Address Table):

This ActionScript initiates an OpenAI text generation task. It's set up to use an API key for authentication, with the command to create a fantasy table of Dutch users' addresses. The output is plain text, and it has not specified a destination path, meaning it might be outputted to a default location or remain in-memory The expected result from this ActionScript is a success indicator and the generated text, aimed to be a list with 10 lines of fantasy addresses, each line containing last name, first name, and date of birth. The script includes a loop to iterate over each line of the result.



See other operations:

Chat
Classify Text