API
startup
construct_response
A decorator that wraps a request handler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
handler |
Callable[..., Dict]
|
Request processing function. |
required |
Returns:
Name | Type | Description |
---|---|---|
wrap |
Callable[..., Dict]
|
Decorated handler. |
Source code in src/trecover/app/api/trecoverapi.py
index
Healthcheck handler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
Request
|
Client request information. |
required |
Returns:
Name | Type | Description |
---|---|---|
Dict |
Dict
|
OK phrase as a Dict response. |
Source code in src/trecover/app/api/trecoverapi.py
config
Get the configuration of the model used for inference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
Request
|
Client request information. |
required |
Returns:
Name | Type | Description |
---|---|---|
response |
Dict
|
Response containing the values of the model configuration in the 'config' field. |
Source code in src/trecover/app/api/trecoverapi.py
config_param
Get the specific configuration parameter of the model used for inference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
Request
|
Client request information. |
required |
param |
str
|
Parameter name. |
required |
Returns:
Name | Type | Description |
---|---|---|
response |
Dict
|
Response containing the value of the specific configuration parameter in the '' field if it exists, otherwise 'Not found' value. |
Source code in src/trecover/app/api/trecoverapi.py
recover
Perform keyless reading.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
Request
|
Client request information. |
required |
payload |
PredictPayload
|
Data for keyless reading. |
required |
Returns:
Name | Type | Description |
---|---|---|
response |
TaskResponse
|
Response containing the id of the celery task in the 'task_id' field. |
Source code in src/trecover/app/api/trecoverapi.py
status
status(
request,
task_id=Path(
Ellipsis,
title="The ID of the task to get status",
regex="[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}",
),
)
Get a celery task status.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
Request
|
Client request information. |
required |
task_id |
str
|
Celery task id. |
Path(Ellipsis, title='The ID of the task to get status', regex='[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}')
|
Returns:
Name | Type | Description |
---|---|---|
response |
PredictResponse
|
Response containing the status of the celery task in the 'state' and 'progress' fields if it's still in process, error information in 'message' and 'status_code' fields if it's failed, otherwise the result of keyless reading in the 'chains' field. |
Source code in src/trecover/app/api/trecoverapi.py
delete_prediction
delete_prediction(
request,
task_id=Path(
Ellipsis,
title="The ID of the task to forget",
regex="[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}",
),
)
Delete task result in the celery backend database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
Request
|
Client request information. |
required |
task_id |
str
|
Task ID to delete its result from celery backend database. |
Path(Ellipsis, title='The ID of the task to forget', regex='[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}')
|
Returns:
Name | Type | Description |
---|---|---|
response |
Dict
|
OK phrase. |