Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twilio Botintegration Changes Without UI #400

Merged
merged 16 commits into from
Jul 16, 2024
Merged

Twilio Botintegration Changes Without UI #400

merged 16 commits into from
Jul 16, 2024

Conversation

SanderGi
Copy link
Member

@SanderGi SanderGi commented Jul 8, 2024

Task: https://app.asana.com/0/1203067047205953/1207669871112393

Q/A checklist

  • If you add new dependencies, did you update the lock file?
poetry lock --no-update
  • Run tests
ulimit -n unlimited && ./scripts/run-tests.sh
  • Do a self code review of the changes - Read the diff at least twice.
  • Carefully think about the stuff that might break because of this change - this sounds obvious but it's easy to forget to do "Go to references" on each function you're changing and see if it's used in a way you didn't expect.
  • The relevant pages still run when you press submit
  • The API for those pages still work (API tab)
  • The public API interface doesn't change if you didn't want it to (check API tab > docs page)
  • Do your UI changes (if applicable) look acceptable on mobile?
  • Ensure you have not regressed the import time unless you have a good reason to do so.
    You can visualize this using tuna:
python3 -X importtime -c 'import server' 2> out.log && tuna out.log

To measure import time for a specific library:

$ time python -c 'import pandas'

________________________________________________________
Executed in    1.15 secs    fish           external
   usr time    2.22 secs   86.00 micros    2.22 secs
   sys time    0.72 secs  613.00 micros    0.72 secs

To reduce import times, import libraries that take a long time inside the functions that use them instead of at the top of the file:

def my_function():
    import pandas as pd
    ...

Legal Boilerplate

Look, I get it. The entity doing business as “Gooey.AI” and/or “Dara.network” was incorporated in the State of Delaware in 2020 as Dara Network Inc. and is gonna need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Dara Network Inc can use, modify, copy, and redistribute my contributions, under its choice of terms.

bots/models.py Outdated Show resolved Hide resolved
routers/twilio_api.py Outdated Show resolved Hide resolved
routers/twilio_api.py Outdated Show resolved Hide resolved
routers/twilio_api.py Outdated Show resolved Hide resolved
routers/twilio_api.py Outdated Show resolved Hide resolved
routers/twilio_api.py Outdated Show resolved Hide resolved
routers/twilio_api.py Outdated Show resolved Hide resolved
devxpy added 2 commits July 16, 2024 18:50
- remove twilio_default_to_gooey_asr, twilio_default_to_gooey_tts - use saved run state to infer it instead
- rename twilio_voice -> twilio_tts_voice
- rename _unpack_bot_integration -> __init__
- default account sid and auth key to env vars
- add indexes for twilio lookups
- move BotIntegration.translate -> BotInterface.translate
- move twilio payload parsing logic to TwilioVoice Interface
- use api base url for twilio redirects
- remove slow client.queues.list(), just store the queue instance
- delete queue after use
- fix broadcast - remove twilio support
- avoid un-necessary twilio redirects, directly inline the twiml where possible
- use query params for twilio_voice_call_response instead of hacky base64 path params
- shuffle waiting audios
- fix send_broadcast_msg: specify default arg value for `medium`
@SanderGi
Copy link
Member Author

@devxpy The default_to_gooey_asr and tts inputs has the downside that people can’t choose to do Twilio ASR/TTS for their Twilio integration and Gooey for other integrations. Twilio is useful since it is a lot faster and because it supports interruptions (Gooey ASR does not)

use api keys for twilio instead of sid+auth token
@devxpy devxpy merged commit 9b9092a into master Jul 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants