Spaces:
Building
Building
""" | |
LLM Provider Interface for Flare | |
""" | |
import os | |
from abc import ABC, abstractmethod | |
from typing import Dict, List, Optional, Any | |
class LLMInterface(ABC): | |
"""Abstract base class for LLM providers""" | |
def __init__(self, settings: Dict[str, Any] = None): | |
"""Initialize with provider settings""" | |
self.settings = settings or {} | |
self.internal_prompt = self.settings.get("internal_prompt", "") | |
self.parameter_collection_config = self.settings.get("parameter_collection_config", {}) | |
async def generate(self, system_prompt: str, user_input: str, context: List[Dict]) -> str: | |
"""Generate response from LLM""" | |
pass | |
async def startup(self, project_config: Dict) -> bool: | |
"""Initialize LLM with project config""" | |
pass | |
def get_provider_name(self) -> str: | |
"""Get provider name for logging""" | |
pass | |
def get_model_info(self) -> Dict[str, Any]: | |
"""Get model information""" | |
pass |