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
Name | Description |
---|---|
Input | |
Model | The ID of the model to use for text generation. String variables containing the model ID. |
Prompt | The input prompt for text generation. String variables containing the input prompt. |
Misc | |
Display Name | This property allows you to customize the display name of the activity within the workflow. |
Optional | |
Delay | Specifies 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 Tokens | The maximum number of tokens to generate in the completion. Integer variables containing the maximum token value. |
n | How many completions to generate for each prompt. Integer variables containing the number of completions. |
Temperature | What 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 | |
Response | Outputs 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:
- Drag and drop the "Create Completion" activity onto the workflow.
- Configure the properties by specifying the model, prompt, max tokens, temperature, and the number of completions.
- Optionally, configure the delay before executing the activity.
- 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.