Rapidata flow
RapidataFlow #
Source code in src/rapidata/rapidata_client/flow/rapidata_flow.py
create_new_flow_batch #
create_new_flow_batch(
datapoints: list[str],
context: str | None = None,
data_type: Literal["media", "text"] = "media",
private_metadata: list[dict[str, str]] | None = None,
accept_failed_uploads: bool = False,
time_to_live: int | None = None,
) -> RapidataFlowItem
Create a new flow batch by uploading datapoints to a dataset and submitting it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
datapoints
|
list[str]
|
The list of datapoints (paths or URLs) to upload. |
required |
context
|
str | None
|
The context shown alongside the instruction. |
None
|
data_type
|
Literal['media', 'text']
|
The data type of the datapoints. Defaults to "media". |
'media'
|
private_metadata
|
list[dict[str, str]] | None
|
Optional key-value metadata per datapoint. |
None
|
accept_failed_uploads
|
bool
|
If True, continues even if some uploads fail. |
False
|
time_to_live
|
int | None
|
The time to live for the flow item in seconds. If it takes longer than this to complete, the flow item will be stopped and the results will be returned. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
RapidataFlowItem |
RapidataFlowItem
|
The created flow item. |
Source code in src/rapidata/rapidata_client/flow/rapidata_flow.py
get_flow_items #
get_flow_items(
amount: int = 10, page: int = 1
) -> list[RapidataFlowItem]
Query flow items for this flow, returning them in order of creation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount
|
int
|
The amount of flow items to return. Defaults to 10. |
10
|
page
|
int
|
The page of flow items to return. Defaults to 1. |
1
|
Returns:
| Type | Description |
|---|---|
list[RapidataFlowItem]
|
list[RapidataFlowItem]: A list of flow items. |
Source code in src/rapidata/rapidata_client/flow/rapidata_flow.py
update_config #
update_config(
instruction: str | None = None,
starting_elo: int | None = None,
min_responses: int | None = None,
max_responses: int | None = None,
) -> None
Update the configuration of this ranking flow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instruction
|
str | None
|
New instruction for comparisons. |
None
|
starting_elo
|
int | None
|
New starting ELO rating. |
None
|
min_responses
|
int | None
|
New minimum number of responses. |
None
|
max_responses
|
int | None
|
New maximum number of responses. |
None
|
Source code in src/rapidata/rapidata_client/flow/rapidata_flow.py
delete #
Soft delete this flow.