Skip to content

Commit

Permalink
Rename Gpt to Embed (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Casmo authored Dec 1, 2023
1 parent 4180eaa commit 516b997
Show file tree
Hide file tree
Showing 26 changed files with 240 additions and 259 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/vormkracht10/laravel-gpt/discussions/new?category=q-a
url: https://github.com/vormkracht10/laravel-embeddings/discussions/new?category=q-a
about: Ask the community for help
- name: Request a feature
url: https://github.com/vormkracht10/laravel-gpt/discussions/new?category=ideas
url: https://github.com/vormkracht10/laravel-embeddings/discussions/new?category=ideas
about: Share ideas for new features
- name: Report a security issue
url: https://github.com/vormkracht10/laravel-gpt/security/policy
url: https://github.com/vormkracht10/laravel-embeddings/security/policy
about: Learn how to notify us for sensitive bugs
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Changelog

All notable changes to `laravel-gpt` will be documented in this file.
All notable changes to `laravel-embeddings` will be documented in this file.
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
},
"autoload": {
"psr-4": {
"Vormkracht10\\LaravelGpt\\": "src/",
"Vormkracht10\\LaravelGpt\\Database\\Factories\\": "database/factories/"
"Vormkracht10\\Embedding\\": "src/",
"Vormkracht10\\Embedding\\Database\\Factories\\": "database/factories/"
}
},
"autoload-dev": {
"psr-4": {
"Vormkracht10\\LaravelGpt\\Tests\\": "tests/"
"Vormkracht10\\Embedding\\Tests\\": "tests/"
}
},
"scripts": {
Expand All @@ -58,10 +58,10 @@
"extra": {
"laravel": {
"providers": [
"Vormkracht10\\LaravelGpt\\LaravelGptServiceProvider"
"Vormkracht10\\Embedding\\EmbeddingServiceProvider"
],
"aliases": {
"LaravelGpt": "Vormkracht10\\LaravelGpt\\Facades\\LaravelGpt"
"Embedding": "Vormkracht10\\Embedding\\Facades\\Embedding"
}
}
},
Expand Down
15 changes: 15 additions & 0 deletions config/embed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

// config for Vormkracht10/Embeddings
return [
'enabled' => env('EMBED_ENABLED', true),
'driver' => env('EMBED_DRIVER', 'openai'),
'queue' => true,
'database' => [
'connection' => env('EMBED_DATABASE_CONNECTION', 'pgsql'),
'table' => env('EMBED_DB_TABLE', 'embeddings'),
],
'openai' => [
'key' => env('OPENAI_API_KEY'),
],
];
15 changes: 0 additions & 15 deletions config/gpt.php

This file was deleted.

2 changes: 1 addition & 1 deletion database/factories/ModelFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Vormkracht10\LaravelGpt\Database\Factories;
namespace Vormkracht10\Embedding\Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
{
public function __construct()
{
$this->connection = config('gpt.database.connection');
$this->connection = config('embed.database.connection');
}

public function up()
{
if (Schema::connection($this->connection)->hasTable(config('gpt.database.table'))) {
if (Schema::connection($this->connection)->hasTable(config('embed.database.table'))) {
return;
}

Schema::create(config('gpt.database.table'), function (Blueprint $table) {
Schema::create(config('embed.database.table'), function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('foreign_id');
$table->text('content');
$table->timestamps();
});

$tableName = config('gpt.database.table');
$tableName = config('embed.database.table');

DB::statement("ALTER TABLE {$tableName} ADD COLUMN embedding vector(1536) NULL;");
}
Expand Down
19 changes: 0 additions & 19 deletions database/migrations/create_gpt_table.php.stub

This file was deleted.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Vormkracht10\LaravelGpt\Commands;
namespace Vormkracht10\Embedding\Commands;

use Illuminate\Console\Command;

class LaravelGptCommand extends Command
class LaravelEmbedCommand extends Command
{
public $signature = 'laravel-gpt';
public $signature = 'laravel-embed';

public $description = 'My command';

Expand Down
43 changes: 43 additions & 0 deletions src/Embed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace Vormkracht10\Embedding;

use Vormkracht10\Embedding\Jobs\MakeEmbeddable;
use Vormkracht10\Embedding\Jobs\RemoveFromEmbed;

class Embed
{
/**
* The job class that should make models searchable.
*
* @var string
*/
public static $makeEmbeddableJob = MakeEmbeddable::class;

/**
* The job that should remove models from the search index.
*
* @var string
*/
public static $removeFromEmbedJob = RemoveFromEmbed::class;

/**
* Specify the job class that should make models searchable.
*
* @return void
*/
public static function makeEmbeddableUsing(string $class)
{
static::$makeEmbeddableJob = $class;
}

/**
* Specify the job class that should remove models from the search index.
*
* @return void
*/
public static function RemoveFromEmbedUsing(string $class)
{
static::$removeFromEmbedJob = $class;
}
}
Loading

0 comments on commit 516b997

Please sign in to comment.