INNER CODE UNIT · Python

process_images

AnsahMohammad/shots-studio · legacy/web/core.py:108

    def process_images(self, images):
        if not images:
            return "No images to process.", 400

        print(f"Processing {len(images)} images...")
        request_data, headers = self._prepare_request_data(images)

        try:
            response, status_code = self.fetch_ai_response(request_data, headers)
            if status_code != 200:
                return f"Error: {response}", status_code
            return response, status_code
        except Exception as e:
            return f"Error processing images: {str(e)}", 500

    def fetch_ai_response(self, request_data, headers):
        url = f"{self.base_url}/{self.model_name}:generateContent?key={self.api_key}"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…