# メッセージ送信時に「Forum Helper」の「personas」を選択するAI bot api parameterは？

**URL:** https://meta.discourse.org/t/ai-bot-api-parameter-to-select-the-personas-to-be-forum-helper-when-sending-message/338119
**Category:** Support
**Tags:** rest-api, ai, ai-bot
**Created:** [2024 年 11 月 25 日午前 12:16 UTC](https://meta.discourse.org/t/ai-bot-api-parameter-to-select-the-personas-to-be-forum-helper-when-sending-message/338119 "2024-11-25T00:16:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![xFocus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xfocus/32/463960_2.png) [@xFocus](https://meta.discourse.org/u/xFocus)
#### Post date: [2024 年 11 月 25 日午前 12:16 UTC](https://meta.discourse.org/t/ai-bot-api-parameter-to-select-the-personas-to-be-forum-helper-when-sending-message/338119/1 "2024-11-25T00:16:06Z")

</div>

こんにちは皆さん、discourse-ai ボットへのリクエスト送信に関する質問です。

ai-ボットにメッセージを作成すると、「Forum Helper」の「personas」を選択できます。

 ![Screenshot 2024-11-24 at 4.05.44 PM](https://global.discourse-cdn.com/meta/original/4X/0/f/5/0f533ce41389583fa660742a18265b805963826f.png)

そして、以下のように Forum Helper が私のメッセージに応答します。

 ![Screenshot 2024-11-24 at 4.04.56 PM](https://global.discourse-cdn.com/meta/original/4X/6/4/c/64cc31202ae431c26f1e217b9019df5f6b0b747f.png)

そこで、API POST 呼び出しで同じことを行いたいと思います。以下は、リバースエンジニアリングの提案からコピーしたスクリプトのペイロードです。

```plaintext
    url = f"{DISCOURSE_BASE_URL}/posts"
    payload = {
        "title": subject,
        "raw": message,
        "target_recipients": DISCOURSE_BOT_USERNAME,
        "archetype": "private_message",
        "unlist_topic": "false",
        "category": "",
        "is_warning": "false",
        "typing_duration_msecs": "2600",
        "composer_open_duration_msecs": "53220",
        "featured_link": "",
        "shared_draft": "false",
        "draft_key": "private_message_ai",
        "meta_data[ai_persona_id]": "-1",
        "nested_post": "true"
    }
    response = requests.post(url, headers=HEADERS, json=payload)

```

 ![Screenshot 2024-11-24 at 3.31.53 PM](https://global.discourse-cdn.com/meta/original/4X/3/c/5/3c56e312048df49425d94416378205b8bed4e390.png)

しかし、得られたのは「Forum Helper」ではなく、私のフォーラムを検索しようとするボットでした。以下に示すように、gemni ユーザーの右側に「Forum Helper」というタグがありません。

 ![Screenshot 2024-11-24 at 4.07.17 PM](https://global.discourse-cdn.com/meta/original/4X/e/4/3/e437c03d8342fb2de533ab6b2224d8b9c6761276.png)

`/admin/plugins/discourse-ai/ai-personas` に移動して、「Forum Helper」のみをチェックし、他はすべてチェックを外しましたが、うまくいきませんでした。

「Forum Helper」にメッセージを送信したいことを示すために、キーとなるパラメータが不足しているのだと思います。デフォルトのものは、私のフォーラムコンテンツ内を検索しているように見えます。

ありがとうございます！🙂

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2024 年 11 月 25 日午前 12:57 UTC](https://meta.discourse.org/t/ai-bot-api-parameter-to-select-the-personas-to-be-forum-helper-when-sending-message/338119/2 "2024-11-25T00:57:56Z")

</div>

> [@xFocus](#):
>
> `"meta_data[ai_persona_id]": "-1",`

これがまさに重要な情報です。

これは何らかの方法で設定されていないのではないかと推測しますが、データエクスプローラーで確認していただけますか？

`select * from topic_custom_fields where id=XYZ`

---

<div class="post-metadata">

### Author: ![xFocus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xfocus/32/463960_2.png) [@xFocus](https://meta.discourse.org/u/xFocus)
#### Post date: [2024 年 11 月 25 日午後 3:41 UTC](https://meta.discourse.org/t/ai-bot-api-parameter-to-select-the-personas-to-be-forum-helper-when-sending-message/338119/3 "2024-11-25T15:41:15Z")

</div>

はい、その通りです。

データエクスプローラーから抽出したところ、`value` はどのペルソナと対話するかを示しています。サムさん、ありがとうございます 👍

 ![Screenshot 2024-11-25 at 7.38.53 AM](https://global.discourse-cdn.com/meta/original/4X/8/b/8/8b8b7c664e531dd213283c187270b40b8b5dbb16.png)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2024 年 12 月 25 日午後 3:41 UTC](https://meta.discourse.org/t/ai-bot-api-parameter-to-select-the-personas-to-be-forum-helper-when-sending-message/338119/4 "2024-12-25T15:41:24Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
