prediction with context
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled

This commit is contained in:
Ovidiu U
2026-04-05 17:08:16 +01:00
parent 0bea50b843
commit 3ccdc28763
9 changed files with 239 additions and 142 deletions

View File

@@ -14,7 +14,7 @@ return new class extends Migration
Schema::create('price_predictions', function (Blueprint $table) {
$table->id();
$table->date('predicted_for')->comment('The date this prediction covers');
$table->enum('source', ['llm', 'ewma']);
$table->enum('source', ['llm', 'llm_with_context', 'ewma']);
$table->enum('direction', ['rising', 'falling', 'flat']);
$table->tinyInteger('confidence')->unsigned()->comment('0100 confidence score');
$table->text('reasoning')->nullable()->comment('LLM explanation or EWMA summary');

View File

@@ -0,0 +1,21 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
public function up(): void
{
if (DB::getDriverName() !== 'sqlite') {
DB::statement("ALTER TABLE price_predictions MODIFY COLUMN source ENUM('llm', 'llm_with_context', 'ewma') NOT NULL");
}
}
public function down(): void
{
if (DB::getDriverName() !== 'sqlite') {
DB::statement("ALTER TABLE price_predictions MODIFY COLUMN source ENUM('llm', 'ewma') NOT NULL");
}
}
};