<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('chat_gpt_log', function (Blueprint $table) {
            $table->id();
            $table->string("ai_type")->comment("moonshot:kimi spark:讯飞星火 ernie:文心一言");
            $table->integer("user_id")->nullable()->comment("用户id");
            $table->string("role")->comment("对话角色 user:用户 system|assistant:系统");
            $table->text("content")->comment("对话内容");
            $table->text("init_content")->comment("原始对话数据");
            $table->string("scene")->nullable()->comment("场景");
            $table->timestamps();
        });
    }

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