Coverage for src/platform_adapter/medium_adapter.py: 100%

1 from __future__ import annotations

2

3 from typing import Any

4

5 from src.platform_adapter.base_adapter import BaseAdapter, PlatformContent

6

7

8 class MediumAdapter(BaseAdapter):

9 def get_max_length(self) -> int:

10 return 50000

11

12 def format_content(self, content: str, **kwargs: Any) -> PlatformContent:

13 truncated = self.truncate_content(content)

14 return PlatformContent(

15 title=kwargs.get("title"), body=truncated, metadata={"platform": "medium"}

16 )