RunSubmitter

org.llm4s.agent.service.RunSubmitter
@Experimental
final class RunSubmitter(val queue: RunQueue, val checkpointer: Checkpointer, val settings: RunQueueSettings)

The submission API (design 4.55): queue a run for a worker on any machine to take, wait for its ticket's terminal state, or follow its events, over a store's RunQueue and the Checkpointer of the same store. Every call is tenant-scoped (rule 9): a ticket is answered only to its own tenant.

Entries are submitted with settings.maxAttempts; the worker side (W2) takes them.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def await(tenantId: Option[TenantId], entryId: EntryId, timeout: FiniteDuration): Result[QueueEntry]

Entry entryId once it is closed, or as it is after timeout; QueueError.TicketExpired once it has been reclaimed. See RunQueue.awaitClosed.

Entry entryId once it is closed, or as it is after timeout; QueueError.TicketExpired once it has been reclaimed. See RunQueue.awaitClosed.

Attributes

def entry(tenantId: Option[TenantId], entryId: EntryId): Result[QueueEntry]

The entry entryId of tenantId, as it is now.

The entry entryId of tenantId, as it is now.

Attributes

def follow(tenantId: Option[TenantId], entryId: EntryId, after: Long, limit: Int, timeout: FiniteDuration): Result[FollowedRun]

The next page of entry entryId's run events after thread event after (0 from the thread's first), at most limit, waiting up to timeout for a commit when there is nothing yet - through Checkpointer.awaitEventsAfter, so a run committed by a worker on another machine is followed as it lands. Pass each page's next to the next call until finished. limit below 1 is a ValidationError. Errors are the queue's for the ticket and the store's for the thread's log (GraphError.ReplayUnavailable, GraphError.ThreadDeleted).

The next page of entry entryId's run events after thread event after (0 from the thread's first), at most limit, waiting up to timeout for a commit when there is nothing yet - through Checkpointer.awaitEventsAfter, so a run committed by a worker on another machine is followed as it lands. Pass each page's next to the next call until finished. limit below 1 is a ValidationError. Errors are the queue's for the ticket and the store's for the thread's log (GraphError.ReplayUnavailable, GraphError.ThreadDeleted).

Attributes

def submit(threadId: ThreadId, agentId: AgentId, input: QueuedInput, tenantId: Option[TenantId], policy: BusyThreadPolicy, submissionKey: Option[SubmissionKey]): Result[Ticket]

Queues input for threadId, run by agentId for tenantId, and answers its ticket - or, with a submissionKey the tenant's queue already holds for the same submission, that entry's ticket. See RunQueue.submit.

Queues input for threadId, run by agentId for tenantId, and answers its ticket - or, with a submissionKey the tenant's queue already holds for the same submission, that entry's ticket. See RunQueue.submit.

Attributes