ractogateway.batch._models
Shared data models for the batch-processing subsystem.
- class ractogateway.batch._models.BatchStatus(*values)[source]
-
Processing state of a batch job.
Maps to the union of OpenAI and Anthropic batch status strings.
- PENDING = 'pending'
- IN_PROGRESS = 'in_progress'
- FINALIZING = 'finalizing'
- COMPLETED = 'completed'
- FAILED = 'failed'
- EXPIRED = 'expired'
- CANCELLING = 'cancelling'
- CANCELLED = 'cancelled'
- class ractogateway.batch._models.BatchItem(**data)[source]
Bases:
BaseModelA single request within a batch job.
- Parameters:
custom_id (str) – User-supplied identifier used to correlate results. Must be unique within a batch.
user_message (str) – The end-user’s query string (equivalent to
ChatConfig.user_message).temperature (float) – Sampling temperature. Defaults to
0.0.max_tokens (int) – Maximum tokens for the completion. Defaults to
4096.extra (dict[str, Any]) – Provider-specific pass-through kwargs.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- custom_id: str
- user_message: str
- temperature: float
- max_tokens: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ractogateway.batch._models.BatchJobInfo(**data)[source]
Bases:
BaseModelMetadata about a submitted batch job.
Returned by
submit_batch()andpoll_status().Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- job_id: str
- provider: str
- status: BatchStatus
- created_at: float
- request_count: int
- raw: Any
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ractogateway.batch._models.BatchResult(**data)[source]
Bases:
BaseModelThe outcome of a single
BatchItem.A result is always present in the
resultslist returned byget_results(); checkerrorto detect failures.Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- custom_id: str
- response: LLMResponse | None
- raw: Any
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- property ok: bool
Truewhen the request succeeded (no error, response present).