Library for Arduino that allows users to chat with the GPT model from OpenAI.
ArduinoChatGPT is a library that enables Arduino users to communicate with OpenAI's GPT natural language model. The library uses OpenAI's API to send messages and receive responses from the GPT model.
-
Download the ArduinoChatGPT repository.
-
Extract the .zip file to your Arduino libraries folder (usually located at
C:\Users\<your user>\Documents\Arduino\librarieson Windows, or~/Documents/Arduino/librarieson macOS and Linux). -
Open the Arduino IDE and go to Sketch > Include Library > ArduinoChatGPT. This will add the library to your project.
-
In your Arduino sketch, include the
ArduinoChatGPT.hheader file:#include <ArduinoChatGPT.h>
-
Create an instance of the ArduinoChatGPT class, passing in your OpenAI API key:
ArduinoChatGPT chat("YOUR_OPENAI_API_KEY");
-
Send a message to the GPT model using the sendMessage() method:
String response = chat.sendMessage("Hello, how are you?"); -
Use the response variable to retrieve the response from the GPT model.
This project is licensed under the MIT License - see the LICENSE file for details.