---
schema_version: "1"
id: 0135afe0d53765aa779fc18d983775f8c10d54c7e807ecd11c994a1b23fe73d3
title: ExternalAIModel
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_externalaimodel.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_externalaimodel.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: cacdf7a53c789d3d4e825e32799495d6e4bcaa4ad3e593fde50bc8e01fbb9d86
description: Represents the state of a given model for an Einstein for Service feature, such as Einstein Reply Recommendations.
---
# ExternalAIModel

Represents the state of a given model for an Einstein for Service feature, such as Einstein Reply Recommendations.

## Parent Type

This type extends the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm "The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.") metadata type and inherits its fullName field.

## File Suffix and Directory Location

ExternalAIModel components have the suffix .externalAIModel and are stored in the externalAIModels folder.

## Version

ExternalAIModel components are available in API version 51.0 and later.

## Special Access Rules

This type is available only when an org is configured to access the application in the applicationSourceType field. For example, if applicationSourceType is set to ARTICLE\_RECOMMENDATION, this type is available only if Einstein Article Recommendations is enabled in the org and the Main Services Agreement has been accepted.

## Fields

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d469166e114">Field Name</th>

              <th class="featureTableHeader  " id="d469166e117">Field Type</th>

              <th class="featureTableHeader  " id="d469166e120">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d469166e114" data-title="Field Name"><span class="keyword parmname">applicationSourceType</span></td>

              <td class="entry" headers="d469166e117" data-title="Field Type">
                <dl class="dl detailList">

                  <dd class="dd">ApplicationSourceType (enumeration of type string)</dd>


                </dl>

              </td>

              <td class="entry" headers="d469166e120" data-title="Description">Required. The target application for the configuration. Valid values are:<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">REPLY_RECOMMENDATION</samp>— Einstein Reply
                    Recommendations
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">ARTICLE_RECOMMENDATION</samp>— Einstein Article
                    Recommendations
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">UTTERANCE_RECOMMENDATION</samp>— Einstein Bot
                    utterances
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">FAQ</samp>— Einstein Bot frequently asked
                    questions
                  </li>

                </ul>
              </td>


            </tr>

            <tr>
              <td class="entry" headers="d469166e114" data-title="Field Name"><span class="keyword parmname">externalModelKey</span></td>

              <td class="entry" headers="d469166e117" data-title="Field Type">
                <dl class="dl detailList">

                  <dd class="dd">string</dd>


                </dl>

              </td>

              <td class="entry" headers="d469166e120" data-title="Description">
                <dl class="dl detailList">

                  <dd class="dd">Required. Unique key which identifies external model corresponding this
                    applicationType</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d469166e114" data-title="Field Name"><span class="keyword parmname">externalModelStatus</span></td>

              <td class="entry" headers="d469166e117" data-title="Field Type">
                <dl class="dl detailList">

                  <dd class="dd">ExternalModelStatus (enumeration of type string)</dd>


                </dl>

              </td>

              <td class="entry" headers="d469166e120" data-title="Description">Required. The current state of a given model. Valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">DISABLED</samp></li>

                  <li class="li"><samp class="codeph nolang">ENABLED</samp></li>

                  <li class="li"><samp class="codeph nolang">PAUSED</samp></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d469166e114" data-title="Field Name"><span class="keyword parmname">name</span></td>

              <td class="entry" headers="d469166e117" data-title="Field Type">
                <dl class="dl detailList">

                  <dd class="dd">string</dd>


                </dl>

              </td>

              <td class="entry" headers="d469166e120" data-title="Description">
                <dl class="dl detailList">

                  <dd class="dd">Required. A reference to the configuration.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d469166e114" data-title="Field Name"><span class="keyword parmname">threshold</span></td>

              <td class="entry" headers="d469166e117" data-title="Field Type">
                <dl class="dl detailList">

                  <dd class="dd">double</dd>


                </dl>

              </td>

              <td class="entry" headers="d469166e120" data-title="Description">
                <dl class="dl detailList">

                  <dd class="dd">Threshold override value for this model. Nillable.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d469166e114" data-title="Field Name"><span class="keyword parmname">trainingJobName</span></td>

              <td class="entry" headers="d469166e117" data-title="Field Type">
                <dl class="dl detailList">

                  <dd class="dd">string</dd>


                </dl>

              </td>

              <td class="entry" headers="d469166e120" data-title="Description">
                <dl class="dl detailList">

                  <dd class="dd">Training job path corresponding to the given model. Nillable.</dd>


                </dl>

              </td>

            </tr>

          </tbody>

        </table>

## Declarative Metadata Sample Definition

The following is an example of an ExternalAIModel component.

<?xml version="1.0" encoding="UTF-8"?>
<ExternalAIModel xmlns="http://soap.sforce.com/2006/04/metadata">
    <applicationSourceType>REPLY\_RECOMMENDATION</applicationSourceType>
    <externalModelKey>0f16dea6-b886-44df-9cfa-4d96b51d6594</externalModelKey>
    <externalModelStatus>ENABLED</externalModelStatus>
    <name>SR1601228426202</name>
    <threshold>0.9</threshold>
    <trainingJobName>TestJob</trainingJobName>
</ExternalAIModel>

The following is an example package.xml that references the previous definition.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>\*</members>
        <name>ExternalAIModel</name>
    </types>
</Package>

## Wildcard Support in the Manifest File

This metadata type doesn’t support the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/file_based_zip_file.htm "The deploy() and retrieve() calls are used to deploy and retrieve a .zip file. Within the .zip file is a project manifest (package.xml) that lists what to retrieve or deploy, and one or more XML components that are organized into folders.").