Coverage for /home/admin/Documents/AI/applications/lexigram-dev/lexigram/experimental/ai/lexigram-ai-rag/src/lexigram/ai/rag/synthesis/formatters/base.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-25 07:19 +0800

1"""Base formatter protocol. 

2 

3This module defines the protocol that all response formatters must implement. 

4""" 

5 

6from __future__ import annotations 

7 

8from typing import Protocol 

9 

10from lexigram.ai.rag.synthesis.types import SynthesisResult 

11 

12 

13class ResponseFormatterProtocol(Protocol): 

14 """Protocol for response formatters. 

15 

16 All formatter implementations must provide a `format` method that takes 

17 a synthesis result and returns a formatted string. 

18 """ 

19 

20 def format(self, result: SynthesisResult) -> str: 

21 """Format a synthesis result. 

22 

23 Args: 

24 result: The synthesis result to format 

25 

26 Returns: 

27 Formatted output string 

28 """ 

29 ...