I have done a python program using the openai.ChatCompletion.create
to interface to the ChatGPT API.
I am using a messages
with two roles: user
with the user prompt as content
, and assistant
loaded with current sensor data as content
, which I get from a set of sensors using MQTT. The sensor data is original JSON, but I formatted it like this:
Temperature: 22.07 ºC
Humidity: 62.64 %RH
TVOC: 0 ppb
CO2: 400 ppm
PM1: 0 µg/m3
PM2.5: 0 µg/m3
PM10: 1 µg/m3
My idea is to use a clear language to ask What is the temperature?
and What is the dew point?
and expect ChatGPT to just give me the first and calculate the second based on the temperature and humidity available in the data.
I don't want to train a model, since the data changes constantly.
Is there a way to feed sensor data to ChatGPT API?
(I have also tried with role system
, btw)