πŸ—£οΈEnv. Variables

Ensure the safe storage and retrieval of sensitive information via environment variables, maintaining confidentiality while facilitating usage within test prompts.

  1. Access GPT Driver Settings

    • Navigate to the "Env Variables" section within the GPT Driver Settings.

  2. Add a New Environment Variable

    • Select the "Add Env Variable" option.

  3. Input Key and Value

    • Enter the necessary information in the provided fields:

      • Key: Assign a name/label to your variable (e.g., 'api-token').

      • Value: Input the actual token associated with the key.

  4. Secure Entry for Confidentiality

    • Locate the checkbox labeled 'Secure Entry: Omit Value from Interfaces and Logs.'

    • Check this box to ensure the value remains hidden from interfaces and logs for added security.

  5. Usage in Test Prompts

    • To utilize this variable in test prompts, follow this format:

      • Enclose the variable name within double curly brackets with 'env.' followed by your chosen key:

      {{env.api-token}}

    • This format also mirrors how timestamps are utilized.

The inclusion of double quotations (") around the environment variable {{env.variable}} is not required.


How to use a stored secret Env. Variable in a Curl Command

  1. An example of a typical CURL command might include the following:

    • Perform a DELETE request to clean a user account before initiating a test.

curl -X DELETE "https://api.example.com/users/123/order-history" -H "Authorization: Bearer {{env.apitoken}}"

Last updated