skit_pipelines.pipelines.publish_compliance_breaches package

Module contents

publish_compliance_breaches(lang: str, template_id: Optional[str] = None, start_date: str = '', end_date: str = '', start_date_offset: int = 0, end_date_offset: int = 0, reported: bool = False, call_quantity: int = 1000, notify: str = '', channel: str = '', slack_thread: str = '')[source]

A pipeline to sample calls in a given time range and check if there are any compliance breaches. A LLM model is used to identify these breaches by sending entire conversations. The results are persisted in the ‘ML_metrics’ database from where they can be queried whenever required.

Example payload to invoke via slack integrations:

@charon run publish_compliance_breaches

{
    "lang": "en",
    "template_id": 100,
    "start_date": "2022-11-10",
    "end_date": "2022-11-11",
    "reported": false,
    "call_quantity": 500
}
Parameters
  • lang (str) – The language code of the calls to filter. eg: en, hi, ta, te, etc.

  • template_id (str, optional) – The flow template id to filter calls, defaults to “”

  • start_date (str) – The start date range to filter calls in YYYY-MM-DD format.

  • end_date (str) – The end date range to filter calls in YYYY-MM-DD format.

  • start_date_offset (int, optional) – Number of days from current date to start querying calls

  • end_date_offset (int, optional) – Number of days from current date to stop querying calls

  • reported (bool) – Pick only reported calls, defaults to False

  • call_quantity (int, optional) – Number of calls to sample, defaults to 1000

  • notify (str, optional) – A comma separated list of slack ids: “@apples, @orange.fruit” etc, defaults to “”

  • channel (str, optional) – The slack channel to send the notification, defaults to “”

  • slack_thread (str, optional) – The slack thread to send the notification, defaults to “”