The openai
component is a porting version of OpenAI-ESP32 arduino library, which simplifies the process of invoking the OpenAI API on ESP-IDF
. This library provides extensive support for the majority of OpenAI API functionalities, except for files
and fine-tunes
. For more details, please refer to OpenAI API REFERENCE.
Please refer: https://docs.espressif.com/projects/espressif-esp-iot-solution/en/latest/ai/openai.html
Please use the component manager command add-dependency
to add the openai
to your project's dependency, during the CMake
step the component will be downloaded automatically
idf.py add-dependency "espressif/openai=*"
- You need to register an OpenAI key.
- Pass the key into the initialization function of the component:
OpenAI_t *openai = OpenAICreate(openai_key);
- Connect to a WiFi network that has access to the OpenAI servers.