Configuration Path
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 method setPath()
- Using environment variable (recommended)
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
in Settings
class is set, it will use it,
- If INSTRUCTOR_CONFIG_PATHS
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.