PSL Format Overview

A PSL file is a valid INI file. INI (short for "initialization") is a configuration file format known for its simplicity and readability.

Structure of an INI File

An INI file is organized into sections, each containing keys with values. Here's a basic structure:

[Section1]
key1 = value1
key2 = value2

[Section2]
keyA = valueA

...

Each section starts with the section name enclosed in square brackets []. Under a section, there are pairs of keys and values separated by an equals sign =.

Advantages of Using INI for PSL Files:

  1. Comments Using `;`:

    • Comments can be introduced anywhere in the INI file by using a semicolon (;).

    • Example:

      ; This is a comment
      key1 = value1
  2. No Need for Quotes:

    • Strings don't require surrounding quotation marks.

    • Example:

      key = text without quotes
  3. Support for Multiline and Multi-paragraph Inputs:

    • Values spanning multiple lines or even paragraphs are supported with straightforward indentation.

    • Example:

      key = This is a lengthy value
           continuing over several lines, maintaining readability.
      
           Here starts another paragraph.
  4. Preserved Indentation:

    • Our INI parser varies slightly from standard parsers. When indentation is used (either with tabs or 4 spaces) inside a key, such as when embedding Python code, this indentation is preserved.

    • Example:

      key = 
          for i in range(3):
              print(i)
  5. Code Within a Key:

    • You can encapsulate entire code within a key.

    • Example:

      key = def hello_world():
              print("Hello, World!")
  6. No Escaping of Control Characters:

    • Characters that often require escaping in other formats can be used directly.

    • Example:

      key = Special characters, like &, can be used directly.

The INI format, combined with our unique parser features, makes it an excellent choice for PSL. It offers creators an intuitive way to define both the configuration and workflow of their GenAI applications.

Last updated