diff --git a/picogent/providers/base.py b/picogent/providers/base.py index 0454c78..50c8804 100644 --- a/picogent/providers/base.py +++ b/picogent/providers/base.py @@ -1,61 +1,36 @@ """ -Base provider class for AI providers +Base provider interface """ from abc import ABC, abstractmethod -from typing import List, Dict, Any, Optional -from ..config import Config +from typing import Dict, List, Any, Optional class BaseProvider(ABC): - """Base class for AI providers""" + """Base class for LLM providers""" - def __init__(self, config: Config): - self.config = config + def __init__(self, api_key: str, model: str): + self.api_key = api_key + self.model = model @abstractmethod - async def chat_completion( - self, - messages: List[Dict[str, Any]], + async def generate_response( + self, + messages: List[Dict[str, Any]], + system_prompt: str, tools: Optional[List[Dict[str, Any]]] = None, - system_prompt: Optional[str] = None + max_tokens: int = 8192 ) -> Dict[str, Any]: """ - Get chat completion from the provider + Generate a response from the LLM Args: - messages: List of messages in the conversation - tools: Optional list of available tools - system_prompt: Optional system prompt - - Returns: - Dictionary containing response with 'content' and optional 'tool_calls' - """ - pass - - @abstractmethod - def parse_tool_calls(self, response: Dict[str, Any]) -> List[Dict[str, Any]]: - """ - Parse tool calls from provider response + messages: List of conversation messages + system_prompt: System prompt for the model + tools: List of available tools (optional) + max_tokens: Maximum tokens to generate - Args: - response: Provider response - Returns: - List of tool calls with 'id', 'name', and 'arguments' - """ - pass - - @abstractmethod - def format_tool_result(self, tool_call_id: str, result: str) -> Dict[str, Any]: - """ - Format tool result for next request - - Args: - tool_call_id: ID of the tool call - result: Result of tool execution - - Returns: - Formatted message for the provider + Dict containing the response with 'content' and optional 'tool_calls' """ pass \ No newline at end of file