Skip to main content

Create Completion

AutomatR.ChatGPT.Activities.CreateCompletion

The "Create Completion" activity in AutomatR facilitates text completion using the OpenAI GPT model. This activity sends a POST request to the OpenAI API with specified parameters, retrieves the generated completion text, and outputs the result in the form of a ChatCompletion data type.

Properties

NameDescription
Input
ModelThe ID of the model to use for text generation. String variables containing the model ID.
PromptThe input prompt for text generation. String variables containing the input prompt.
Misc
Display NameThis property allows you to customize the display name of the activity within the workflow.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Create Completion" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.
Max TokensThe maximum number of tokens to generate in the completion. Integer variables containing the maximum token value.
nHow many completions to generate for each prompt. Integer variables containing the number of completions.
TemperatureWhat sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. Double variables containing the temperature value.
Output
ResponseOutputs the result of the "Create Completion" operation as a ChatCompletion data type. Variables of type ChatCompletion to store the generated completion result.

How to use:

  1. Drag and drop the "Create Completion" activity onto the workflow.
  2. Configure the properties by specifying the model, prompt, max tokens, temperature, and the number of completions.
  3. Optionally, configure the delay before executing the activity.
  4. Execute the workflow to generate text completions based on the provided input.

Example: Consider an example where the "Create Completion" activity is used to generate completions for a user prompt:

Create Completion:
Model: "gpt-3.5-turbo"
Prompt: "Tell me a story about robots."
Max Tokens: 50
Temperature: 0.8
n: 1
Response: completionResult

In this example, the activity generates a text completion for the user's prompt, "Tell me a story about robots," using the GPT-3.5-turbo model with a maximum of 50 tokens, a temperature of 0.8, and a single completion. The resulting completion is stored in the variable "completionResult" for further use in the workflow.