class RubyLLM::ActiveRecord::Batch

A provider-side batch of persisted chats, in RubyLLM’s ruby_llm_batches table. RubyLLM.batch writes a row when it submits persisted chats of one class, and RubyLLM::Batch.find reads it back in any process.

RubyLLM::ActiveRecord::Batch.where(completed: false).pluck(:provider_batch_id)

Its columns:

provider_batch_id

The provider’s id for the batch.

provider

The provider’s slug.

status

"pending", "succeeded", "failed", or "cancelled".

raw_status

The status as the provider last reported it.

completed

Whether the provider has finished the batch.

request_counts

The provider’s request counts, as a Hash.

reported_cost

The cost the provider reported, as a Hash.

chat_type, chat_ids

The class and ids of the submitted chats.

RubyLLM writes these rows. Read and query them, and add scopes and columns of your own, but do not create or update them. Use RubyLLM::Batch to refresh a batch and deliver its results.