<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('ai_settings', function (Blueprint $table) {
            $table->id();
            $table->string('provider');          // openai | ollama | lmstudio | custom
            $table->string('name');              // Ayar adı  (örn: "Ollama – Llama2")
            $table->string('api_key')->nullable();
            $table->string('api_url', 500);
            $table->string('model');
            $table->text('system_prompt')->nullable();
            $table->boolean('is_active')->default(false);
            $table->integer('max_tokens')->default(1000);
            $table->decimal('temperature', 3, 1)->default(0.7);
            $table->integer('max_history')->default(10);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('ai_settings');
    }
};
