ID: d8fbc165-807 Priority: 80 Type: one_shot Status: done
Build image_generator.py: provider abstraction over MiniMax image-01 (primary, free subscription) and GLM CogView-4 (fallback). Core generate_image() function saves to site/figures/, registers as artifact. Error handling with automatic fallback. CLI interface for testing.
scidex/forge/image_generator.py (blob c9cc7b06). Contains:_minimax_generate()) as primary (free subscription)_glm_generate()) as fallbackgenerate_image() saves to site/figures/, registers via register_artifact()if __name__ == "__main__" argparseevaluate_image_quality()batch_generate_for_analysis() and batch_generate_entity_portraits()git ls-tree origin/main:scidex/forge/ | grep image confirms file exists? placeholders, PRAGMA journal_mode, kg_edges table name vs knowledge_edges, CURRENT_TIMESTAMP)import sqlite3 + from scidex.core.database import get_db (top-level) with lazy imports inside each function using get_db()db.row_factory = sqlite3.Row (not needed for dict(row) access in PostgreSQL)? placeholders to %s (PostgreSQL)CURRENT_TIMESTAMP with NOW()kg_edges table → knowledge_edges (correct SciDEX table name)_fetch_kg_edges: uses source_id, relation, target_id columns instead of old subject, predicate, object_fetch_hypothesis and _fetch_analysis to use %s placeholdersevaluate_and_update_artifact: removed PRAGMA journal_mode = WALfrom artifact_registry import → from scidex.atlas.artifact_registry importpsycopg2.sql import
python3 tests/test_image_generator_prompts.py → 8/8 passed[Forge] Fix image_generator.py PostgreSQL compatibility [task:d8fbc165-807c-4a63-b4a7-e87d5d8a62bb]