Add generic AI job queue lifecycle
This commit is contained in:
@@ -32,6 +32,8 @@ type Job struct {
|
||||
ScheduledAt time.Time `json:"scheduled_at"`
|
||||
StartedAt *time.Time `json:"started_at,omitempty"`
|
||||
CompletedAt *time.Time `json:"completed_at,omitempty"`
|
||||
WorkerID *string `json:"worker_id,omitempty"`
|
||||
HeartbeatAt *time.Time `json:"heartbeat_at,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
IdempotencyKey *string `json:"idempotency_key,omitempty"`
|
||||
@@ -49,6 +51,22 @@ type CreateJob struct {
|
||||
IdempotencyKey *string `json:"idempotency_key,omitempty"`
|
||||
}
|
||||
|
||||
type ClaimJobs struct {
|
||||
WorkerID string `json:"worker_id"`
|
||||
TaskTypes []string `json:"task_types"`
|
||||
ModelProfiles []string `json:"model_profiles"`
|
||||
Limit int `json:"limit"`
|
||||
}
|
||||
|
||||
type CompleteJob struct {
|
||||
Result json.RawMessage `json:"result"`
|
||||
}
|
||||
|
||||
type FailJob struct {
|
||||
ErrorCode string `json:"error_code"`
|
||||
ErrorMessage string `json:"error_message"`
|
||||
}
|
||||
|
||||
type QueueStat struct {
|
||||
TaskType string `json:"task_type"`
|
||||
ModelProfile string `json:"model_profile"`
|
||||
|
||||
Reference in New Issue
Block a user