Job handler
JobHandler
Handles the execution of jobs associated with a configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config |
ConfigDTO
|
The configuration data. |
required |
embeddings |
Embeddings for job processing. |
required | |
dimension |
Dimension for embeddings. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
_config |
ConfigDTO
|
The configuration data. |
_job_handler |
str
|
The name of the job handler. |
_config_id |
str
|
The unique identifier for the configuration. |
_embeddings |
Embeddings for job processing. |
|
_dimension |
Dimension for embeddings. |
|
_module |
The imported module for the job handler. |
Methods:
| Name | Description |
|---|---|
__init__ |
ConfigDTO, embeddings, dimension) -> None: Initializes the JobHandler instance. |
_import_job_handler_as_module |
Imports the job handler module based on the specified name. |
run |
type[warlock.model.Model]) -> Tuple[dict, StatusDTO]: Runs the job associated with the configuration. |
Source code in apps/services-gold-layer/document-vectorizer/document_vectorizer/jobs/job_handler.py
__init__(config, embeddings, dimension)
Initializes the JobHandler instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config |
ConfigDTO
|
The configuration data. |
required |
embeddings |
Embeddings for job processing. |
required | |
dimension |
Dimension for embeddings. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in apps/services-gold-layer/document-vectorizer/document_vectorizer/jobs/job_handler.py
run(source_input)
Runs the job associated with the configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_input |
type[Model]
|
The input data for the job. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[dict, StatusDTO]
|
Tuple[dict, StatusDTO]: A tuple containing job_data and job_status. |