def predict(self, image: str | Path, prompt: Prompt) -> str:
        """Predict whether an image contains anomalies.

        Args:
            image (str | Path): Path to the image file to analyze
            prompt (Prompt): Prompt object containing few-shot and prediction
                prompts

        Returns:
            str: Model's response indicating if anomalies were detected
        """
        image_encoded = self._encode_image_to_url(image)
        messages = []

        # few-shot
        if len(self._ref_images_encoded) > 0:
            messages.append(self._generate_message(content=prompt.few_shot, images=self._ref_images_encoded))

        messages.append(self._generate_message(content=prompt.predict, images=[image_encoded]))

        response: ChatCompletion = self.client.chat.completions.create(messages=messages, model=self.model_name)
        return response.choices[0].message.content
Predict whether an image contains anomalies.

        Args:
            image (str | Path): Path to the image file to analyze
            prompt (Prompt): Prompt object containing few-shot and prediction
                prompts

        Returns:
            str: Model's response indicating if anomalies were detected
        
src/anomalib/models/image/vlm_ad/backends/chat_gpt.py