Refactor: split services.py into services/ package
ChatService → services/chat.py DocumentService → services/document.py TTSService → services/tts.py services/__init__.py re-exports all three for backward-compatible imports Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
from typing import AsyncIterator
|
||||
|
||||
from api_client import APIClientProtocol
|
||||
|
||||
|
||||
class ChatService:
|
||||
def __init__(self, api_client: APIClientProtocol):
|
||||
self._api = api_client
|
||||
|
||||
def chat(
|
||||
self, message: str, user_id: str, show_thinking: bool
|
||||
) -> AsyncIterator[tuple[str, str | None]]:
|
||||
return self._api.chat(message, user_id, show_thinking)
|
||||
|
||||
async def reset(self, user_id: str) -> None:
|
||||
await self._api.reset(user_id)
|
||||
|
||||
async def save_feedback(
|
||||
self,
|
||||
user_id: str,
|
||||
user_msg: str,
|
||||
asst_msg: str,
|
||||
rating: int,
|
||||
run_id: str | None,
|
||||
) -> None:
|
||||
await self._api.save_feedback(user_id, user_msg, asst_msg, rating, run_id)
|
||||
Reference in New Issue
Block a user