src/psearch/gen_ai/services/imagen_service.py [132:148]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                    if hasattr(
                        part, "inline_data"
                    ) and part.inline_data.mime_type.startswith("image/"):
                        # Ensure the data is properly base64 encoded string, not bytes
                        if isinstance(part.inline_data.data, bytes):
                            image_b64 = base64.b64encode(part.inline_data.data).decode(
                                "ascii"
                            )
                        else:
                            image_b64 = part.inline_data.data

                        return {
                            "product_id": product_id,
                            "generated_image_base64": image_b64,
                        }
            except (AttributeError, IndexError):
                pass
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/psearch/gen_ai/services/imagen_service.py [152:168]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                    if hasattr(
                        part, "inline_data"
                    ) and part.inline_data.mime_type.startswith("image/"):
                        # Ensure the data is properly base64 encoded string, not bytes
                        if isinstance(part.inline_data.data, bytes):
                            image_b64 = base64.b64encode(part.inline_data.data).decode(
                                "ascii"
                            )
                        else:
                            image_b64 = part.inline_data.data

                        return {
                            "product_id": product_id,
                            "generated_image_base64": image_b64,
                        }
            except (AttributeError, IndexError):
                pass
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



