Hi!
I’m experimenting with the Completion API using the text-davinci-003
model with a prompt that always starts like this:
{
prompt: `Generate GeoJSON for ${value}`
}
Most of the time the returned response from the choices
array is parsable JSON! but sometimes the response can include conversation text at the start like this:
Here is the GeoJSON for the top 3 neighborhoods in the West Bank:
{
type: 'FeatureCollection',
properties: { ... },
geometry: { ... }
}
Is there a way to guarantee a parsable JSON response is always returned?