Composable

useGPT('How high is Mt. Everest?')

The above example would initialize a request but won't do anything without a trigger afterwards.

useGPT(prompt)

Creates an instance of a request with a message.

keyTypeDefaultDescription
promptStringThe message you want to send. Not needed if followed by .createChat()

.addContextData(data)

This function can be appended to the initial useGPT(prompt) to have the prompt reference the provided data.

const response = await useGPT('Which countries are in europe?')
.addContextData(['Austria', 'Germany', 'Canada'])
keyTypeDefaultDescription
dataanyWill append the data as JSON to the intial prompt to let GPT reference it.