plexus.reports.blocks.topic_analysis module

class plexus.reports.blocks.topic_analysis.TopicAnalysis(config: Dict[str, Any], params: Dict[str, Any] | None, api_client: PlexusDashboardClient)

Bases: BaseReportBlock

DEFAULT_NAME: str | None = 'Topic Analysis'
DEFAULT_PROMPT = '\n    I have a topic from call center transcripts that is described by the following keywords: [KEYWORDS]\n    In this topic, these customer-agent conversations are representative examples:\n    [DOCUMENTS]\n\n    Based on the keywords and representative examples above, provide a short, descriptive label for this topic in customer service context. Return only the label, no other text or formatting.\n    '
__init__(config: Dict[str, Any], params: Dict[str, Any] | None, api_client: PlexusDashboardClient)
async generate() Tuple[Dict[str, Any] | None, str | None]

Generates the data for this report block asynchronously.

Access block configuration via self.config and report parameters via self.params. Use self.api_client for data fetching. Use self._log(“message”) to record log information.

Returns:
A tuple containing:
  • A dictionary containing the generated data (JSON-serializable), or None on failure.

  • A string containing concatenated log messages, or None if no logs.