Spaces:
Running
Running
File size: 1,147 Bytes
db2bd16 701fd0f db2bd16 e98b5e2 701fd0f db2bd16 7f25817 db2bd16 701fd0f d1ed6b1 db2bd16 7f25817 701fd0f 5bf19b3 701fd0f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
"""
types.py
This module defines custom types for the application.
"""
# Standard Library Imports
from typing import Dict, Literal, TypedDict
TTSProviderName = Literal["Hume AI", "ElevenLabs"]
"""TTSProviderName represents the allowed provider names for TTS services."""
ComparisonType = Literal["Hume AI - Hume AI", "Hume AI - ElevenLabs"]
"""Comparison type denoting which providers are compared."""
OptionKey = Literal["Option A", "Option B"]
"""OptionKey is restricted to the literal values 'Option A' or 'Option B'."""
OptionMap = Dict[OptionKey, TTSProviderName]
"""OptionMap defines the structure of the options mapping, where each key is an OptionKey and the value is a TTS provider."""
class VotingResults(TypedDict):
"""Voting results data structure representing values we want to persist to the votes DB"""
comparison_type: ComparisonType
winning_provider: TTSProviderName
winning_option: OptionKey
option_a_provider: TTSProviderName
option_b_provider: TTSProviderName
option_a_generation_id: str
option_b_generation_id: str
voice_description: str
text: str
is_custom_text: bool
|