Initial upload: Local LLM Prompt Manager CLI tool
This commit is contained in:
28
src/llm/base.py
Normal file
28
src/llm/base.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
"""Base LLM client interface."""
|
||||||
|
|
||||||
|
from abc import ABC, abstractmethod
|
||||||
|
from collections.abc import Iterator
|
||||||
|
|
||||||
|
|
||||||
|
class LLMClient(ABC):
|
||||||
|
"""Abstract base class for LLM clients."""
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def generate(self, prompt: str, **kwargs) -> str:
|
||||||
|
"""Generate a response from the LLM."""
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def stream_generate(self, prompt: str, **kwargs) -> Iterator[str]:
|
||||||
|
"""Stream a response from the LLM."""
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def test_connection(self) -> bool:
|
||||||
|
"""Test if the LLM service is available."""
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def get_available_models(self) -> list[str]:
|
||||||
|
"""Get list of available models."""
|
||||||
|
pass
|
||||||
Reference in New Issue
Block a user