refactor(cartesia): mark tag helpers as @staticmethod

SPELL/EMOTION_TAG/PAUSE_TAG/VOLUME_TAG/SPEED_TAG are stateless and worked
only via class-level access. Decorating them lets instance access work too
and silences the missing-self lint warning.
This commit is contained in:
Mark Backman
2026-04-30 09:31:22 -04:00
parent e546541e20
commit e508642b0a

View File

@@ -391,22 +391,27 @@ class CartesiaTTSService(WebsocketTTSService):
return language_to_cartesia_language(language)
# A set of Cartesia-specific helpers for text transformations
@staticmethod
def SPELL(text: str) -> str:
"""Wrap text in Cartesia spell tag."""
return f"<spell>{text}</spell>"
@staticmethod
def EMOTION_TAG(emotion: CartesiaEmotion) -> str:
"""Convenience method to create an emotion tag."""
return f'<emotion value="{emotion}" />'
@staticmethod
def PAUSE_TAG(seconds: float) -> str:
"""Convenience method to create a pause tag."""
return f'<break time="{seconds}s" />'
@staticmethod
def VOLUME_TAG(volume: float) -> str:
"""Convenience method to create a volume tag."""
return f'<volume ratio="{volume}" />'
@staticmethod
def SPEED_TAG(speed: float) -> str:
"""Convenience method to create a speed tag."""
return f'<speed ratio="{speed}" />'