Skip to content

Commit

Permalink
quality: Documentation to enum constants
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Dec 8, 2024
1 parent 91ce5e7 commit 277a8fb
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 9 deletions.
12 changes: 8 additions & 4 deletions app/helpers/call_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,14 @@ class ContextEnum(str, Enum):
Used to track the operation context of a call in Azure Communication Services.
"""

GOODBYE = "goodbye" # Hang up
IVR_LANG_SELECT = "ivr_lang_select" # IVR language selection
START_REALTIME = "start_realtime" # Start realtime call
TRANSFER_FAILED = "transfer_failed" # Transfer failed
GOODBYE = "goodbye"
"""Hang up"""
IVR_LANG_SELECT = "ivr_lang_select"
"""IVR language selection"""
START_REALTIME = "start_realtime"
"""Start realtime call"""
TRANSFER_FAILED = "transfer_failed"
"""Transfer failed"""


def tts_sentence_split(
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/config_models/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

class ModeEnum(str, Enum):
MEMORY = "memory"
"""Use memory cache."""
REDIS = "redis"
"""Use Redis cache."""


class MemoryModel(BaseModel, frozen=True):
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/config_models/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

class ModeEnum(str, Enum):
AZURE_OPENAI = "azure_openai"
"""Use Azure OpenAI."""
OPENAI = "openai"
"""Use OpenAI."""


class AbstractPlatformModel(BaseModel, frozen=True):
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/config_models/sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

class ModeEnum(str, Enum):
COMMUNICATION_SERVICES = "communication_services"
"""Use Communication Services."""
TWILIO = "twilio"
"""Use Twilio."""


class CommunicationServiceModel(BaseModel, frozen=True):
Expand Down
4 changes: 4 additions & 0 deletions app/models/claim.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

class ClaimTypeEnum(str, Enum):
DATETIME = "datetime"
"""Parsed to a Python datetime object."""
EMAIL = "email"
"""Validated as an email address string."""
PHONE_NUMBER = "phone_number"
"""Validated as a phone number string."""
TEXT = "text"
"""Validated as a string."""


class ClaimFieldModel(BaseModel):
Expand Down
9 changes: 8 additions & 1 deletion app/models/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,27 @@ class StyleEnum(str, Enum):
"""

CHEERFUL = "cheerful"
NONE = "none" # This is not a valid style, but we use it in the code to indicate no style
NONE = "none"
"""This is not a valid style, but we use it in the code to indicate no style."""
SAD = "sad"


class ActionEnum(str, Enum):
CALL = "call"
"""User called the assistant."""
HANGUP = "hangup"
"""User hung up the call."""
SMS = "sms"
"""User sent an SMS."""
TALK = "talk"
"""User sent a message."""


class PersonaEnum(str, Enum):
ASSISTANT = "assistant"
"""Represents an AI assistant."""
HUMAN = "human"
"""Represents a human user."""
TOOL = "tool"
"""Not used but deprecated, kept for backward compatibility."""

Expand Down
2 changes: 2 additions & 0 deletions app/models/readiness.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

class ReadinessEnum(str, Enum):
FAIL = "fail"
"""The service is not ready."""
OK = "ok"
"""The service is ready."""


class ReadinessCheckModel(BaseModel):
Expand Down
12 changes: 8 additions & 4 deletions app/models/synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@


class SatisfactionEnum(str, Enum):
TERRIBLE = "terrible" # 1
LOW = "low" # 2
PARTIAL = "partial" # 3
HIGH = "high" # 4
TERRIBLE = "terrible"
"""Satisfaction is very low (1/4)."""
LOW = "low"
"""Satisfaction is low (2/4)."""
PARTIAL = "partial"
"""Satisfaction is partial (3/4)."""
HIGH = "high"
"""Satisfaction is high (4/4)."""
UNKNOW = "unknow"


Expand Down

0 comments on commit 277a8fb

Please sign in to comment.