Implementation of OpenAI API in Salesforce.
- Apex to do the callout: OpenAI class
- Screen flow to invoke the apex @Invocable
- Custom metadata type to add the token + orgID + ...
Based on the moderation algorithm implemented in [OpenAI Api][https://beta.openai.com/docs/guides/moderation/overview]
- Apex to do the callout: OpenAI class
- Apex Triggers for FeedItem and FeedComments for Chatter
- Custom metadata type to add the moderator parameters as violation message, moderation scoring, ...
- Create an scratch org and push all the contents in this project.
- Create the OPEN AI Setting in the Custom metadata type. It's needed the Token field, Moderation Score (0..1) and Violation Message to show when a post in chatter has a score superior than the moderation score.
- Go to The App Sales => OpenAI => Input some text as it's described in the examples of OpenAI Page
- Go to Chatter => Post a status and check the moderation. I suggest you to put a value < 0.02 to see quicker the results.
It helps to integrate this revolutionary tool in our solutions in Salesforce in a very simple way. Also I propose a solution for moderation in Chatter using the Moderation algorithm in GPT-3