Skip to content

Commit

Permalink
Set driver to 'null' as default driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Casmo committed May 15, 2024
1 parent 8907240 commit 4292221
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,31 @@ This is the contents of the published config file:

```php
return [
'enabled' => env('EMBEDDINGS_ENABLED', true),
'driver' => env('EMBEDDINGS_DRIVER', 'null'), // 'null' / 'openai'
'queue' => true,
'database' => [
'connection' => env('EMBEDDINGS_DATABASE_CONNECTION', 'pgsql'),
'table' => env('EMBEDDINGS_DB_TABLE', 'embeddings'),
],
'openai' => [
'key' => env('OPENAI_API_KEY'),
],

/*
|--------------------------------------------------------------------------
| Chunk Sizes
|--------------------------------------------------------------------------
|
| These options allow you to control the maximum chunk size when you are
| mass importing data into the embed engine. This allows you to fine
| tune each of these chunk sizes based on the power of the servers.
|
*/
'chunk' => [
'embeddable' => 500,
'unembeddable' => 500,
],
];
```

Expand Down
5 changes: 3 additions & 2 deletions src/EngineManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ public function forgetEngines()
*/
public function getDefaultDriver()
{
if (is_null($driver = config('embeddings.driver'))) {
return 'openai';
$driver = config('embeddings.driver');
if (is_null($driver)) {
return 'null';
}

return $driver;
Expand Down

0 comments on commit 4292221

Please sign in to comment.