Internals
Configuration Path
How to set up location of Instructor configuration directory for your project
Instructor comes with a set of configuration files and prompt templates that you can publish to your project directory.
There are 2 ways to set up the location of Instructor’s configuration directory:
- Using
Settings
class methodsetPath()
- Using environment variable (recommended)
To check how to publish configuration files to your project see Setup section.
Setting Configuration Path via Settings
Class
You can set Instructor configuration path using the Settings::setPath()
method:
Setting Configuration Path via Environment Variable
You can set the path to Instructor’s configuration directory in your .env
file:
Configuration Location Resolution
Instructor uses a configuration directory with a set of .php
files to store its settings, e.g. LLM provider configurations.
Instructor will look for its configuration location in the following order:
- If static variable value
$path
inSettings
class is set, it will use it, - If
INSTRUCTOR_CONFIG_PATH
environment variable is set, it will use its value, - Finally, it will default to the directory, which is bundled with Instructor package (under
/config
) and contains default set of configuration files.