AgentFeedback.php 820 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App\Models;
  3. use App\Models\Concerns\OwnedByAgentAccount;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * 用户对一条 AI 回答的评价(按 AG-UI 回答消息 id)。一人一条,可改可撤回。
  7. */
  8. class AgentFeedback extends Model
  9. {
  10. use OwnedByAgentAccount;
  11. /** 点赞可选的标签。 */
  12. public const UP_TAGS = ['accurate', 'useful_citations', 'clear', 'inspiring'];
  13. /** 点踩的原因。other 带一段文字说明(comment)。 */
  14. public const DOWN_REASONS = ['citation_wrong', 'missed', 'off_topic', 'incorrect', 'too_long', 'too_academic', 'slow', 'other'];
  15. protected $table = 'agent_feedback';
  16. protected $guarded = ['id'];
  17. protected $casts = [
  18. 'tags' => 'array',
  19. 'asked' => 'boolean',
  20. 'rating' => 'integer',
  21. ];
  22. }