---
schema_version: "1"
id: 9d58845be127c43289d11ca00fb9ad7a8d7d9f3c0ac25e7eb88f83a5e6a7b946
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-chat-operations.md
canonical_url: https://docs.mulesoft.com/jp/mulesoft-ai-chain-connector/1.0/configuring-chat-operations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 69798ff983e59c247983b94099ba4892322697f11ecf07f73279029b8ac61a07
description: MuleSoft Documentation Site
release: "1.0"
latest: true
---
# チャット操作の設定

## [](#chat-answer-prompt-操作の設定)Chat Answer Prompt 操作の設定

**Chat answer prompt**​ 操作は、設定済み LLM への簡単なプロンプト要求操作です。これはプレーンテキストプロンプトを入力として使用し、その応答にはプレーンテキストの回答が含まれます。

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

1. Anypoint Code Builder または Studio キャンバスで操作を選択します。
2. 操作の ​**\[General (一般)\]**​ プロパティタブで、​**\[Prompt (プロンプト)\]**​ にプレーンテキストを入力します。

この操作の XML 設定を次に示します。

```xml
<ms-chainai:chat-answer-prompt
  doc:name="Chat answer prompt"
  doc:id="8ba9d534-f801-4ac7-8a31-11462fc5204b"
  config-ref="MuleChain_AI_Llm_configuration"
  prompt="#[payload.prompt]"
/>
```

### [](#output-config)出力設定

この操作の応答には、メイン LLM 応答を含む JSON ペイロードが含まれます。

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

```json
{
    "response": "The capital of Switzerland is Bern. It's known for its well-preserved medieval old town, which is a UNESCO World Heritage site. Bern became the capital of Switzerland in 1848. The Swiss parliament, the Federal Assembly, is located in Bern."
}
```

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

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

## [](#chat-answer-prompt-with-memory-操作の設定)Chat Answer Prompt With Memory 操作の設定

**Chat answer prompt with memory**​ 操作は、マルチユーザーチャット操作の会話履歴を保持するのに役立ちます。

**Chat answer prompt with memory**​ 操作を設定する手順は、次のとおりです。

Unresolved include directive in modules/ROOT/pages/configuring-chat-operations.adoc - include::connectors::partial$t-configure-operations.adoc\[\] \* **Data**

\+ 操作のプロンプトを含めます。 \* **Memory Name (メモリ名)**

\+ 会話の名前。マルチユーザーサポートの場合、一意のユーザー ID を入力します。 \* **DB File Path (DB ファイルパス)**​

\+ 会話履歴を保存するメモリ内データベースへのパス。

\+ この項目では DataWeave 式を使用することもできます。次に例を示します。

\+ `#["/Users/john.wick/Desktop/mac-demo/db/" ++ payload.memoryName].` \* **Max Messages (最大メッセージ数)**

\+ **\[Memory Name (メモリ名)\]**​ で定義された会話で記憶するメッセージの最大数。

この操作の XML 設定を次に示します。

```xml
<ms-aichain:chat-answer-prompt-with-memory
  doc:name="Chat answer prompt with memory"
  doc:id="7e62e70e-eff7-4080-bb20-3d162bb84c39"
  config-ref="MuleSoft_AI_Chain_Config"
  memoryName="#[payload.memoryName]"
  dbFilePath='#["/Users/john.wick/Desktop/mac-demo/db/" ++ payload.memoryName]'
  maxMessages="#[payload.maxMessages]">
  <ms-aichain:data><![CDATA[#[payload.prompt]]]></ms-aichain:data>
</ms-aichain:chat-answer-prompt-with-memory>
```

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

この操作の応答には、メイン LLM 応答を含む JSON ペイロードが含まれ、追加のメタデータが属性に保存されています。

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

```json
{
    "response": "I'm sorry, I do not have access to personal information such as your name."
}
```

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

```json
{
  "tokenUsage": {
    "outputCount": 13,
    "totalCount": 44,
    "inputCount": 31
  },
  "additionalAttributes": {
    "memoryName": "memory",
    "maxMessages": "2",
    "dbFilePath": "/.../memory.db"
  }
}
```

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

- [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb)
- [MuleSoft AI Chain Connector の概要](https://docs.mulesoft.com/jp/mulesoft-ai-chain-connector/1.0/)
- [MuleSoft AI Chain Connector リファレンス](https://docs.mulesoft.com/jp/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-connector-reference)
- [MuleSoft ヘルプセンター](https://help.mulesoft.com)