chore: adjust message/command structure and write unit tests
ref: N25B-205
This commit is contained in:
20
src/control_backend/schemas/ri_message.py
Normal file
20
src/control_backend/schemas/ri_message.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from enum import Enum
|
||||
from typing import Any, Literal
|
||||
|
||||
from pydantic import BaseModel, Field, ValidationError
|
||||
|
||||
|
||||
class RIEndpoint(str, Enum):
|
||||
SPEECH = "actuate/speech"
|
||||
PING = "ping"
|
||||
NEGOTIATE_PORTS = "negotiate/ports"
|
||||
|
||||
|
||||
class RIMessage(BaseModel):
|
||||
endpoint: RIEndpoint
|
||||
data: Any
|
||||
|
||||
|
||||
class SpeechCommand(RIMessage):
|
||||
endpoint: RIEndpoint = RIEndpoint(RIEndpoint.SPEECH)
|
||||
data: str
|
||||
Reference in New Issue
Block a user