diff --git a/.env.sample b/.env.sample index f42c384..27f8542 100644 --- a/.env.sample +++ b/.env.sample @@ -15,4 +15,6 @@ TWILIO_PHONE_NUMBER= # Plivo credentials PLIVO_AUTH_ID= PLIVO_AUTH_TOKEN= -PLIVO_PHONE_NUMBER= \ No newline at end of file +PLIVO_PHONE_NUMBER= + +NGROK_AUTHTOKEN= \ No newline at end of file diff --git a/.gitignore b/.gitignore index 33986b5..2e7c101 100644 --- a/.gitignore +++ b/.gitignore @@ -167,4 +167,6 @@ agent_data/**/mp3 */__pycache__/ */*/__pycache__/ logs/ -agent_data/ \ No newline at end of file +agent_data/ + +.env \ No newline at end of file diff --git a/bolna/models.py b/bolna/models.py index 0a028f5..825b211 100644 --- a/bolna/models.py +++ b/bolna/models.py @@ -80,7 +80,7 @@ class Transcriber(BaseModel): encoding: Optional[str] = "linear16" endpointing: Optional[int] = 400 keywords: Optional[str] = None - task:Optional[str] = "transcribe" + task: Optional[str] = "transcribe" provider: Optional[str] = "deepgram" @validator("provider") @@ -88,9 +88,14 @@ def validate_model(cls, value): print(f"value {value}, PROVIDERS {list(SUPPORTED_TRANSCRIBER_PROVIDERS.keys())}") return validate_attribute(value, list(SUPPORTED_TRANSCRIBER_PROVIDERS.keys())) + # Only whisper works well with russian and kazakh @validator("language") - def validate_language(cls, value): - return validate_attribute(value, ["en", "hi", "es", "fr", "pt", "ko", "ja", "zh", "de", "it", "pt-BR"]) + def validate_language(cls, value, values): + supported_languages = ["en", "hi", "es", "fr", "pt", "ko", "ja", "zh", "de", "it", "pt-BR"] + if values.get('model') == 'whisper': + supported_languages.append('ru') + supported_languages.append('kk') + return validate_attribute(value, supported_languages) class Synthesizer(BaseModel): diff --git a/local_setup/docker-compose.yml b/local_setup/docker-compose.yml index 24424cc..f986834 100644 --- a/local_setup/docker-compose.yml +++ b/local_setup/docker-compose.yml @@ -36,6 +36,8 @@ services: - ./ngrok-config.yml:/etc/ngrok.yml ports: - 4040:4040 + environment: + - NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN} ### Telephony servers ### twilio-app: diff --git a/local_setup/ngrok-config.yml b/local_setup/ngrok-config.yml index c868f12..07bbfa7 100644 --- a/local_setup/ngrok-config.yml +++ b/local_setup/ngrok-config.yml @@ -1,6 +1,5 @@ region: us version: '2' -authtoken: tunnels: twilio-app: addr: twilio-app:8001