summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorMax Resnick <max@ofmax.li>2025-02-04 22:22:55 -0800
committerMax Resnick <max@ofmax.li>2025-02-04 22:22:55 -0800
commit21f54bd0d623563436d506b6f855ba39cb7ea078 (patch)
tree4fb9720e88097ce7f24fe01dd165fe4fa2a1b6fa /py
parentc8162fc43a748a97aab4647be2f5cdf50bc739ea (diff)
downloadvim-ai-21f54bd0d623563436d506b6f855ba39cb7ea078.tar.gz
feat: update to handle newer messagesCHECKPOINTprovider-config-poc
Diffstat (limited to 'py')
-rw-r--r--py/types.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/py/types.py b/py/types.py
index 819afe5..4eb0ccc 100644
--- a/py/types.py
+++ b/py/types.py
@@ -1,5 +1,5 @@
from collections.abc import Sequence, Mapping
-from typing import TypedDict, Protocol
+from typing import TypedDict, Literal, Union, List
class AIProvider(Protocol):
@@ -15,3 +15,18 @@ class Message(TypedDict):
content: str
type: str
+
+class TextContent(TypedDict):
+ type: Literal['text']
+ text: str
+
+class ImageUrlContent(TypedDict):
+ type: Literal['image_url']
+ image_url: dict[str, str] # {'url': str}
+
+MessageContent = Union[TextContent, ImageUrlContent]
+
+class Message(TypedDict):
+ role: Literal['system', 'user', 'assistant']
+ content: List[MessageContent]
+