Skip to main content

ChatGPT - Generate Response

Overview​

First time using this Blueprint? Make sure you follow our ChatGPT authorization guide.​

Sends a prompt to ChatGPT and returns the message. The results will be printed in the console and saved in a text file. If you generate multiple responses, the file name will have an added suffix.

Variables​

NameReferenceTypeRequiredDefaultOptionsDescription
API KeyCHATGPT_API_KEYPasswordβœ…--API Key form OpenAI
Number of ResponsesCHATGPT_RESPONSESIntegerβœ…1-The number of chat completion choices to generate for each input message. Defaults to 1
RandomnessCHATGPT_RANDOMNESSFloating_Pointβž–1-What sampling temperature to use, between 0 and 2. Higher values like 1.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
PromptCHATGPT_PROMPTAlphanumericβœ…--Prompt that will be sent to ChatGPT
Local File NameCHATGPT_DESTINATION_FILE_NAMEAlphanumericβœ…--The name for the txt file once it is generated. If more than one response is generated, the files will have counted suffixes (file.txt, file_1.txt,...)

YAML​

Below is the YAML template for this Blueprint and can be used in the Fleet YAML Editor.

source:
blueprint: ChatGPT - Generate Response
inputs:
CHATGPT_API_KEY: null ## REQUIRED
CHATGPT_RESPONSES: '1' ## REQUIRED
CHATGPT_RANDOMNESS: '1'
CHATGPT_PROMPT: null ## REQUIRED
CHATGPT_DESTINATION_FILE_NAME: null ## REQUIRED
type: BLUEPRINT
guardrails:
retry_count: 1
retry_wait: 0h0m0s
runtime_cutoff: 1h0m0s
exclude_exit_code_ranges:
- '0'