This commit is contained in:
2026-05-11 15:23:34 +08:00
parent ed70a140a2
commit 547cbbb4a5
25 changed files with 721 additions and 332 deletions
@@ -20,9 +20,9 @@ class ArchiveMetadataEnrichmentService
public function enrich(array $payload): array
{
$missing = $this->missingFields($payload);
if ($missing === [] || !$this->enabled()) {
if ($missing === [] || !$this->isEnabled()) {
return $this->withAiMeta($payload, [
'enabled' => $this->enabled(),
'enabled' => $this->isEnabled(),
'attempted' => false,
'filled' => [],
'missing' => $missing,
@@ -80,7 +80,7 @@ class ArchiveMetadataEnrichmentService
return array_values(array_filter($fields, fn (string $field): bool => !$this->hasUsefulValue($payload, $field)));
}
private function enabled(): bool
public function isEnabled(): bool
{
return (bool) config('LLMapi.metadata.enabled', true) && $this->client->isConfigured();
}