Breadcrumbs

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

Name

Reference

Type

Required

Default

Options

Description

Model

CHATGPT_MODEL

Select

gpt-5

GPT-5: gpt-5

GPT-5-Mini: gpt-5-mini

GPT-5-Nano: gpt-5-nano

GPT-4.1: gpt-4.1

Model to use.

Prompt

CHATGPT_PROMPT

Alphanumeric

-

-

Prompt that will be sent to ChatGPT.

Input File Name Match Type

CHATGPT_INPUT_MATCH_TYPE

Select

exact_match

Exact: 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 Name

CHATGPT_INPUT_FILE_NAME

Alphanumeric

-

-

Used to either look for one file via an exact match, or to find multiple files matching a regex pattern.

Input Folder Name

CHATGPT_INPUT_FOLDER_NAME

Alphanumeric

-

-

Name of the folder to look for the input file(s) in. If not provided, defaults to the current directory.

Output File Name

CHATGPT_OUTPUT_FILE_NAME

Alphanumeric

-

-

Name of the .txt file where ChatGPT's response will be saved.

Output Folder Name

CHATGPT_OUTPUT_FOLDER_NAME

Alphanumeric

-

-

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 Search

CHATGPT_WEBSEARCH

Boolean

False

-

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