Is it possible to calculate the progress of a dalle generated image for use with a loading bar? I can see that chatGPT returns a small circle loader while the image is being generated, however, I can’t see how to reproduce this in the docs?
NodeJS code I’m using…
public generateImage(
description: string,
userUID: string,
): Observable<string> {
return new Observable((subscriber) => {
this._client.images
.generate({
model: this._models.image,
prompt: this.getImagePrompt(description),
size: '1024x1024',
style: 'vivid',
user: userUID,
})
.then((result) => {
// Notify subscribers of the result
subscriber.next(result.data[0].url);
subscriber.complete();
})
.catch((error: OpenAIError) => {
subscriber.error(error.message);
});
});
}