init
This commit is contained in:
24
assistant_bot/ai.py
Normal file
24
assistant_bot/ai.py
Normal 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:
|
||||
...
|
||||
Reference in New Issue
Block a user