Ask ChatGPT

Posted by agiletortoise, Last update 2 months ago


2 months ago

Default to new “gpt-4o” model

show all updates...

2 months ago

Default to new “gpt-4o” model

5 months ago

Add options to select model.

Prompt for input to send to ChatGPT, and insert the response to the prompt in the current draft. If there is a text selection in the editor, it will be used as the default prompt text.

Defaults to using the gpt-3.5-turbo model, but provides option to select gpt-4.

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


  • script

    // change variable to alter model used
    const models = [
    const initialText = editor.getSelectedText()
    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", "Prompt", initialText)
    	p.addSelect("model", "Model", models, [models[0]], false)
    	if (! {
    		return false
    	const chatPrompt = p.fieldValues["prompt"]
    	if (chatPrompt.length == 0) { return false }
    	let ai = new OpenAI()
    	ai.model = p.fieldValues["model"]
    	let answer = ai.quickChatResponse(chatPrompt)
    	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.