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)