'integer', 'timeout' => 'integer', 'status' => 'string', ]; /** * @return BelongsTo */ public function llmProvider(): BelongsTo { return $this->belongsTo(LlmProvider::class); } /** * @return BelongsToMany */ public function admins(): BelongsToMany { return $this->belongsToMany(Admin::class, 'admin_client') ->withTimestamps(); } /** * 检查客户是否处于活跃状态 */ public function isActive(): bool { return $this->status === self::STATUS_ACTIVE; } /** * 检查是否可以发送LLM请求 */ public function canSendLlmRequest(): bool { /** @var LlmProvider|null $provider */ $provider = $this->llmProvider; return $this->isActive() && $provider && $provider->isActive(); } }