# AI 봇 - 채팅 및 DM 연동

**URL:** https://meta.discourse.org/t/ai-bot-chat-and-pm-integration/307353
**Category:** Site Management
**Tags:** chat, how-to, ai, ai-bot
**Created:** [5월 9, 2024, 4:42오전 UTC](https://meta.discourse.org/t/ai-bot-chat-and-pm-integration/307353 "2024-05-09T04:42:58Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [5월 9, 2024, 4:42오전 UTC](https://meta.discourse.org/t/ai-bot-chat-and-pm-integration/307353/1 "2024-05-09T04:42:58Z")

</div>

> 🔖 이 가이드는 [AI 봇 - 에이전트](https://meta.discourse.org/t/ai-bot-agents/306099)를 채팅 및 개인 메시지(PM) 경험에 통합하는 방법을 설명합니다.
> 
> 🙋 필요한 사용자 권한: 관리자

## 에이전트를 위한 채팅 및 PM 설정

> ℹ 채팅 또는 토픽 멘션과 통합하려면 에이전트에 `User`(사용자)가 생성되고 `Default Language Model`(기본 언어 모델)이 선택되어 있어야 합니다.

1. `Allow Personal Messages`(개인 메시지 허용)를 활성화하세요. 이렇게 하면 사용자가 에이전트에게 PM을 보낼 수 있습니다.

2. `Allow Topic Mentions`(토픽 멘션 허용)를 활성화하세요. 이렇게 하면 허용된 그룹의 사용자가 토픽에서 해당 에이전트를 멘션할 수 있습니다.

3. `Allow Chat Direct Messages`(채팅 다이렉트 메시지 허용)를 활성화하세요. 이렇게 하면 사용자 에이전트가 다이렉트 메시지(DM)를 받을 수 있습니다.

4. `Allow Chat Channel Mentions`(채팅 채널 멘션 허용)를 활성화하세요. 이렇게 하면 허용된 그룹의 사용자가 채팅 채널에서 해당 에이전트를 멘션할 수 있습니다.

## 채팅 에이전트 설정 팁

채팅용 에이전트를 설정할 때 다음 팁을 숙지하세요:

- **Max Context Posts** (최대 컨텍스트 게시물 수): 채팅 메시지는 짧은 경향이 있으므로, 멘션에 초점을 맞춘 에이전트의 경우 `Max Context Posts` 설정을 더 높은 숫자로 늘려 고려해 보세요. 이렇게 하면 AI가 이전 메시지에서 더 많은 컨텍스트를 유지할 수 있습니다.

- **Default LLM and User** (기본 LLM 및 사용자): 채팅 및 토픽 멘션은 기본 LLM(언어 모델)과 사용자를 모두 활성화한 경우에만 에이전트에서 사용할 수 있습니다. 이러한 설정을 올바르게 구성했는지 확인하세요.

- **PM 기반 기능** : PM 기반 에이전트에 사용 가능한 모든 기능은 채팅 에이전트에서도 사용할 수 있습니다. 그러나 PM에 표시되는 선택적 고급 디버깅 정보는 채팅에서는 표시되지 않습니다.

## 채팅 상호작용 감사(Auditing)

채팅 상호작용 감사는 다른 방법보다 다소 어려울 수 있습니다. 그러나 `ai_api_audit_logs`에는 여전히 모든 채팅 상호작용에 대한 전체 로그가 기록됩니다. Discourse의 [Data Explorer](https://meta.discourse.org/t/32566?silent=true)를 사용하여 이러한 로그를 조회할 수 있습니다.

## 채팅 동작 방식

채팅 에이전트와 상호작용할 때 다음 동작 방식을 염두에 두세요:

- **DM** : DM을 통해 봇으로 전송되는 모든 새 메시지에 대해 새 스레드가 무조건 생성됩니다.

- **Channel** : 채널에서 봇을 멘션하면 응답이 현재 컨텍스트에 추가됩니다. 기존 스레드 내에서 멘션된 경우 봇은 해당 스레드 내에서 응답합니다. 메인 채널에서 멘션된 경우 봇은 채널에 직접 응답합니다.

---

<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: [5월 10, 2024, 4:37오전 UTC](https://meta.discourse.org/t/ai-bot-chat-and-pm-integration/307353/2 "2024-05-10T04:37:12Z")

</div>

게시글이 새 주제로 분리되었습니다: [이름이 변경된 사용자의 멘션에 AI 채트가 반응하지 않음](https://meta.discourse.org/t/ai-chat-not-reacting-to-mentions-on-renamed-users/307488)

---

<div class="post-metadata">

### Author: ![MachineScholar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/machinescholar/32/424719_2.png) [@MachineScholar](https://meta.discourse.org/u/MachineScholar)
#### Post date: [6월 20, 2024, 9:12오전 UTC](https://meta.discourse.org/t/ai-bot-chat-and-pm-integration/307353/3 "2024-06-20T09:12:26Z")

</div>

정말 멋진 플러그인이고 잘 작동하고 있습니다. 하지만 아무리 설정을 바꿔봐도 해결하지 못한 문제가 두 가지 있습니다:

1. 기본 언어 모델을 선택할 수 없습니다. 이름을 입력하려고 하면 "일치하는 항목 없음"이라는 메시지만 표시됩니다. 따라서 페르소나를 위한 채팅 기능을 사용할 수 없습니다.
2. 어떤 이유에서인지 DM으로 봇과 상호작용할 때 이미지가 업로드되지 않습니다 (비전 기능이 활성화된 GPT-4o 사용 중)

이 두 가지 문제에 대해 어떤 조언이라도 주신다면 매우 감사하겠습니다.

---

<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: [7월 1, 2024, 1:50오전 UTC](https://meta.discourse.org/t/ai-bot-chat-and-pm-integration/307353/4 "2024-07-01T01:50:23Z")

</div>

이제 제대로 작동하는지 확인해 주시겠어요? (최신 버전으로 업데이트해 주세요. LLM 구성 방식을 다시 만들었습니다.)

---

<div class="post-metadata">

### Author: ![MachineScholar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/machinescholar/32/424719_2.png) [@MachineScholar](https://meta.discourse.org/u/MachineScholar)
#### Post date: [7월 1, 2024, 7:54오전 UTC](https://meta.discourse.org/t/ai-bot-chat-and-pm-integration/307353/5 "2024-07-01T07:54:00Z")

</div>

모두 고쳤어요. 정말 최고예요.

---

<div class="post-metadata">

### Author: ![Leo\_Wong](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leo_wong/32/286938_2.png) [@Leo\_Wong](https://meta.discourse.org/u/Leo_Wong)
#### Post date: [8월 25, 2024, 8:00오후 UTC](https://meta.discourse.org/t/ai-bot-chat-and-pm-integration/307353/6 "2024-08-25T20:00:49Z")

</div>

안녕하세요, 봇이 특정 채팅 채널에서만 응답하도록 설정할 수 있을까요? 감사합니다.

---

<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: [8월 25, 2024, 11:56오후 UTC](https://meta.discourse.org/t/ai-bot-chat-and-pm-integration/307353/7 "2024-08-25T23:56:34Z")

</div>

지금은 아니지만, 추가할 만한 좋은 아이디어입니다. 다만 현재는 멘션에만 응답하도록 되어 있어 꽤 숨겨진 기능이라고 할 수 있습니다. 또한 페르소나의 권한을 존중하므로, 해당 페르소나에 대한 접근 권한이 없는 사용자는 @멘션을 해도 응답을 받지 못합니다.

---

<div class="post-metadata">

### Author: ![piffy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/piffy/32/254198_2.png) [@piffy](https://meta.discourse.org/u/piffy)
#### Post date: [10월 24, 2024, 2:17오후 UTC](https://meta.discourse.org/t/ai-bot-chat-and-pm-integration/307353/8 "2024-10-24T14:17:04Z")

</div>

![Screenshot_20241024_101024_Firefox](https://global.discourse-cdn.com/meta/original/4X/4/a/4/4a4f03554f7f4b0259111e5099132eda47c10ce6.jpeg)

독립적인 주제가 될 만큼의 가치가 있는지 확실하지는 않지만, 이미지와 함께 있는 채팅 메시지에서는 [grid]가 중복되는 것 같습니다.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [10월 24, 2024, 2:21오후 UTC](https://meta.discourse.org/t/ai-bot-chat-and-pm-integration/307353/9 "2024-10-24T14:21:04Z")

</div>

> [@봇용 채팅에서 마크다운 완전 지원](https://meta.discourse.org/t/full-markdown-support-in-chat/312003):
>
> 채팅 창에서 마크다운을 완전히 지원해 주면 좋겠습니다. 현재는 [여기](https://meta.discourse.org/t/markdown-headers-arent-interpreted-in-chat/312000)에서 논의된 바와 같이, 마크다운 헤더가 의도적으로 렌더링되지 않는 것으로 보입니다. 대부분의 사람이 채팅에서 마크다운 헤더를 직접 입력하지는 않을 것입니다. 하지만 LLM은 그럴 수 있습니다. 챗봇이 점점 더 보편화되고 있는 만큼, LLM이 전송한 마크다운이 채팅 창에서 올바르게 표시되기를 바랍니다. 특히 RAG(Retrieval-Augmented Generation) 지원 봇의 경우, LLM은 주제에서 원본 게시글 콘텐츠를 수신하는데, 여기에는 마크다운 헤더가 포함될 수 있습니다. LLM이 이러한 헤더를 채팅 응답에 포함시킬 경우, 현재 상태로는 정상적으로 작동하지 않습니다.
