developh / open-ai
Laravel wrapper for OpenAI api, Code Completion, Text Completion and Image generation
v0.0.1
2023-02-05 04:53 UTC
Requires
- php: ^7.4 || ^8.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2
- illuminate/config: ^8 || ^9 || ^10
- phpunit/phpunit: ^9.5
- vimeo/psalm: ^5.4
README
Environment variables
OPENAI_API_URL=https://api.openai.com/v1
Your secret API keys OpenAI API Keys
OPENAI_API_KEY=SECRET_KEY
Your Organization ID
OPENAI_ORGANIZATION=ORGANIZATION-ID
Text basic completion
OpenAI::textCompletion('Write this is a test');
Text advance completion
OpenAI::model('text-davinci-003') ->temperature(0.25) ->topP(0) ->textCompletion('Write this is a test');