ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 58 - Certified AI Specialist discussion

Report
Export

An AI Specialist wants to include data from the response of external service invocation (REST API callout) into the prompt template.

How should the AI Specialist meet this requirement?

A.
Convert the JSON to an XML merge field.
Answers
A.
Convert the JSON to an XML merge field.
B.
Use External Service Record merge fields.
Answers
B.
Use External Service Record merge fields.
C.
Use ''Add Prompt Instructions'' flow element.
Answers
C.
Use ''Add Prompt Instructions'' flow element.
Suggested answer: B

Explanation:

An AI Specialist wants to include data from the response of an external service invocation (REST API callout) into a prompt template. The goal is to incorporate dynamic data retrieved from an external API into the AI-generated content.

Solution:

Use External Service Record Merge Fields

External Service Integration:

Definition: External Services in Salesforce allow the integration of external REST APIs into Salesforce without custom code.

Registration: The external service must be registered in Salesforce, defining the API's schema and methods.

External Service Record Merge Fields:

Purpose: Enables the inclusion of data from external service responses directly into prompt templates using merge fields.

Functionality:

Dynamic Data Inclusion: Allows prompt templates to access and use data returned from REST API callouts.

Merge Fields Syntax: Use merge fields in the prompt template to reference specific data points from the API response.

Implementation Steps:

Register the External Service:

Use External Services to register the REST API in Salesforce.

Define the API's schema, including methods and data structures.

Create a Named Credential:

Configure authentication and endpoint details for the external API.

Use External Service in Flow:

Build a Flow that invokes the external service and captures the response.

Ensure the flow outputs the necessary data for use in the prompt template.

Configure the Prompt Template:

Use External Service Record merge fields in the prompt template to reference data from the flow's output.

Syntax Example: {{flowOutputVariable.fieldName}}

Why Other Options are Less Suitable:

Option A (Convert the JSON to an XML merge field):

Irrelevance: Converting JSON to XML merge fields is unnecessary and complicates the process.

Unsupported Method: Salesforce prompt templates do not support direct inclusion of XML merge fields from JSON conversion.

Option C (Use ''Add Prompt Instructions'' flow element):

Purpose of Add Prompt Instructions:

Allows adding instructions to the prompt within a flow but does not facilitate including external data.

Limitation: Does not directly help in incorporating external service responses into the prompt template.

Salesforce AI Specialist Documentation - Integrating External Services with Prompt Templates:

Explains how to use External Services and merge fields in prompt templates.

Salesforce Help - Using Merge Fields with External Data:

Provides guidance on referencing external data in templates using merge fields.

Salesforce Trailhead - External Services and Flow:

Offers a practical understanding of integrating external APIs using External Services and Flow.

Conclusion:

By using External Service Record merge fields, the AI Specialist can effectively include data from external REST API responses into prompt templates, ensuring that the AI-generated content is enriched with up-to-date and relevant external data.

asked 26/09/2024
terence o oneill
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first