Download the PHP package ashleyhindle/laravel-ai-autofill without Composer
On this page you can find all versions of the php package ashleyhindle/laravel-ai-autofill. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ashleyhindle/laravel-ai-autofill
More information about ashleyhindle/laravel-ai-autofill
Files in ashleyhindle/laravel-ai-autofill
Package laravel-ai-autofill
Short Description Easily autofill model properties with AI
License MIT
Homepage https://github.com/ashleyhindle/laravel-ai-autofill
Informations about the package laravel-ai-autofill
Autofill model properties with AI
This package listens to the saved
model event, then adds a queued job that autofills the properties from either OpenAI, Anthropic or Ollamo, using 1 API query per model.
Example: When this article is saved the 'tagline' property will be automatically filled by an AI generated string that's a 'ridiculous click-bait tagline'
Installation
Setup
You'll then have a config/ai-autofill.php
file that sets up your providers. You'll need to ensure you have the necessary .env
variables setup.
The key ones are:
Usage
Model Trait Usage
Simply use the trait in your model, and add the $autofill
array with the keys as the properties you want to autofill, and the values as the prompts you want to use to fill them.
The model name and model properties, except $autofillExclude
properties, are provided to the LLM for context, so the prompts in $autofill
can be very simple.
Example:
Testing
Credits
- Ashley Hindle
- Kathryn Reeve
- Nik Spyratos
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
TODO
- [ ] Handle OpenAI failures more gracefully
- [ ] Add config file support
- [ ] Allow overriding system prompt
- [ ] Allow setting queue name and max attempts
- [ ] Enable prompt creation through PHP Attributes
All versions of laravel-ai-autofill with dependencies
illuminate/contracts Version ^10.0||^11.0
openai-php/laravel Version ^0.10.1
spatie/laravel-package-tools Version ^1.16