Block untemplated requestsv3.6+

Configure the AI Prompt Template plugin with a template and block any requests that don’t include a template.

Prerequisites

Set up the plugin

Add this section to your declarative configuration file:

_format_version: "3.0"
plugins:
  - name: ai-prompt-template
    config:
      allow_untemplated_requests: false
      templates:
      - name: developer-chat
        template: |-
          {
              "messages": [
              {
                  "role": "system",
                  "content": "You are a {{program}} expert, in {{language}} programming language."
              },
              {
                  "role": "user",
                  "content": "Write me a {{program}} program."
              }
            ]
          }
Copied to clipboard!

Did this doc help?

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!