chap_core.rest_api.v1 package

Submodules

chap_core.rest_api.v1.debug module

chap_core.rest_api.v1.debug.get_status(task_id: str | None = None) dict[source]

Get the status and result of a task.

chap_core.rest_api.v1.debug.run_add_numbers(a: int, b: int)[source]

Trigger a Celery task to add two numbers.

chap_core.rest_api.v1.debug.trigger_exception(database_url: str = Depends(dependency=<function get_database_url>, use_cache=True, scope=None), worker_settings=Depends(dependency=<functools._lru_cache_wrapper object>, use_cache=True, scope=None))[source]

chap_core.rest_api.v1.jobs module

class chap_core.rest_api.v1.jobs.DataBaseResponse(*, id: int)[source]

Bases: BaseModel

id: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class chap_core.rest_api.v1.jobs.NaiveJob(func, *args, **kwargs)[source]

Bases: object

cancel()[source]
property exception_info
get_logs(n_lines: int | None)[source]

Retrives logs from the current job

property id
property is_finished
property progress
property result
property status
class chap_core.rest_api.v1.jobs.NaiveWorker[source]

Bases: object

job_class

alias of NaiveJob

queue(func, *args, **kwargs)[source]
chap_core.rest_api.v1.jobs.cancel_job(job_id: str) dict[source]

Cancel a running job

chap_core.rest_api.v1.jobs.delete_job(job_id: str) dict[source]
chap_core.rest_api.v1.jobs.get_database_result(job_id: str) DataBaseResponse[source]
chap_core.rest_api.v1.jobs.get_evaluation_result(job_id: str) EvaluationResponse[source]
chap_core.rest_api.v1.jobs.get_job_status(job_id: str) str[source]
chap_core.rest_api.v1.jobs.get_logs(job_id: str) str[source]
chap_core.rest_api.v1.jobs.get_prediction_result(job_id: str) FullPredictionResponse[source]
chap_core.rest_api.v1.jobs.list_jobs(ids: List[str] = Query(None), status: List[str] = Query(None), type: str = Query(None)) List[JobDescription][source]

List all jobs currently in the queue. Optionally filters by a list of job IDs, a list of statuses, and/or a job type. Filtering order: IDs, then type, then status.

chap_core.rest_api.v1.rest_api module

class chap_core.rest_api.v1.rest_api.CompatibilityResponse(*, compatible: bool, description: str)[source]

Bases: BaseModel

compatible: bool
description: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class chap_core.rest_api.v1.rest_api.HealthResponse(*, status: str, message: str)[source]

Bases: BaseModel

message: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

status: str
class chap_core.rest_api.v1.rest_api.State(*, ready: bool, status: str, progress: float = 0)[source]

Bases: BaseModel

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

progress: float
ready: bool
status: str
class chap_core.rest_api.v1.rest_api.SystemInfoResponse(*, chap_core_version: str, python_version: str, os: str)[source]

Bases: BaseModel

chap_core_version: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

os: str
python_version: str
async chap_core.rest_api.v1.rest_api.cancel() dict[source]

Cancel the current training

chap_core.rest_api.v1.rest_api.create_api()[source]
async chap_core.rest_api.v1.rest_api.favicon() FileResponse[source]
async chap_core.rest_api.v1.rest_api.get_evaluation_results() EvaluationResponse[source]

Retrieve evaluation results made by the model

async chap_core.rest_api.v1.rest_api.get_exception() str[source]

Retrieve exception information if the job failed

chap_core.rest_api.v1.rest_api.get_openapi_schema()[source]
async chap_core.rest_api.v1.rest_api.get_results() FullPredictionResponse[source]

Retrieve results made by the model

async chap_core.rest_api.v1.rest_api.get_status() State[source]

Retrieve the current status of the model

async chap_core.rest_api.v1.rest_api.health(worker_config=Depends(dependency=<functools._lru_cache_wrapper object>, use_cache=True, scope=None)) HealthResponse[source]
async chap_core.rest_api.v1.rest_api.is_compatible(modelling_app_version: str) CompatibilityResponse[source]

Check if the modelling app version is compatible with the current API version

async chap_core.rest_api.v1.rest_api.list_features() list[Feature][source]

List all available features

async chap_core.rest_api.v1.rest_api.list_models() list[ModelSpec][source]

List all available models. These are not validated. Should set up test suite to validate them

chap_core.rest_api.v1.rest_api.main_backend(seed_data=None, auto_reload=False)[source]
chap_core.rest_api.v1.rest_api.seed(data)[source]
chap_core.rest_api.v1.rest_api.set_cur_response(response)[source]
async chap_core.rest_api.v1.rest_api.system_info() SystemInfoResponse[source]

Retrieve system information

async chap_core.rest_api.v1.rest_api.version() dict[source]

Retrieve the current version of the API

Module contents