from .sds import calc_sds | |
import logging | |
logger = logging.getLogger(__name__) | |
def main(file_path: str) -> dict: | |
logger.info(f"Starting tone analysis for: {file_path}") | |
try: | |
results = calc_sds(file_path) | |
# Structure response | |
response = { | |
"speech_dynamism_score" : round(results, 2), | |
} | |
logger.info("Tone analysis complete") | |
return response | |
except Exception as e: | |
logger.error(f"Tone analysis failed internally: {e}", exc_info=True) | |
raise RuntimeError(f"Error during analysis: {str(e)}") |