mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-07 07:55:16 +02:00
Add a worker sync event so that runtime updates on one worker can propagate across other workers using pubsub for multi worker deployments
142 lines
3.7 KiB
Python
142 lines
3.7 KiB
Python
from enum import Enum
|
|
|
|
|
|
class IntegrationAction(Enum):
|
|
ALL_CALLS = "All Calls"
|
|
QUALIFIED_CALLS = "Qualified Calls"
|
|
|
|
|
|
class Environment(Enum):
|
|
LOCAL = "local"
|
|
PRODUCTION = "production"
|
|
TEST = "test"
|
|
|
|
|
|
class CallType(Enum):
|
|
INBOUND = "inbound"
|
|
OUTBOUND = "outbound"
|
|
|
|
|
|
class WorkflowRunMode(Enum):
|
|
ARI = "ari"
|
|
TWILIO = "twilio"
|
|
VONAGE = "vonage"
|
|
VOBIZ = "vobiz"
|
|
CLOUDONIX = "cloudonix"
|
|
TELNYX = "telnyx"
|
|
WEBRTC = "webrtc"
|
|
SMALLWEBRTC = "smallwebrtc"
|
|
|
|
# Historical, not used anymore. Don't
|
|
# use and don't remove
|
|
STASIS = "stasis"
|
|
VOICE = "VOICE"
|
|
CHAT = "CHAT"
|
|
|
|
|
|
class StorageBackend(Enum):
|
|
"""Storage backend enumeration.
|
|
|
|
Currently supported backends:
|
|
- S3: Amazon S3
|
|
- MINIO: MinIO
|
|
|
|
Future extensibility: Additional backends like GCS, Azure can be added by:
|
|
1. Adding new enum values as strings
|
|
2. Implementing storage logic in services/storage.py
|
|
3. Database will automatically support new values via SQLAlchemy Enum type
|
|
"""
|
|
|
|
# Currently implemented backends
|
|
S3 = "s3" # AWS S3 for cloud deployments
|
|
MINIO = "minio" # MinIO for local/OSS deployments
|
|
|
|
@classmethod
|
|
def get_current_backend(cls):
|
|
"""Get current backend based on ENABLE_AWS_S3 flag."""
|
|
from api.constants import ENABLE_AWS_S3
|
|
|
|
if ENABLE_AWS_S3:
|
|
return cls.S3
|
|
else:
|
|
return cls.MINIO
|
|
|
|
|
|
class WorkflowRunState(Enum):
|
|
INITIALIZED = "initialized" # Workflow run created, ready for connection
|
|
RUNNING = "running" # Websocket connected and pipeline active
|
|
COMPLETED = "completed" # Workflow run finished
|
|
|
|
|
|
class WorkflowRunStatus(Enum):
|
|
# historical modes
|
|
VOICE = "VOICE"
|
|
CHAT = "CHAT"
|
|
|
|
|
|
class OrganizationConfigurationKey(Enum):
|
|
DISPOSITION_CODE_MAPPING = "DISPOSITION_CODE_MAPPING"
|
|
DISPOSITION_MESSAGE_TEMPLATE = "DISPOSITION_MESSAGE_TEMPLATE"
|
|
CONCURRENT_CALL_LIMIT = "CONCURRENT_CALL_LIMIT"
|
|
TELEPHONY_CONFIGURATION = (
|
|
"TELEPHONY_CONFIGURATION" # Stores all providers + active one
|
|
)
|
|
TWILIO_CONFIGURATION = (
|
|
"TWILIO_CONFIGURATION" # Deprecated - for backward compatibility
|
|
)
|
|
LANGFUSE_CREDENTIALS = (
|
|
"LANGFUSE_CREDENTIALS" # Org-level Langfuse tracing credentials
|
|
)
|
|
|
|
|
|
class WorkflowStatus(Enum):
|
|
"""Workflow status values"""
|
|
|
|
ACTIVE = "active"
|
|
ARCHIVED = "archived"
|
|
# Future statuses can be added here like:
|
|
# DRAFT = "draft"
|
|
# PAUSED = "paused"
|
|
|
|
|
|
class RedisChannel(Enum):
|
|
"""Redis pub/sub channel names"""
|
|
|
|
CAMPAIGN_EVENTS = "campaign_events"
|
|
WORKER_SYNC = "worker_sync"
|
|
|
|
|
|
class TriggerState(Enum):
|
|
"""Agent trigger state values"""
|
|
|
|
ACTIVE = "active"
|
|
ARCHIVED = "archived"
|
|
|
|
|
|
class WebhookCredentialType(Enum):
|
|
"""Webhook credential authentication types"""
|
|
|
|
NONE = "none" # No authentication
|
|
API_KEY = "api_key" # API key in header
|
|
BEARER_TOKEN = "bearer_token" # Bearer token auth
|
|
BASIC_AUTH = "basic_auth" # Username/password
|
|
CUSTOM_HEADER = "custom_header" # Custom header key-value
|
|
|
|
|
|
class ToolCategory(Enum):
|
|
"""Tool category types"""
|
|
|
|
HTTP_API = "http_api" # Custom HTTP API calls (implemented)
|
|
END_CALL = "end_call" # End call tool
|
|
TRANSFER_CALL = "transfer_call" # Transfer call to phone number (Twilio only)
|
|
CALCULATOR = "calculator" # Built-in calculator tool
|
|
NATIVE = "native" # Built-in integrations (future: dtmf_input)
|
|
INTEGRATION = "integration" # Third-party integrations (future: Google Calendar, Salesforce, etc.)
|
|
|
|
|
|
class ToolStatus(Enum):
|
|
"""Tool status values"""
|
|
|
|
ACTIVE = "active" # Tool is available for use
|
|
ARCHIVED = "archived" # Tool is soft-deleted
|
|
DRAFT = "draft" # Tool is being configured (not ready for use)
|