language-learning-app/api/app/domain/models/gen_ai.py

20 lines
415 B
Python
Raw Permalink Normal View History

from dataclasses import dataclass
from datetime import datetime
from typing import Protocol
@dataclass
class GenAiChatMessage:
actor: str # 'user' | 'agent'
content: str
class GenerativeAiClient(Protocol):
async def complete(
self,
system_prompt: str,
messages: list[GenAiChatMessage],
model: str = "",
max_tokens: int = 2048,
) -> tuple[str, dict]: ...