Generation task
A Generation represents one AI-generation request. Tasks are
stored in the database table tx_
and managed through the Extbase Generation.
Task lifecycle
Every task moves through a set of states defined by
\Wegewerk\:
| Value | Meaning |
|---|---|
Pending | Task created, waiting to be processed. |
Processing | Reserved for future use (processing flag). |
Done | AI generation completed; result is populated. |
Failed | Generation failed; error_ is populated. |
Canceled | Task was canceled before processing. |
Field reference
-
- Type
- string (enum)
- Default
Pending
Current lifecycle state. One of
Pending,Processing,Done,Failed,Canceled.
-
- Type
- string
- Default
- (empty)
The text prompt sent to the AI endpoint.
-
- Type
- string
- Default
- (empty)
Optional path to an image passed to the capability endpoint.
-
- Type
- string
- Default
- (empty)
Key of the registered capability (e.g.
my_). See Capability API.ext_ summary
-
- Type
- string
- Default
- (empty)
Name of the TYPO3 database table that owns the record being processed (e.g.
tt_).content
-
- Type
- string
- Default
- (empty)
Name of the field within
record_that will receive the generated text.table
-
- Type
- int
UID of the owning record.
-
- Type
- string
- Default
- (empty)
ISO language code passed to the capability endpoint.
-
- Type
- string
- Default
- (empty)
The text returned by the capability endpoint after a successful generation.
-
- Type
- string
- Default
- (empty)
Optional JSON metadata returned alongside the result.
-
- Type
- string
- Default
- (empty)
Human-readable error description when
statusisFailed.
-
- Type
- bool
- Default
false
Set to
trueby an editor after reviewing the generated result.
-
- Type
- int (Unix timestamp)
- Default
0
Unix timestamp set when generation completes successfully.
GenerationTaskService
\Wegewerk\ is the primary
API for working with the task queue. Inject it via constructor:
use Wegewerk\Ai3Core\Domain\Model\Dto\AddGenerationTask;
use Wegewerk\Ai3Core\Service\GenerationTaskService;
$dto = new AddGenerationTask(
status: 'Pending',
prompt: 'Write a short product description.',
image: '',
capability: 'my_ext_summary',
record_table: 'tt_content',
record_field: 'bodytext',
record_uid: 42,
generateLanguage: 'en',
parameters: '',
result: '',
result_meta: '',
error_message: '',
);
$task = $this->generationTaskService->addTask($dto);
Useful query methods:
| Method | Description |
|---|---|
get | Latest task for record_. |
is | true if status is Pending or Processing. |
has | true if the latest task is Done. |
get | Result string of the most recent Done task. |
is | true if the latest task has been reviewed. |
set | Marks the task as reviewed and persists. |