feat: establish voice assistant V1 baseline
This commit is contained in:
7
src/voice_assistant/agent/__init__.py
Normal file
7
src/voice_assistant/agent/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from .adapter import AgentAdapter
|
||||
from .mock import MockAgentAdapter
|
||||
|
||||
__all__ = [
|
||||
"AgentAdapter",
|
||||
"MockAgentAdapter",
|
||||
]
|
||||
14
src/voice_assistant/agent/adapter.py
Normal file
14
src/voice_assistant/agent/adapter.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class AgentAdapter(ABC):
|
||||
@abstractmethod
|
||||
async def process(
|
||||
self,
|
||||
session_id: str,
|
||||
turn_id: int,
|
||||
text: str,
|
||||
) -> str:
|
||||
"""Process the final text of a turn and return the response."""
|
||||
raise NotImplementedError
|
||||
|
||||
24
src/voice_assistant/agent/mock.py
Normal file
24
src/voice_assistant/agent/mock.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from .adapter import AgentAdapter
|
||||
|
||||
|
||||
class MockAgentAdapter(AgentAdapter):
|
||||
def __init__(self) -> None:
|
||||
self.calls: list[
|
||||
tuple[str, int, str]
|
||||
] = []
|
||||
|
||||
async def process(
|
||||
self,
|
||||
session_id: str,
|
||||
turn_id: int,
|
||||
text: str,
|
||||
) -> str:
|
||||
self.calls.append(
|
||||
(
|
||||
session_id,
|
||||
turn_id,
|
||||
text,
|
||||
)
|
||||
)
|
||||
|
||||
return f"Resposta simulada para: {text}"
|
||||
Reference in New Issue
Block a user