PHP code example of jesse-bos / openai-commit-messages

1. Go to this page and download the library: Download jesse-bos/openai-commit-messages library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jesse-bos / openai-commit-messages example snippets


return [
    'openai' => [
        // OpenAI model to use for generating commit messages
        'model' => env('OPENAI_COMMIT_MESSAGES_MODEL', 'gpt-4o-mini'),
    ],

    'commit' => [
        // Maximum length for the commit message
        'max_length' => 72,

        // Use conventional commit format (e.g. feat: message, fix: bug)
        'conventional' => true,
    ],
];
bash
php artisan vendor:publish --provider="OpenAI\Laravel\ServiceProvider"
bash
php artisan vendor:publish --tag="openai-commit-messages-config"
bash
php artisan openai:commit-message
bash
php artisan vendor:publish --tag="openai-commit-messages-config"