Route medical
run(config, background_tasks)
async
Initiates a medical analysis task asynchronously.
This function queues a medical analysis task using the provided configuration. The task is executed in the background, and the response includes the task ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
AppConfig
|
Configuration object containing details such as task ID, user, and analysis type. |
required |
background_tasks
|
BackgroundTasks
|
FastAPI's background task manager to handle asynchronous task execution. |
required |
Returns:
Name | Type | Description |
---|---|---|
JSONResponse |
A JSON response containing the task ID, e.g., {"task_id": |
Raises:
Type | Description |
---|---|
HTTPException
|
If an error occurs while queuing the task, an HTTP 500 error is returned |
Source code in view/api/route_medical.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|