Spaces:
Sleeping
Sleeping
| from abc import ABC, abstractmethod | |
| from typing import AsyncIterator | |
| class BaseLLMClient(ABC): | |
| """Abstract base class for LLM clients""" | |
| async def generate_text( | |
| self, | |
| prompt: str, | |
| max_tokens: int = 1000, | |
| temperature: float = 1, | |
| **kwargs | |
| ) -> str: | |
| """Generate text response""" | |
| pass | |
| async def generate_text_streaming( | |
| self, | |
| prompt: str, | |
| max_tokens: int = 1000, | |
| temperature: float = 1, | |
| stream: bool = True, | |
| **kwargs | |
| ) -> AsyncIterator[str]: | |
| """Generate text with streaming response""" | |
| pass | |
| async def health_check(self) -> bool: | |
| """Check if the LLM service is healthy""" | |
| pass | |
| async def generate_image( | |
| self, | |
| prompt: str, | |
| max_tokens: int = 1000, | |
| temperature: float = 1, | |
| **kwargs | |
| ) -> str: | |
| """Generate image based on the prompt""" | |
| pass |