Spaces:
Sleeping
Sleeping
Upload shared/base_assistant.py
Browse files- shared/base_assistant.py +13 -0
shared/base_assistant.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from abc import ABC, abstractmethod
|
| 2 |
+
from typing import List, Tuple
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class BaseAssistant(ABC):
|
| 6 |
+
"""Abstract base for both OSS and frontier assistants."""
|
| 7 |
+
|
| 8 |
+
@abstractmethod
|
| 9 |
+
def chat(self, message: str, history: List[Tuple[str, str]]) -> str:
|
| 10 |
+
"""Return assistant reply given a user message and Gradio-format history."""
|
| 11 |
+
|
| 12 |
+
def reset(self) -> None:
|
| 13 |
+
"""Override to clear any session state beyond history."""
|