# 変数を使用したQ＆A回答のカスタマイズ

Q\&A回答は、適切な検索ツール（アンサーボットなど）と一緒に使用された場合、優れた顧客応対ツールとして動作します。また、Q\&A回答の多くはユーザーの質問に対して確実な回答のみを提供し、特定の状況に合わせてカスタマイズされた回答は提供できない為、あまり柔軟なツールとは言えません。

しかし、Alliの変数機能を使用してQ\&A回答を設計すれば、ユーザーからの質問に対してカスタマイズされた最適な回答を提供することができます。

Alliで変数を使用する方法に関しては、[**こちらのユーザーガイド**](/alli-llm-app-market/project-settings/variables.md)を参照してください。

## Q＆Aに変数を含める <a href="#how-to-include-variables-in-the-qa" id="how-to-include-variables-in-the-qa"></a>

1\. \[ナレッジベース ]＞\[ Q＆A]タブに移動します。 \[Q\&A追加]ボタンをクリックして、\[Q\&A直接入力]を選択します。

<figure><img src="/files/bCFxDX17rGsvO3tku5ZC" alt=""><figcaption></figcaption></figure>

2\. Q＆Aの回答部分に変数を含めることができます。回答入力部に「@」を入力 後、変数名の入力を行うと、ドロップダウンが表示されます。ここで変数を選 択します。（例：@cusと入力→CUSから始まる変数をLIST表示）

<figure><img src="/files/kPP2CzS7C7rDTx6tFbET" alt=""><figcaption></figcaption></figure>

\[登録する]をクリックして追加したQ＆Aを保存します。

## Q\&Aスキルの設計 <a href="#design-a-qa-skill" id="design-a-qa-skill"></a>

Q＆Aスキルを作成するためのガイドについては、[**こちらのユーザーガイド**](/alli-llm-app-market/app-management/node/qa-node.md)を参照してください。

Q\&Aに変数を適切に使用するためには、その変数に変数の値を割り当てる必要があります。その変数が自動的に変数の値を割り当てられる変数（[**システム変数など**](/alli-llm-app-market/project-settings/variables/sdk-variables-system-variables.md)）がない場合は、[**変数の値を設定ノード**](/alli-llm-app-market/app-management/node/assign-value-node.md)を使用するか、[**会話・質問応答ノード**](/alli-llm-app-market/app-management/node/conversation-nodes.md)などの変数の値の保存が可能な他のノードを使用します。

以下は会話応答とQ\&Aスキルの設定例です。 会話・質問応答ノードは、ユーザーの回答を@FIRST\_NAME変数に保存するため、質問への回答にはユーザー名が含まれます。

<figure><img src="/files/guHmkQOmVKKStkoTqBHG" alt=""><figcaption></figcaption></figure>

<figure><img src="https://i0.wp.com/guide.allganize.ai/wp-content/uploads/2022/06/image-4.png?resize=736%2C125&#x26;ssl=1" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/wFk11Pt837UGbeXyquiW" alt=""><figcaption></figcaption></figure>

Q\&Aの回答に変数を含めて使用する基本的な方法については以上とります。 ご参考までに下記に使用例を記載しております。

## 使用例 <a href="#example-use-case" id="example-use-case"></a>

簡単な例として、ユーザー情報に基づいて異なるURLをQ\&Aで提供したい場合、以下のように設定します。

<figure><img src="/files/s0MjZ3FgBsxpSf6yMvPe" alt=""><figcaption></figcaption></figure>

**1.\@SELECTEDと@SUBJECT変数をQ\&Aに使用**

<figure><img src="https://i0.wp.com/guide.allganize.ai/wp-content/uploads/2022/06/image-7.png?resize=737%2C468&#x26;ssl=1" alt=""><figcaption><p><br></p></figcaption></figure>

**2.ユーザーに種別を選択させて、結果に応じて@SUBJECT変数値を別の方法で保存**

<figure><img src="/files/j63vNaI4VMbj59NGtaah" alt=""><figcaption></figcaption></figure>

**3.ユーザーの選択に応じて、別のURLを指定してQ\&Aの回答として提示されます。**

[**システム変数**](/alli-llm-app-market/project-settings/variables/sdk-variables-system-variables.md)を利用すると、ユーザー側の国、ロケール、デバイス情報などを活用し、より多様な方法でQ\&A回答をカスタマイズすることができます。 変数を活用し、Q\&Aを有効に運営する方法について、不明な点がありましたら、担当アカウントマネージャーまでご連絡ください。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.allganize.ai/alli-llm-app-market/knowledge-base/qa/qa-variables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
