## Backend Changes:
- Enhanced PluginTemplate.save() to auto-parse template variables from plugin code
- Updated PluginInstallationSerializer to expose template metadata (description, category, version, author, logo, template_variables)
- Fixed template variable parser to handle nested {{ }} braces in default values
- Added brace-counting algorithm to properly extract variables with insertion codes
- Fixed explicit type parameter detection (textarea, text, email, etc.)
- Made scheduled_task optional on PluginInstallation model
- Added EventPlugin through model for event-plugin relationships
- Added Event.execute_plugins() method for plugin automation
## Frontend Changes:
- Created Tasks.tsx page for managing scheduled tasks
- Enhanced MyPlugins page with clickable plugin cards
- Added edit configuration modal with dynamic form generation
- Implemented escape sequence handling (convert \n, \', etc. for display)
- Added plugin logos to My Plugins page
- Updated type definitions for PluginInstallation interface
- Added insertion code documentation to Plugin Docs
## Plugin System:
- All platform plugins now have editable email templates with textarea support
- Template variables properly parsed with full default values
- Insertion codes ({{CUSTOMER_NAME}}, {{BUSINESS_NAME}}, etc.) documented
- Plugin logos displayed in marketplace and My Plugins
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
from google import genai
|
|
from google.genai import types
|
|
from PIL import Image
|
|
from io import BytesIO
|
|
import os
|
|
|
|
# Initialize the Client
|
|
client = genai.Client(api_key="AIzaSyB-nR0nkeftKrd42NrNIDcFCj3yFP8JLtw")
|
|
|
|
# Define the prompt
|
|
prompt = "A simple modern app icon with a blue background and white envelope symbol, square format, flat design"
|
|
|
|
print(f"Generating image for: '{prompt}'...")
|
|
|
|
# Call the API
|
|
try:
|
|
response = client.models.generate_images(
|
|
model='gemini-2.5-flash-image',
|
|
prompt=prompt,
|
|
config=types.GenerateImagesConfig(
|
|
number_of_images=1,
|
|
aspect_ratio="1:1",
|
|
safety_filter_level="BLOCK_LOW_AND_ABOVE",
|
|
person_generation="ALLOW_ADULT"
|
|
)
|
|
)
|
|
|
|
# Handle the response
|
|
for i, generated_image in enumerate(response.generated_images):
|
|
# Convert raw bytes to an image
|
|
image = Image.open(BytesIO(generated_image.image.image_bytes))
|
|
|
|
# Save to disk
|
|
filename = f"test_generated_image_{i}.png"
|
|
image.save(filename)
|
|
print(f"Success! Saved {filename}")
|
|
|
|
except Exception as e:
|
|
print(f"Error occurred: {type(e).__name__}: {e}")
|
|
import traceback
|
|
traceback.print_exc()
|