Skip to main content
Skip table of contents

ChatGPT - Generate Response From File

Overview

You will need the following:

  • Open AI credentials for PMG
  • File(s) to be uploaded for parsing. Most common types are supported, including but not limited to: .txt, .pdf, .csv, .png, .jpeg, .py...

Variables

NameReferenceTypeRequiredDefaultOptionsDescription
ModelCHATGPT_MODELSelectgpt-5GPT-5: gpt-5

GPT-5-Mini: gpt-5-mini

GPT-5-Nano: gpt-5-nano

GPT-4.1: gpt-4.1
Model to use.
PromptCHATGPT_PROMPTAlphanumeric--Prompt that will be sent to ChatGPT.
Input File Name Match TypeCHATGPT_INPUT_MATCH_TYPESelectexact_matchExact: exact_match

Regex: regex_match
Determines if the text in "File Name" is the exact name of a singular file to look for, or a regex pattern to look for multiple files.
Input File NameCHATGPT_INPUT_FILE_NAMEAlphanumeric--Used to either look for one file via an exact match, or to find multiple files matching a regex pattern.
Input Folder NameCHATGPT_INPUT_FOLDER_NAMEAlphanumeric--Name of the folder to look for the input file(s) in. If not provided, defaults to the current directory.
Output File NameCHATGPT_OUTPUT_FILE_NAMEAlphanumeric--Name of the .txt file where ChatGPT's response will be saved.
Output Folder NameCHATGPT_OUTPUT_FOLDER_NAMEAlphanumeric--Folder where the generated .txt file will be saved. If the folder does not exist, it will be created. Defaults to the current directory if not provided.
Web SearchCHATGPT_WEBSEARCHBooleanFalse-If True, lets ChatGPT search the web for new information while answering the prompt. Be advised: This feature will add more runtime to your task.

YAML

Below is the YAML template

YAML

source:
  template: ChatGPT - Generate Response From File
  inputs:
    CHATGPT_MODEL: gpt-5
    CHATGPT_PROMPT:
    CHATGPT_INPUT_MATCH_TYPE: exact_match
    CHATGPT_INPUT_FILE_NAME:
    CHATGPT_INPUT_FOLDER_NAME:
    CHATGPT_OUTPUT_FILE_NAME:
    CHATGPT_OUTPUT_FOLDER_NAME:
    CHATGPT_WEBSEARCH: false
  type: TEMPLATE
guardrails:
  retry_count: 1
  retry_wait: 0h0m0s
  runtime_cutoff: 1h0m0s
  exclude_exit_code_ranges:
    - 13
    - 201
    - 202
    - 203

      
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.