---
schema_version: "1"
id: fc483487fe4c82e815b195af57dd0773d6f833244dad22b3ea98977e52289f9b
title: エージェント操作の設定
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/mulesoft-ai-chain-connector/1.0/configuring-agent-operations.md
canonical_url: https://docs.mulesoft.com/jp/mulesoft-ai-chain-connector/1.0/configuring-agent-operations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0cf6eaa58433921a621b7a27c58e486f2b0412e66673f382bee33638b8f717e8
description: MuleSoft Documentation Site
release: "1.0"
latest: true
---
# エージェント操作の設定

## [](#agent-define-prompt-template-操作の設定)Agent Define Prompt Template 操作の設定

**Agent define prompt template**​ 操作を使用して LLM で特定のプロンプトテンプレートを使用します。これにより、応答を生成したり、情報を抽出したり、他のプロンプトを呼び出したり、テキストベースのタスクを実行したりする自然言語プロンプトを作成できます。

**Agent define prompt template**​ 操作を設定する手順は、次のとおりです。

Unresolved include directive in modules/ROOT/pages/configuring-agent-operations.adoc - include::connectors::partial$t-configure-operations.adoc\[\] \* **Dataset (データセット)**

\+ 指定したテンプレートと手順を使用して評価する LLM のデータセットを指定します。 \* **Template (テンプレート)**

\+ 操作のプロンプトテンプレートを入力します。 \* **Instructions (手順)**

\+ タスクの目標の概要を説明する手順を LLM に提供します。 この操作の XML を次に示します。

```xml
<ms-chainai:agent-define-prompt-template
  doc:name="Agent define prompt template"
  doc:id="f1c29c39-eac9-468c-9c46-4109a66303ec"
  config-ref="MuleChain_AI_Llm_configuration"
  template="#[payload.template]"
  instructions="#[payload.instructions]"
  dataset="#[payload.dataset]"
/>
```

この画像は、Anypoint Code Builder での \[Agent define prompt template (エージェントでプロンプトテンプレートを定義)\] アクションの設定例を示しています。 !["\[Agent define prompt template (エージェントでプロンプトテンプレートを定義)](/mulesoft/current/ja-jp/mulesoft-ai-chain-connector/1.0/_images/agent-define-prompt-config-acb.png) が強調表示され、設定属性に入力され、設定されたアクションの XML コードが表示されている Anypoint Code Builder キャンバス"\]

### [](#出力設定)出力設定

この操作の応答には、メイン LLM 応答を含む JSON ペイロードが含まれます。また、トークン利用状況などの属性がメインペイロード内ではなくメタデータ (属性) の一部として含まれます。

応答の例を次に示します。

```json
{
  "response": "{\n  \"type\": \"positive\",\n  \"response\": \"Thank you for your positive feedback on the training last week. We are glad to hear that you had a great experience. Have a nice day!\"\n}"
}
```

この操作では、メイン JSON ペイロード内に含まれない属性も返されます。これには、トークン利用状況に関する情報が含まれます。次に例を示します。

```json
{
  "tokenUsage": {
      "outputCount": 9,
      "totalCount": 18,
      "inputCount": 9
  },
  "additionalAttributes": {}
}
```

- `tokenUsage`
    
    属性として返されるトークン利用状況メタデータ
- `outputCount`
    
    出力の生成で使用されたトークン数
- `totalCount`
    
    入力と出力で使用されたトークンの合計数
- `inputCount`
    
    入力の処理で使用されたトークン数

## [](#関連情報)関連情報

- [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb)
- [Studio を使用したコネクタの設定](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio)
- [MuleSoft AI Chain Connector リファレンス](https://docs.mulesoft.com/jp/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-connector-reference)
- [MuleSoft AI Chain - 追加設定情報](https://docs.mulesoft.com/jp/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-additional-config)
- [MuleSoft ヘルプセンター](https://help.mulesoft.com)