Coverage for pydantic_ai_jupyter / protocols.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.13.2, created at 2026-01-26 11:33 -0800

1from typing import Protocol, runtime_checkable 

2 

3 

4class HTMLRepresentable(Protocol): 

5 """Objects with a `to_html` method are displayable with ViewModels.""" 

6 

7 def to_html(self) -> str: ... 

8 

9 

10class MarkdownRepresentable(Protocol): 

11 """Objects with a `to_markdown` method are displayable with ViewModels.""" 

12 

13 def to_markdown(self) -> str: ... 

14 

15 

16@runtime_checkable 

17class Displayable(Protocol): 

18 def display(self) -> None: ... 

19 

20 def update(self) -> None: ... 

21 

22 def _repr_mimebundle_(self, include=None, exclude=None): ... 

23 

24 

25@runtime_checkable 

26class SupportsRender(Protocol): 

27 def render(self) -> str: ...