|
|
""" |
|
|
Base provider interface for AI providers |
|
|
""" |
|
|
|
|
|
from abc import ABC, abstractmethod |
|
|
from typing import Tuple, List, Dict |
|
|
|
|
|
|
|
|
class AIProvider(ABC): |
|
|
"""Abstract base class for AI providers""" |
|
|
|
|
|
@abstractmethod |
|
|
def is_available(self) -> bool: |
|
|
"""Check if the provider is available (API key configured)""" |
|
|
pass |
|
|
|
|
|
@abstractmethod |
|
|
def get_status(self) -> str: |
|
|
"""Get status message for UI""" |
|
|
pass |
|
|
|
|
|
@abstractmethod |
|
|
def get_provider_name(self) -> str: |
|
|
"""Get provider name (e.g., 'Claude', 'Gemini')""" |
|
|
pass |
|
|
|
|
|
@abstractmethod |
|
|
def get_model_name(self) -> str: |
|
|
"""Get model name (e.g., 'claude-3-5-sonnet-20241022')""" |
|
|
pass |
|
|
|
|
|
@abstractmethod |
|
|
def process_message( |
|
|
self, |
|
|
user_message: str, |
|
|
conversation |
|
|
) -> Tuple[str, List[Dict]]: |
|
|
""" |
|
|
Process user message and return AI response |
|
|
|
|
|
Args: |
|
|
user_message: User's message |
|
|
conversation: ConversationManager instance |
|
|
|
|
|
Returns: |
|
|
Tuple of (assistant_response, tool_calls_made) |
|
|
""" |
|
|
pass |
|
|
|
|
|
@abstractmethod |
|
|
def get_welcome_message(self) -> str: |
|
|
"""Get welcome message for new conversations""" |
|
|
pass |
|
|
|