This commit is contained in:
kandrusyak
2026-07-25 15:07:53 +03:00
commit 6667e0d253
40 changed files with 3258 additions and 0 deletions

24
assistant_bot/ai.py Normal file
View File

@@ -0,0 +1,24 @@
from typing import Protocol
class AIClientError(RuntimeError):
"""Raised when the configured AI provider cannot complete a request."""
class AIClient(Protocol):
provider: str
display_name: str
async def list_models(self) -> list[str]:
...
def normalize_model(self, model: str) -> str:
...
async def chat(
self,
model: str,
messages: list[dict[str, str]],
json_mode: bool = False,
) -> str:
...