Skip to content

Conversation

@ChrisGoogleGit
Copy link

proposed implementation for Bobst with 2 primary classes the AI_MsOpenAiCompletion and AI_Strategy :

  • AI_MsOpenAiCompletion is the Base class containing all methods that are common for all scenarios using MS Open AI.
  • IAI_ChatCompletion is the interface containing the single method to get a chat completion from an AI provider (MS or any other).
  • For each GEN AI use case there is a concrete class extending the base class and implementing the interface.(AI_Case_Routing,AI_Case_Summary,AI_ContactJobTitle,AI_NQ_Assist).
  • The main body of each of those classes is just the method of the interface, containing all the specific behavior to process the AI response for that specific AI scenario.
  • AI_Strategy is the class exposed to the Flow, it's the entry point which determines at run time which concrete apex class to instantiate based on the AI Use Case being triggered, by using the prompt setting custom metadata.
  • Any new AI use case with the same AI provider only requires to create a new class extending the base class and implementing the interface, where the specific logic to handle the chat response is described, and adding a line in the prompt setting metadata with the api name of that new class. All other AI classes and scenario are not impacted, neither the base class or the AI_Strategy.
  • If a customer uses multiple AI providers, then an additional AI_OtherProviderCompletion should be created, the AI provider should be added in the prompt setting metadata table, and the AI_Strategy will instantiate the appropriate class at run time.

@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @torbentiedemann @ChrisGoogleGit to sign the Salesforce Inc. Contributor License Agreement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants