Coder Social home page Coder Social logo

polyglotproxy's Introduction

AI Tools for TinyMCE

This repo is a collection of experiments with the OpenAI API.

polyglotproxy's People

Contributors

androb avatar

Watchers

 avatar

polyglotproxy's Issues

Create Insert Illustration feature

Break up the image generation feature into illustration, photo, and art. This will enable more refined prompts and improved usability, as many business users are likely to want an illustration(?)

Mindmap creation

Create a nested list of a mindmap to insert into the document

Enable different models

Provide a setting to switch between the different models from OpenAI, HuggingFace, Replicate, and Anthropic.

Implement Annotations for Writing Suggestions

Use TinyMCE's Annotations API to mark up writing suggestions from OpenAI. This may only work on GPT-4.

Below, I've provided the marked-up paragraph with the writing suggestions as comments using TinyMCE's annotation format:

Herald of Free Enterprise is often referred to as one of the <span data-mce-comment="1">worse</span><ins>worst</ins> tragedies of <span data-mce-comment="2">time..</span><ins>time.</ins> From the <span data-mce-comment="3">face</span><ins>surface</ins> of it all, the tragedy appears to have been a case of <span data-mce-comment="4">negligency</span><ins>negligence</ins> by officials working on the vessel. However<ins>,</ins> the cardinal faults <span data-mce-comment="5">laid</span><ins>lay</ins> higher up in the company<ins>:</ins> social issues such as <span data-mce-comment="6">ignorance towars</span><ins>ignorance towards</ins> adopting a safety <span data-mce-comment="7">cultur</span><ins>culture</ins>, not adhering to standards and <span data-mce-comment="8">profeedures</span><ins>procedures</ins>, and unclear definition of roles were all faults contributing to the death of 193 passengers.

To annotate the text with TinyMCE, you would need to register a custom annotation type and then apply the annotations using the annotate method. Here's an example of how you might do this:

// Register a custom annotation type for writing suggestions
tinymce.activeEditor.annotator.register('writing-suggestion', {
  decorate: function(uid, data) {
    return {
      attributes: {
        'data-mce-writing-suggestion': uid
      },
      classes: ['my-writing-suggestion']
    };
  }
});

// Apply the writing suggestions as annotations
tinymce.activeEditor.annotator.annotate('writing-suggestion', { suggestionId: 1, content: 'change to correct comparative form' });
tinymce.activeEditor.annotator.annotate('writing-suggestion', { suggestionId: 2, content: 'fix punctuation' });
tinymce.activeEditor.annotator.annotate('writing-suggestion', { suggestionId: 3, content: 'improve word choice' });
tinymce.activeEditor.annotator.annotate('writing-suggestion', { suggestionId: 4, content: 'spelling correction' });
tinymce.activeEditor.annotator.annotate('writing-suggestion', { suggestionId: 5, content: 'change to correct verb form' });
tinymce.activeEditor.annotator.annotate('writing-suggestion', { suggestionId: 6, content: 'spelling correction' });
tinymce.activeEditor.annotator.annotate('writing-suggestion', { suggestionId: 7, content: 'spelling correction' });
tinymce.activeEditor.annotator.annotate('writing-suggestion', { suggestionId: 8, content: 'spelling correction' });

This example registers a custom annotation type called 'writing-suggestion' and applies it to the text using the annotate method with the appropriate suggestion IDs and content. Note that the example assumes the TinyMCE editor is already initialized and active.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.