ChatGPT, Google Assistant, and HA - Passing Custom Args

Wondering if there’s a sound way to pass a text prompt to a Home Assistant script through a Google Assistant trigger for the purposes of facilitating a conversation with ChatGPT via API (already handled).

Here is the intended user flow:
Google Assistant custom wake with Text Prompt (Hey Google, ask ChatGPT BLANK)
→ Google Assistant sends prompt request and BLANK variable to custom (plugin? script?) running on Home Assistant
→ Home Assistant executes (plugin? script?) which calls local python script running (GitHub - acheong08/ChatGPT: Real browserless ChatGPT library and command line tool. Using official API). Session remains open for 15min to allow for extended conversation
→ Response from HA run python script echos back to Google Assistant
→ Repeat cycle

I’d like to avoid running the python service on AWS instead of Home Assistant, and while perhaps more complicated, wondering if the above is possible.

2 Likes