Starting from version 4.0.0, the dialect needs to be explicitly supplied in HTML code. This is done using the “html” parameter in the open function. Here is an example:
import { HtmlGenerator } from 'openai';
const generator = new HtmlGenerator({
apiKey: 'YOUR_API_KEY',
apiEndpoint: 'https://api.openai.com/v1',
html: '' // Supply your own HTML here
});
In the above example, we create a new instance of the HtmlGenerator class and pass the HTML code as a string to the “html” parameter. You should replace ‘YOUR_API_KEY’ with your actual OpenAI API key.
This way, you can explicitly specify the dialect of the HTML code you are providing to the OpenAI API.