AgentTraceResource.php 774 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Http\Resources\V3;
  3. use App\Models\AgentRun;
  4. use Illuminate\Http\Request;
  5. /**
  6. * 写入研究过程后的回执:只回定位用的键,不把证据、回答这些大字段原样吐回去。
  7. *
  8. * @mixin AgentRun
  9. */
  10. class AgentTraceResource extends BaseResource
  11. {
  12. /**
  13. * @param Request $request
  14. * @return array{
  15. * run_id: string,
  16. * thread_id: string,
  17. * account_type: 'user'|'guest',
  18. * created_at: string
  19. * }
  20. */
  21. public function toArray($request): array
  22. {
  23. return [
  24. 'run_id' => $this->run_id,
  25. 'thread_id' => $this->thread->thread_id,
  26. 'account_type' => $this->account_type,
  27. 'created_at' => $this->created_at,
  28. ];
  29. }
  30. }