chatGPT Integration with Salesforce
Initial Setup
- Update custom label
ChatGPTAPIKey with your openAI API key.
- To use chat, add LWC
ChatGPTBot on your lightning page.
- To detect sentiment of customer for support ticket, add LWC
chatGPTIntelligence on case record page. If you want to fetch any child record then update variable childRelationships in RecordFieldsFetcher class.
Youtube video on how to use it

Resources
- postman chatGPT collection
Test Anonynous Code
String prompt = 'Till what date latest information your model has ?';
String outcome = ChatGPTService.generateResponse(prompt);
System.debug(outcome);
Known Limitations
- Whole history of conversation not sent. Code can be modified to send whole history of conversation for better experience.