Skip to content

Commit

Permalink
allow to use the tool with no openai, gTTS, blablado installed
Browse files Browse the repository at this point in the history
  • Loading branch information
haesleinhuepf committed Feb 22, 2024
1 parent 8f394ab commit b4d159f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ You need to configure these environment variables:
* `SCADSAI_ROOM_USERNAME`
* `SCADSAI_ROOM_API_TOKEN`

If you want to use your voice for the room booking as well, you need to create an OpenAI API Key and add it to your environment variables as explained on [this page](https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety) and install blablado like this:
```
pip install blablado
```

## License

Distributed under the terms of the [BSD-3] license,
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ install_requires =
streamlit
caldav
scikit-image


python_requires = >=3.9
include_package_data = True
Expand Down
25 changes: 17 additions & 8 deletions src/scadsai_room_booking/_streamlit_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ def streamlit_app():
if st.button(f"Book {short_name}", use_container_width=True):
book(name, calendar)

if st.button(f"Book {short_name} with voice", use_container_width=True):
start_listening(name, calendar)
st.markdown(
"Note: if you book a room using your voice, information will be sent to / stored on Google and/or OpenAI servers.")
if voice_booking_available():
if st.button(f"Book {short_name} with voice", use_container_width=True):
start_listening(name, calendar)
st.markdown(
"Note: if you book a room using your voice, information will be sent to / stored on Google and/or OpenAI servers.")

if room != "Select" and room != "All":

Expand All @@ -136,12 +137,20 @@ def streamlit_app():
if st.button("Book", use_container_width=True):
book(room, calendar)

with columns[1]:
if st.button("Book with voice", use_container_width=True):
start_listening(room, calendar)
st.markdown("Note: if you book a room using your voice, information will be sent to / stored on Google and/or OpenAI servers.")
if voice_booking_available():
with columns[1]:
if st.button("Book with voice", use_container_width=True):
start_listening(room, calendar)
st.markdown("Note: if you book a room using your voice, information will be sent to / stored on Google and/or OpenAI servers.")


def voice_booking_available():
try:
import blablado
return True
except ImportError:
return False

if __name__ == "__main__":
streamlit_app()

Expand Down

0 comments on commit b4d159f

Please sign in to comment.