Rapidata flow manager
RapidataFlowManager #
Handles everything regarding flows from creation to retrieval.
A manager for creating, retrieving, and searching for flows. Flows are used to add small flow items that can be solved fast without the order creation overhead.
Source code in src/rapidata/rapidata_client/flow/rapidata_flow_manager.py
create_ranking_flow #
create_ranking_flow(
name: str,
instruction: str,
max_response_threshold: int = 100,
min_response_threshold: int | None = None,
validation_set_id: str | None = None,
settings: Sequence[RapidataSetting] | None = None,
) -> RapidataFlow
Create a new ranking flow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the flow. |
required |
instruction
|
str
|
The instruction for the ranking comparisons. Will be shown with each matchup. |
required |
max_response_threshold
|
int
|
The maximum number of responses that will be collected per flow item. Defaults to 100. |
100
|
min_response_threshold
|
int | None
|
The minimum number of responses required for the flow to be considered complete in case of a timeout. Defaults to max_response_threshold. |
None
|
validation_set_id
|
str | None
|
Optional validation set ID. |
None
|
settings
|
Sequence[RapidataSetting] | None
|
Optional settings for the flow. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
RapidataFlow |
RapidataFlow
|
The created flow instance. |
Source code in src/rapidata/rapidata_client/flow/rapidata_flow_manager.py
get_flow_by_id #
get_flow_by_id(flow_id: str) -> RapidataFlow
Get a flow by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flow_id
|
str
|
The ID of the flow. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
RapidataFlow |
RapidataFlow
|
The flow instance. |
Source code in src/rapidata/rapidata_client/flow/rapidata_flow_manager.py
find_flows #
find_flows(
name: str = "", amount: int = 10, page: int = 1
) -> list[RapidataFlow]
Find your recent flows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the flow - matching flow will contain the name. Defaults to "" for any flow. |
''
|
amount
|
int
|
The maximum number of flows to return. Defaults to 10. |
10
|
page
|
int
|
The page of flows to return. Defaults to 1. |
1
|
Returns:
| Type | Description |
|---|---|
list[RapidataFlow]
|
list[RapidataFlow]: A list of RapidataFlow instances. |
Source code in src/rapidata/rapidata_client/flow/rapidata_flow_manager.py
preheat #
Preheat the boost system to reduce latency for upcoming flow items.