(Superseded) Discourse AI - Composer AI Helper

This topic covers the configuration of the Composer module of the Discourse AI plugin.

Feature set

The Composer AI Helper module adds a :sparkles: button to the composer toolbar, that when clicked let’s you choose between a list of AI-powered tasks to enhance your post.

image

At the moment it can:

  • Suggest topic titles
  • Proofread
  • Translate to English
  • Create markdown tables

Providers

This model can use the following providers for it’s feature set:

  • OpenAI ChatGPT, using either gpt-3.5-turbo or gpt-4. Defaults to gpt-3.5-turbo.

  • Anthropic Claude, using the claude-v1 model.

Settings

  • composer_ai_helper_enabled: Enables or disables the module

  • ai_helper_allowed_groups: Groups that have access to the feature. Defaults to staff and TL4.

  • ai_helper_allowed_in_pm: If the button will show when composing in PMs. Disabled by default.

  • ai_helper_model: Which AI model to use. Defaults to gpt-3.5-turbo.

  • ai_openai_api_key: An API key obtained at OpenAI Platform. See below for more help. Necessary if ai_helper_model is either gpt-3.5-turbo or gpt-4

  • ai_anthropic_api_key: An API key obtained at https://console.anthropic.com/docs/access. See below for more help. Necessary if ai_helper_model is claude-v1.

Need help setting up API keys?

The following is a guide to setting up API keys so they can be used for Discourse AI. In this example, we are using OpenAI to generate the keys but the process would be similar for other platforms such as Claude. Platforms will always change so this guide may not reflect 100% process.

Note: You will need a paid plan and have to pay per usage. See here for up-to-date details and pricing.

Generate the API keys

  1. Log in to Open AI. An API key can be obtained here OpenAI Platform
  2. Generate the API Key
  3. Once the key is generated, store it in a safe and secure place and copy it

Using API key for Discourse AI

  1. Navigate to your Discourse profile
  2. Go to Admin settings and then Plugins
  3. Search or find Discourse AI and click settings
  4. Search or find ai_openai_api_key and input your copied-over key

18 Likes

A post was split to a new topic: How to re-run fixtures on db?

As there are very few sites that have this option in the editor, know that feedback at the early stage of active use is of value.

The OpenAI Discourse forum has this ability active in the editor and I use it often with the proofread option

However I also use it as a moderator but as a moderator I actually need to not only proofread the text but to give it a nice tone. Thus I often have to copy the text from the Discourse editor into ChatGPT placing the text in a fenced section, ```, with the prompt

Proofread and give nice tone.

If that option or similar were added it would be appreciated. :slightly_smiling_face:


Side note:

Often the request to change the tone of the text results in writing that is obviously different than how I write, I write stating more facts than using prose, and when this happens I often add this at the end.

Polished with the help of ChatGPT

so that those reading it know that I composed the text and the text was refined using ChatGPT.

So if such a line could automatically be added when using the suggested tone modifier option, it would be appreciated. :slightly_smiling_face:

6 Likes

Any plans on adding settings to enable/disable these?

I would be most interested in a Proofread button (without having to first click the icon and then select “Proofread text”) and a “Translate to Spanish” button.

Also, it would be great if the proofreading process could be more granular (at least by sentence) instead of choosing to either “Save (all) Changes” or “cancel”.

5 Likes

That’s great feedback, as we are just starting a rewrite of the UI for this feature.

6 Likes

In case it helps, for my community it would also be very useful to:

  1. Be able to generate transcriptions for uploaded mp3 files.

  2. Be able to fine-tune a model and use that for proofreading instead of the default.

1 Like

A simple solution could be showing a textarea with the proofread version next to (or below) the combined diff.

That way it would be possible to revert changes (since they’re shown in context) and make additional in-context modifications (punctuation, better word choices, etc.) before going back to the regular composer.

Suggestions noted in the Discourse AI topic that might fit with the Composer AI Helper


Have the AI suggest markdown edits.
(ref)


Have the AI read the first post of a topic to make sure

  • It is coherent
  • The category and the tags agree. (I know this can be configured but why not let the AI do it)
  • The content of the post agrees with the category and tags.
  • The content of the post agrees with the title of the post.
  • It is relevant to the forum. (I know spam detectors will catch some of this but sometimes it is not spam and just doesn’t belong)

(ref)

1 Like

Suggestion

Note: This is for images with mostly text.

If a post contains an image, especially new users, then include an options to use OCR to extract the text from the image and show the text below the image.


Users who post just images, especially for source code, make it harder if the source code needs to be copied into a development environment.

Also images AFAIK are not converted to text before with the text being indexed by search engines. As such these post are less likely to be found via a search.

1 Like

Suggestion

Note: This is for images with no text.

For sites that use lots of images, add a option to create words or descriptions associated with the image and include in the post.

Example Discourse site that uses lots of images.

Note: Please add to the list or suggest other similar Discourse sites; personally interested to learn of other such sites.


AI for image classification


For an impressive use of image to text classification

https://valentin.deschaintre.fr/text2fabric_browser_v1.html

The related paper

“The Visual Language of Fabrics” by Valentin Deschaintre, Julia Guerrero-Viu, Diego Gutierrez, Tamy Boubekeur, Belen Masia (pdf)

2 Likes

Another suggestion: Change the language of the output. Currently, it defaults to English, but in our case we want the output to be in German.

1 Like

Hello. Will this plugin conflict if it is installed together with this chatbot plugin?
Can I, for example, connect GPT 3.5 TURBO in this plugin, and connect GPT4 in the chatbot plugin. Will this action cause a plugin conflict?

I have no idea, but if you give it a try let us know.

3 Likes

The guide has been updated to help you set up API keys for Discourse AI.

2 Likes

Good evening,

I’m using this Composer AI to help in our forum. However, it doesn’t appear as it’s shown in the Description above, where it adds the Composer AI Helper module button within the toolbar. as you can see below this is how it is

The issue is that the AI icon is behind the toolbar when I highlight the word, causing a problem when using a mobile device or a tablet.

when i hold down and swipe away i can see it

As you can see we’re changing the UI for this feature from a toolbar to a hover button on select.
It’s still underwork, but it should work on mobile already, at least it’s working on my phone

2 Likes

I’ve been testing both plugins for a week now and haven’t found a single conflict between them. For my version of the forum, each plugin does its job well :+1: It’s as if they were created to complement each other :smiley:

1 Like

2 posts were merged into an existing topic: Discourse AI - AI Bot (chatbot - ChatGPT- Anthropic)

Composer AI doesn’t work for me in Safari on Mac OS. I don’t get menu options after highlighting text and clicking the AI tool. It works fine in Chrome.

1 Like

Thanks @fidelio for making me aware of this. I can reproduce this issue and I will take a look at resolving it very soon!

3 Likes