picogent-py/picogent/providers/base.py
Markov d18311a0fd Fix imports and provider interface
- Fixed ContextBuilder import in agent.py
- Corrected AnthropicProvider to match BaseProvider interface
- Fixed tool registry imports
- Verified basic functionality with test
- All 4 tools (read, write, edit, bash) now load correctly
2026-02-22 23:20:45 +01:00

36 lines
965 B
Python

"""
Base provider interface
"""
from abc import ABC, abstractmethod
from typing import Dict, List, Any, Optional
class BaseProvider(ABC):
"""Base class for LLM providers"""
def __init__(self, api_key: str, model: str):
self.api_key = api_key
self.model = model
@abstractmethod
async def generate_response(
self,
messages: List[Dict[str, Any]],
system_prompt: str,
tools: Optional[List[Dict[str, Any]]] = None,
max_tokens: int = 8192
) -> Dict[str, Any]:
"""
Generate a response from the LLM
Args:
messages: List of conversation messages
system_prompt: System prompt for the model
tools: List of available tools (optional)
max_tokens: Maximum tokens to generate
Returns:
Dict containing the response with 'content' and optional 'tool_calls'
"""
pass