AgentRunStep.php 851 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. /**
  6. * 一次提问里的一步(LLM 调用、工具调用或节点事件)。
  7. *
  8. * 软删除:随所属提问一起软删,数据永久保留。
  9. */
  10. class AgentRunStep extends Model
  11. {
  12. use SoftDeletes;
  13. /**
  14. * 已知的步骤类型。入库时不认识的类型照样存(只记警告,见 AgentTraceService::record),
  15. * 免得 backend 新加一种步骤就整条研究过程被拒。
  16. *
  17. * @var list<string>
  18. */
  19. public const KINDS = ['llm', 'tool', 'route', 'plan', 'retry', 'judge', 'passage', 'answer', 'budget', 'event'];
  20. public $timestamps = false;
  21. protected $guarded = ['id'];
  22. protected $casts = [
  23. 'args' => 'array',
  24. 'started_at' => 'datetime',
  25. ];
  26. }