prompts->render('vision_analyze'); $response = $this->ollama->generateWithImage($this->model, $prompt, $imagePath); return [ 'manufacturer' => $this->extractField($response, 'MANUFACTURER'), 'modelName' => $this->extractField($response, 'MODEL_NAME'), 'modelNumber' => $this->extractField($response, 'MODEL_NUMBER'), 'serial' => $this->extractField($response, 'SERIAL'), ]; } private function extractField(string $response, string $field): string { if (preg_match('/^'.$field.':\s*(.+)$/m', $response, $matches)) { return trim($matches[1]); } return ''; } }