Inference
Usage instructions for the Client SDK for Inference
Quickstart
To read all inferences for a patient with MRN $PATIENT_MRN
and model ID $MODEL_ID
with username $USERNAME
and private key filename $PRIVATE_KEY_FILENAME
, run:
InferenceAPIClient
Reference
InferenceAPIClient
ReferenceConstructor
Method signature
Parameters
username
(str
): The username to authenticate the client.private_key_filename
(Optional[str]
): Filename of the RSA private key.private_key_string
(Optional[str]
): The RSA private key as a string.base_url
(str
, has a default): The base URL of the Inference API. Defaults to 'https://api.bunkerhillhealth.com/'.
Notes
At least one of
private_key_filename
orprivate_key_string
must be provided.
get_inferences
get_inferences
Gets a list of Inference
objects for a given patient and a given model from the Inference API. Must be called from an async context.
Hint: The get_inferences
method is asynchronous. To make use of this method from a synchronous application, calls to the InferenceAPIClient
can be wrapped in asyncio.run()
.
Method signature
Parameters
model_id
(str
): The model ID of the model.patient_mrn
(str
): The medical record number (MRN) of the patient.
Returns
List[Inference]
: A list of JSON Dicts, one for each inference. See the Inference API documentation for more details on the format of these Dicts.
Notes
You must have authorization to the specified
model_id
. If not, a403
error will be raised.Only inferences corresponding to institutions that you are authorized to will be returned.
Last updated