Skip to content

Commit

Permalink
env Variables & README.md updates
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelooblan2016 committed Nov 20, 2023
1 parent 9d72044 commit e75b546
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###################
# OPENAI CHATGPT #
###################
MRX_OPEN_AI_API_KEY=
OPENAI_API_KEY=
# Default: gpt-3.5-turbo
MRX_OPEN_AI_DEFAULT_MODEL=
OPENAI_DEFAULT_MODEL=
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,21 @@ php artisan vendor:publish --provider="Marxolity\OpenAi\Providers\OpenAIServiceP
```
Set up your environment variables:
```bash
MRX_OPEN_AI_API_KEY="<<YOUR_API_KEY>>"
OPENAI_API_KEY="<<YOUR_API_KEY>>"
```
---
## Usage
```php
use \Marxolity\OpenAi\Facades\OpenAi;
```
Retrieve Response Message
Changing Model then Retrieve responseMessage (Ex: Change model to `gpt-4`)
```php
$responseMessage = OpenAi::query("What is Laravel?")
->setModel('gpt-4')
->send()->responseMessage;
```

Retrieve Response Message
```php
$responseMessage = OpenAi::query("What is Laravel?")->send()->responseMessage;
```
Expand Down
4 changes: 2 additions & 2 deletions src/config/ai.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

return [
'open_ai' => [
'api_key' => env('MRX_OPEN_AI_API_KEY'),
'default_model' => env('MRX_OPEN_AI_DEFAULT_MODEL', 'gpt-3.5-turbo'),
'api_key' => env('OPENAI_API_KEY'),
'default_model' => env('OPENAI_DEFAULT_MODEL', 'gpt-3.5-turbo'),
],
];

0 comments on commit e75b546

Please sign in to comment.