Integrating OpenAI to a wix form

Your SETUP could look like…

I would recommend to implement the following functions aswell…

  1. Dropdown for choice of the GPT-Model
    a) Dalle-2
    b) Dalle-3
    c) Turbo-3.5
    d) and so on…
    2024-05-08 00_44_43-Window

  2. Implementing a kind of CALCULATOR → calculating the used tokens and saving them is a history-log or something similar, to have an overview over the already used TOKENS.
    The more used tokens → the more you will pay for OAI.

  3. Implementing your MICROPHONE AND SOUND, or even your Webcam for…
    a) Freehand conversations with CHAT-GPT
    b) Freehand Command-Control-Panel
    c) Using Webcam for SCANNING processes or RECOGNITION (IMAGES, BARCODES, or QR-CODES for example).

$w('#ddnModel').onChange(async()=>{options = await get_oaiOptions(options, $w('#ddnModel').value);});

function get_oaiOptions(options, value) {console.log(options); console.log(value);
	options.model = value;
	if($w('#ddnModel').value==='dall-e-2') {
		options.keyName = 'OpenAi-KEY';
		options.apiUrl = 'https://api.openai.com/v1/images/generations';
		return options;
	}
	else if($w('#ddnModel').value==='dall-e-3') {
		options.keyName = 'OpenAi-KEY';
		options.apiUrl = 'https://api.openai.com/v1/images/generations';
		return options;
	}
	else if($w('#ddnModel').value==='gpt-3.5-turbo-instruct') {
		options.keyName = 'OpenAi-KEY';
		options.apiUrl = 'https://api.openai.com/v1/completions';
		return options;
	} else {console.log('else');}
}

Some more ideas → you will find here…

I have this CHAPTER already behind me.

You can either type-in the questions into the input-box, or speak with the AI :blush:

And here some additional INFO for you…

Good luck!