def query(self, images):
        """Query GPT4o to determine if the ASCII images show the same thing."""
        headers = {
            "Content-Type": "application/json",
            "Authorization": f"Bearer {self.api_key}",
        }

        context = self.prepare_eval_prompt(images)

        query_payload = {
            "model": self.model,
            "messages": [{"role": "user", "content": context}],
            "temperature": 0.0,
        }

        response_data = None
        while response_data is None:
            try:
                response = requests.post(
                    self.url,
                    headers=headers,
                    json=query_payload,
                )
            except (requests.exceptions.JSONDecodeError, requests.exceptions.ConnectionError) as e:
                print(f'Error in requests: {e}')
                print('Retry...')
                continue

            response_ = response.json()
            if "error" in response_:
                error_info = response_["error"]
                print(
                    f"Got error with type: {error_info['type']}. Message: {error_info['message']}"
                )
                print("Retry...")
            else:
                response_data = response_
                break

        total_tokens = response_data.get("usage", {}).get("total_tokens", "N/A")

        if response_data and "choices" in response_data:
            choices = response_data["choices"]
            if choices and "message" in choices[0]:
                message_content = choices[0]["message"]["content"]
                print(
                    f"gpt-4o judge results: {message_content}; tokens:{total_tokens}"
                )
        else:
            print("gpt-4o judge query failed...")
            message_content = ""

        return message_content
Query GPT4o to determine if the ASCII images show the same thing.
vlmeval/dataset/utils/megabench/scoring/ascii_art_gpt4o_judge.py