Skip to content

prefactor_http.models.bulk module

Models for the Bulk API.

class prefactor_http.models.bulk.BulkItem(, _type: str, idempotency_key: Annotated[str, MinLen(min_length=8), MaxLen(max_length=64)], **extra_data: Any)

Section titled “class prefactor_http.models.bulk.BulkItem(, _type: str, idempotency_key: Annotated[str, MinLen(min_length=8), MaxLen(max_length=64)], **extra_data: Any)”

Bases: BaseModel

A single item in a bulk request.

Each item must include _type and idempotency_key, plus any additional parameters required by the specific action type.

Required unique idempotency key for this item. Must be at least 8 characters long and unique within the request.

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

The type of query/action to execute (e.g., ‘agents/list’, ‘agents/create’).

class prefactor_http.models.bulk.BulkOutput(, status: str, **extra_data: Any)

Section titled “class prefactor_http.models.bulk.BulkOutput(, status: str, **extra_data: Any)”

Bases: BaseModel

Output from a query or action.

Contains either a success response (with ‘status’: ‘success’ and operation-specific data) or an error response (with ‘status’: ‘error’, ‘code’, ‘message’, and optionally ‘errors’).

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

‘success’ or ‘error’.

  • Type: Status of the operation

classmethod validate_status(v: str) → str

Section titled “classmethod validate_status(v: str) → str”

class prefactor_http.models.bulk.BulkRequest(, items: Annotated[list[BulkItem], MinLen(min_length=1)])

Section titled “class prefactor_http.models.bulk.BulkRequest(, items: Annotated[list[BulkItem], MinLen(min_length=1)])”

Bases: BaseModel

Request body for bulk query/action operations.

Allows executing multiple API operations in a single request.

List of items to process in bulk. Each item will be processed independently in its own transaction.

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Validate that all idempotency keys are unique within the request.

class prefactor_http.models.bulk.BulkResponse(, status: str = ‘success’, outputs: dict[str, BulkOutput])

Section titled “class prefactor_http.models.bulk.BulkResponse(, status: str = ‘success’, outputs: dict[str, BulkOutput])”

Bases: BaseModel

Response from bulk query/action operations.

Contains a map of results keyed by the idempotency_key from each request item.

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Map where keys are the idempotency_key values from the request, and values are the corresponding query/action outputs or error responses.

Response status, always ‘success’ when the request is processed.