diff --git a/docs/flows.md b/docs/flows.md index 5ac29df9..7bc944f0 100644 --- a/docs/flows.md +++ b/docs/flows.md @@ -123,6 +123,16 @@ flow.update_config( This config will only affect new flow items and not modify existing ones. +### Preheating + +If you need low-latency responses for upcoming flow items, you can preheat the system beforehand: + +```python +client.flow.preheat() +``` + +This warms up internal resources so that subsequent flow batches are processed faster. Call it before submitting time-sensitive batches. + ### Retrieving Existing Flows You can retrieve flows by ID or list your recent flows: diff --git a/src/rapidata/rapidata_client/flow/rapidata_flow_manager.py b/src/rapidata/rapidata_client/flow/rapidata_flow_manager.py index d3086651..0ebd31b0 100644 --- a/src/rapidata/rapidata_client/flow/rapidata_flow_manager.py +++ b/src/rapidata/rapidata_client/flow/rapidata_flow_manager.py @@ -139,6 +139,12 @@ def find_flows( for flow in response.items ] + def preheat(self) -> None: + """Preheat the boost system to reduce latency for upcoming flow items.""" + with tracer.start_as_current_span("RapidataFlowManager.preheat"): + logger.debug("Preheating boost") + self._openapi_service.campaign.campaign_api.campaign_boost_preheat_post() + def __str__(self) -> str: return "RapidataFlowManager" diff --git a/uv.lock b/uv.lock index efb3d210..777720d4 100644 --- a/uv.lock +++ b/uv.lock @@ -2558,7 +2558,7 @@ wheels = [ [[package]] name = "rapidata" -version = "3.7.1" +version = "3.7.3" source = { editable = "." } dependencies = [ { name = "authlib" },