Activity Analysis#

class src.openCHA.tasks.affect.activity_analysis.ActivityAnalysis(*, name: str = 'affect_activity_analysis', chat_name: str = 'AffectActivityAnalysis', description: str = 'When a request for analysis of physical activity data is received (such as calculating averages, sums, or identifying trends), call this analysis tool. This tool is specifically designed to handle complex data computations on physical activity records, ensuring precise and reliable results. Example: If the data spans a year and the user seeks an average activity level, this tool will calculate the yearly average.', dependencies: List[str] = ['affect_activity_get'], inputs: List[str] = ['You should provide the data source, which is in form of datapipe:datapipe_key the datapipe_key should be extracted from the result of previous actions.', 'the analysis type which is one of **average**, **sum**, or **trend**.'], outputs: List[str] = ['returns an array of json objects which contains the following keys:\n**steps_count**: is the total number of steps registered during the day.\n**rest_time**: is the time (in minutes) during the day spent resting, i.e. sleeping or lying down.', '\n**inactive_time**: is the time (in minutes) during the day spent resting, i.e. sitting or standing still.', '\n**low_acitivity_time** is the (in minutes) during the day with low intensity activity (e.g. household work).', '\n**medimum_acitivity_time** is the (in minutes) during the day with medium intensity activity (e.g. walking).', '\n**high_acitivity_time** is the (in minutes) during the day with high intensity activity (e.g. running).'], datapipe: DataPipe = None, output_type: bool = True, return_direct: bool = False)[source]#

Description:

This tasks performs average, sum, or trend analysis on the provided raw activity affect data for specific patient.

_execute(inputs: List[Any] = None) str[source]#

Abstract method representing the execution of the task. You should implement this method based on your need. This method is called by the execute method that provides the parsed inputs to this method.

Parameters:

inputs (List[Any]) – Input data for the task.

Returns:

Result of the task execution.

Return type:

str

Raises:

NotImplementedError – Subclasses must implement the execute method.