-
Config Model (
src/Models/Config.php):- Add
custom_fieldsproperty. - Add
getCustomFields()method to retrieve the configuration. - Add
setCustomFieldValue(string $key, string $value)to update/store field values at runtime. - In the constructor or a loading method, correctly parse the
custom_fieldsarray fromgpt.json.
- Add
-
Provider (
src/Provider/BaseProvider.php):- Add a protected property
protected array $customFieldValues = [];. - Add a public method
setCustomFieldValues(array $values). - In
setConfig(Config $config), callsetCustomFieldValues()with any values from the config. - In
buildSystemPrompt(), iterate through$customFieldValuesand replace{{key}}placeholders in$this->systemPromptwith their corresponding values.
- Add a protected property
-
Chat Command (
src/Command/ChatCommand.php):- Argument Parsing:
- Define a new
--setoption that accepts key-value pairs (e.g.,--set pizza_region="New York"). This option should be repeatable for multiple fields. - In
execute(), parse all--setarguments and store them.
- Define a new
- Value Resolution Logic:
- In
execute(), after loading the GPT config, determine the final value for each custom field by checking in this order of priority:- Value from
--setcommand-line argument. - Pre-defined
valueingpt.json. - Value from interactive prompt.
defaultvalue fromgpt.json.
- Value from
- In
- Interactive Prompts:
- For each custom field that still needs a value, prompt the user interactively.
- Use Symfony Question Helper's
Questionfortexttype. - Use Symfony Question Helper's
ChoiceQuestionfordropdowntype.
- Provider Integration:
- Collect all final custom field values.
- Pass the values to the provider instance using
setCustomFieldValues().
- Argument Parsing:
- Add support for more providers via LLPhant
- OpenAI
- Anthropic
- Groq
- Ollama
- DeepSeek
- Grok
- Grok 2
- Expose a public PHP API for using LocalGPT, with LLPhant as the backend.
- Create a "System Prompt Builder" agent using LLPhant to interactively define a GPT's persona.
- Implement reference file handling by using LLPhant's embedding and retrieval features.
- Implement chat history persistence using LLPhant's chat history features.