/chat-gpt-sfdc

Standalone Salesforce lighting-web-components application created levering OpenAI Chat-GPT API.

Primary LanguageJavaScript

OpenAI Chat-GPT application in Salesforce Lighting experience ⚡

Standalone Salesforce lighting-web-components application created levering OpenAI Chat-GPT API.

✨ Features

  • Completions API interface in lighting experience.
    Completions UI
  • Edits API interface in lighting experience.
    Edits UI
  • API settings UI.
    API Settings UI

🚧 Features under development

  • Images API interface in lighting experience.
  • Chat-GPT request settings UI.

🚫 Limitations

  • Apex HTTP Callout timeout Governor Limit (Maximum is set as 120 seconds).
  • It seems that package deployment with external named credentials have some bugs at the moment and Salesforce throws unknown error while trying to deploy.
    • Fortunately, this behavior can be avoided deploying package in stages.
    • Unfortunately, in order to deploy package in stages it has to be managed.

📥 Installation

  1. Install "Pre-Deployment" version (package ID = 04t68000000ko4Z)
  2. Go to OpenAI lighting application and click "Process Pre-Deployment" button.
  3. Upgrade package to "Initial Version" (package ID = 04t68000000PsXm).
  4. The OpenAI API uses API keys for authentication. Visit your API keys page to retrieve the API key. Save it after generating it, you will need it to complete application setup. ❗Make sure that you have free trial tokens or your account is paid❗
  5. Update API key in OpenAI lighting application's API settings section
  6. If application still do not work, go to OpenAI lighting application's API settings section and click "Grant Access" button.
installation_demo.mp4

🗑️ Uninstalling

  1. Execute anonymous apex block:
 Database.delete([
		SELECT Id
		FROM PermissionSetAssignment
		WHERE PermissionSet.Name = 'ChatGPT_Access'
]);
  1. Go to Setup → Platform Tools → Apps → Installed Packages
  2. Find and uninstall "Chat-GPT" managed package

👤 Author

🧑‍💻 Arnas Baronas

🤝 Development

  • If you have suggestions for how this app could be improved, or want to report a bug, open an issue or write me an email! We'd love all and any contributions.
  • In order to run this application as unmanaged package keep in mind that some component's references have managed packaged chatGPT__ namespace. Delete them before deployment.