Note
Go to the end to download the full example code or to run this example in your browser via Binder.
You and Claude together in a notebook gallery#
In Jupyter or Colab the JupyterGallery shows the images
with buttons. With an escalation evaluator Claude answers the easy queries;
when it is unsure the gallery stops, shows Claude’s suggestion pre-selected,
and waits for your clicks. Ask AI fills in Claude’s answer on demand; the
comment box accepts phrases such as “much brighter, slightly less contrast”.
import easyiec as ei
from easyiec.evaluators import AnthropicClient, EscalationEvaluator, HumanProxy, LLMJudge
from easyiec.problems import ImageEnhancement
from easyiec.strategies import InteractiveGA
problem = ImageEnhancement()
judge = LLMJudge(AnthropicClient("claude-haiku-5-5"), problem,
goal="a natural, warm, well-exposed photo of a cup of coffee")
hybrid = EscalationEvaluator(judge, HumanProxy(), policy="rate", target_rate=0.3)
app = ei.ui.JupyterGallery(problem, InteractiveGA(pop_size=9), evaluator=hybrid, assistant=judge)
app # the last expression of a cell displays the gallery