Ask ChatGPT 4

Posted by agiletortoise, Last update 10 months ago - Unlisted

Prompt for input to send to ChatGPT using the gpt-4 model, and insert the response to the prompt in the current draft.

NOTE: Your API key must have access to gpt-4 for this action to work.

For more information on using this action, visit our OpenAI integration guide


  • script

    let f = () => {
    	let p = new Prompt()
    	p.title = "Ask ChatGPT"
    	p.message = "Type your prompt for ChatGPT, and continue. The response will be inserted in the current draft."
    	p.addTextView("prompt", "ChatGPT Prompt", "")
    	p.addLabel("caption", "This action uses the `gpt-4` model. It will fail if your OpenAI account has not explicitly requested and been granted access to `gpt-4`.", { "textSize": "caption" })
    	if (! {
    		return false
    	const chatPrompt = p.fieldValues["prompt"]
    	if (chatPrompt.length == 0) { return false }
    	let ai = new OpenAI()
    	let answer = ai.quickChatResponse(chatPrompt, {
    		"model": "gpt-4"
    	if (!answer || answer.length == 0) {
    		answer = "No reply received"
    	let content = `${chatPrompt}
    	return true
    if (!f()) {


  • After Success Default
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.