batches

package
v0.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package batches persists router-side Anthropic message batches.

One POST /v1/messages/batches creates a row holding the entries; the router executes entries against the chat pipeline and appends JSONL-ready results. Modeled on the videojobs service: one public method, one db.Update.

Index

Constants

View Source
const (
	StatusInProgress = "in_progress"
	StatusEnded      = "ended"
	StatusCanceled   = "canceled"
)

Terminal batch states: no further transitions leave them.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service owns BatchRecord rows in the message_batches bucket.

func New

func New(database *db.DB) *Service

New constructs a batches Service. Construction performs no I/O.

func (*Service) Create

func (s *Service) Create(rec *models.BatchRecord) error

Create persists a new batch row: one public method, one db.Update.

func (*Service) Delete

func (s *Service) Delete(id string) error

Delete removes a batch row. Missing rows are not errors.

func (*Service) Get

func (s *Service) Get(id string) (*models.BatchRecord, error)

Get returns the batch by ID.

func (*Service) List

func (s *Service) List() ([]*models.BatchRecord, error)

List returns all batches, oldest first (ID tiebreaks clock ties).

func (*Service) Update

func (s *Service) Update(rec *models.BatchRecord) error

Update rewrites a batch row: one public method, one db.Update.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL