## 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>
44 lines
1.4 KiB
Python
44 lines
1.4 KiB
Python
import google.generativeai as genai
|
|
import os
|
|
from PIL import Image
|
|
import io
|
|
|
|
# Configure API Key
|
|
genai.configure(api_key="AIzaSyB-nR0nkeftKrd42NrNIDcFCj3yFP8JLtw")
|
|
|
|
# Try to initialize the model
|
|
try:
|
|
generation_model = genai.GenerativeModel('gemini-pro-vision')
|
|
print("Model initialized successfully")
|
|
|
|
# Define prompt
|
|
prompt = "A modern app icon with a blue background and white envelope symbol"
|
|
print(f"Generating image for: '{prompt}'...")
|
|
|
|
# Try to generate
|
|
response = generation_model.generate_content(prompt)
|
|
|
|
print(f"Response type: {type(response)}")
|
|
print(f"Response: {response}")
|
|
|
|
if hasattr(response, 'parts') and response.parts:
|
|
print(f"Parts: {response.parts}")
|
|
if hasattr(response.parts[0], 'inline_data'):
|
|
print("Has inline_data!")
|
|
image_data = response.parts[0].inline_data.data
|
|
image = Image.open(io.BytesIO(image_data))
|
|
image.save("test_output.png")
|
|
print("Success! Image saved to test_output.png")
|
|
else:
|
|
print("No inline_data attribute")
|
|
print(f"Part attributes: {dir(response.parts[0])}")
|
|
else:
|
|
print("No parts in response or response.parts doesn't exist")
|
|
if hasattr(response, 'text'):
|
|
print(f"Response text: {response.text}")
|
|
|
|
except Exception as e:
|
|
print(f"Error: {type(e).__name__}: {str(e)}")
|
|
import traceback
|
|
traceback.print_exc()
|