This driver allows the Hubitat home automation platform to communicate directly with OpenAI's GPT models, retrieving intelligent and contextual responses based on user questions.
- Communicate with OpenAI GPT models directly from Hubitat.
- Retrieve responses to user questions.
- Initial support is for both general, and true/false styled questions.
- Customizable settings to control the behavior of the OpenAI model.
- A valid API key from OpenAI.
- Navigate to the Drivers Code section of your Hubitat interface.
- Click on the + New Driver button.
- Copy the content of
ChatGPT_Driver.groovy
and paste it into Hubitat. - Save the driver.
- Create a new virtual device and assign the "ChatGPT Driver" as its driver.
Once the driver is added to a device, you will have the option to configure:
- OpenAI API Key: Your personal key to access the GPT models. (Obtain this here: https://platform.openai.com/account/api-keys)
- Standard Model: Choose between
gpt-3.5-turbo
andgpt-4
. - Model Max Tokens: The maximum tokens the model should use for the response. (Default is 256)
- Model Temperature: Controls the randomness of the model's output. (Default is 1)
- Model Top P: Influences the diversity of the generated text. (Default is 1)
- Request Timeout: Define how long to wait for a response. (Default is 30, but complex reasoning on GPT-4 make take over 60)
- Clear response while pending?: Option to clear the previous response while waiting for a new one.
- Default content for True/False with Detail: Set the default content/context for the true/false questions.
Two primary commands can be executed:
- ask(Content, Question): Provides a response based on the system content and user question.
- askTrueFalseWithDetail(Question): Provides a true/false/unknown response with additional details based on the user question.
Feel free to fork, modify, and submit pull requests. All contributions are welcome!
This project is open-source. License file for more details.
- Thanks to OpenAI for providing such a robust and versatile model.