synth_ai.sdk.optimization.policy.gepa_online_session
GEPA online session SDK wrapper.
This module provides the GepaOnlineSession class for managing online GEPA optimization sessions.
In online mode, you drive rollouts locally while the backend proposes new instruction candidates
and serves them via a proxy URL.
Online GEPA workflow:
- Create a session with your GEPA configuration (
prompt_learning.gepa.mode=online) - Get proxy URLs for prompt selection
- Run rollouts locally, calling the proxy URL for each LLM call
- Report rewards back to the session
- Backend proposes new prompt candidates based on rewards
Classes
GepaOnlineSession
Client wrapper for online GEPA optimization sessions.
Key methods:
create()/create_async()to start a new sessionget_status()to fetch live candidate statsget_prompt_urls()to retrieve proxy URLsupdate_reward()to report per-rollout rewardspause()/resume()/cancel()for lifecycle control