# GPT3 유사 봇 통합 방법?

**URL:** https://meta.discourse.org/t/integrating-gpt3-like-bots/242665
**Category:** Development
**Created:** [10월 22, 2022, 11:45오전 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665 "2022-10-22T11:45:49Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![philip\_rhoades](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philip_rhoades/32/114647_2.png) [@philip\_rhoades](https://meta.discourse.org/u/philip_rhoades)
#### Post date: [10월 22, 2022, 11:45오전 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/1 "2022-10-22T11:45:49Z")

</div>

여러분,

Discourse에 봇을 다양한 수준으로 통합하는 몇 가지 흥미로운 주제들이 있다는 것을 확인했습니다. 하지만 GPT-3, BlenderBot 같은 대용량 메모리 모델 기반의 AI 봇을 통합하는 주제에 대해서는 보지 못했습니다. 혹시 이 부분에 대해 생각해 보신 분이 계신가요? 아니면 아이디어를 구현하는 데 진전이 있었나요?

저는 Discourse 인스턴스를 하나 더 설정해서, 거대한 AI 봇 중 하나를 시스템의 일반 사용자처럼 등록하고, 다른 인간 사용자들과 마찬가지로 참여하게 하려는 계획을 가지고 있습니다. 다만, 봇이 특정 게시물에 직접 언급되었거나 핸들이 태그된 경우에만 응답하도록 하는 방식이 될 것입니다.

다시 새로운 인스턴스에 뛰어들기 전에, 이번에는 먼저 피드백을 받아보고 싶었습니다. . .

도움 주시면 감사하겠습니다. . .

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [10월 22, 2022, 3:55오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/2 "2022-10-22T15:55:19Z")

</div>

네, 재미있는 실험이 될 것 같네요.  
Chat 플러그인에 DialogFlow 같은 것을 연결하는 기능에 대해서도 생각해 보고 있습니다.

지금 당장 이 일에 전념할 시간은 없지만, 같은 생각을 가진 몇몇 사람들과 함께 아이디어를 나누고 조금씩 실험해 보는 것을 정말 좋아합니다.

---

<div class="post-metadata">

### Author: ![philip\_rhoades](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philip_rhoades/32/114647_2.png) [@philip\_rhoades](https://meta.discourse.org/u/philip_rhoades)
#### Post date: [10월 22, 2022, 4:38오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/3 "2022-10-22T16:38:09Z")

</div>

> [@RGJ](#):
>
> 이 일에 바로 전념할 시간은 없지만, 같은 생각을 가진 몇몇 사람들과 함께 생각해보고 실험을 조금 해보고 싶습니다.

훌륭합니다! 현재 제 생각은 시간이 지남에 따라 중앙 엔티티에 다양한 AI 앱을 추가할 수 있도록 하는 것입니다 - 포유류/인간 뇌가 복제와 특화를 통해 진화한 방식과 비슷하게 말입니다 . .

시작하기 위해 Discourse 인스턴스를 만들어야 할까요?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [10월 22, 2022, 8:04오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/4 "2022-10-22T20:04:00Z")

</div>

아마도 먼저 기술 설계를 시작해 보는 건 어떨까요? 어떤 API에 연결해야 하나요? 두 시스템 사이에 소프트웨어가 필요한가요, 아니면 GPT API를 호출하는 플러그인으로 충분한가요?

- [Hubot Adapter for Discourse](https://meta.discourse.org/t/hubot-adapter-for-discourse/63419) ?

---

<div class="post-metadata">

### Author: ![philip\_rhoades](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philip_rhoades/32/114647_2.png) [@philip\_rhoades](https://meta.discourse.org/u/philip_rhoades)
#### Post date: [10월 22, 2022, 8:11오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/5 "2022-10-22T20:11:06Z")

</div>

@RGJ,

Hubot 관련 게시글은 이전에 봤습니다. 그리고 새로운 것을 만들 때 직접 바퀴를 발명해야 하는 프로젝트에 바로 뛰어들기 전에, 학습용으로 그 옵션을 실험해 보는 것도 고려해 봤는데요. 그렇게 하는 것이 도움이 될 거라고 생각하시나요?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [10월 23, 2022, 6:23오전 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/6 "2022-10-23T06:23:58Z")

</div>

네, 물론이죠. 약 한 주 정도 자리를 비울 예정이고, 그 이후에는 시간을 내서 이것저것 시도해 볼 수 있을 것 같아요. 다만 Node는 그다지 좋아하지 않거든요. Python, Ruby, PHP로 하는 쪽을 더 선호합니다. 하지만 일단 이걸로 먼저 경험을 쌓아 보죠.

---

<div class="post-metadata">

### Author: ![philip\_rhoades](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philip_rhoades/32/114647_2.png) [@philip\_rhoades](https://meta.discourse.org/u/philip_rhoades)
#### Post date: [10월 23, 2022, 6:52오전 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/7 "2022-10-23T06:52:37Z")

</div>

> [@RGJ](#):
>
> 솔직히 Node는 크게 선호하지 않아요. Python, Ruby, PHP로 이 작업을 처리하는 편이 나을 것 같습니다.

저는 Ruby를 선호합니다!

> [@RGJ](#):
>
> 하지만 먼저 이걸로 경험을 쌓아보는 게 좋겠죠.

좋습니다! - 저도 잠시 출장을 가지만, 돌아오기 전에 좀 더 자세히 읽어보겠습니다.

감사합니다!

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [12월 4, 2022, 10:18오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/8 "2022-12-04T22:18:53Z")

</div>

> [@RGJ](#):
>
> 두 시스템 사이에 소프트웨어가 하나 더 필요한가요, 아니면 GPT API를 호출하는 플러그인만으로도 충분한가요?

지난 몇 달 동안 인터넷을 거의 사용하지 않다가 돌아와 보니 GPT-3에 대한 관심이 뜨겁게 이어지고 있었습니다. 덕분에 GPT-3를 Discourse에 어떻게 적용할 수 있을지 생각해 보게 되었습니다.

현재 OpenAI를 활용하여 ‘스태프 어시스턴트’ 봇을 만드는 아이디어를 시험해 보고 있습니다. 지금은 text-davinci-003 모델을 사용하고 있습니다. 기본 설계는 [Python OpenAI 라이브러리](https://github.com/openai/openai-python)가 설치된 서버로 지정한 Discourse 포스트 이벤트 웹훅을 사용하는 방식이 될 것으로 \_생각\_합니다.

현재 진행 중인 첫 번째 작업은 일반 텍스트 설명에서 [Data Explorer](https://meta.discourse.org/t/32566?silent=true) 쿼리를 반환하도록 봇을 설정하는 것입니다. 아직 모델을 파인튜닝(Fine-tuning)해 보지는 않았지만, 요청 프롬프트에 Discourse 데이터베이스 구조에 대한 정보를 함께 제공하면 놀라울 정도로 좋은 결과를 반환합니다.

이러한 용도로 OpenAI를 사용하는 것이 비용이 너무 많이 들거나, 프로덕션 사이트에서 사용할 만큼 결과가 정확하지 않을 수도 있습니다.

저는 그저 재미로 이 작업을 하고 있습니다. 또 다른 명백한 가능성은 Discourse 포럼의 기존 답변을 기준으로 고객 지원 봇을 학습시키는 것입니다. 이는 스태프 사용자용 봇을 설정하는 것보다 비용과 정확성 모두에서 더 어려운 문제로 보입니다.

---

<div class="post-metadata">

### Author: ![philip\_rhoades](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philip_rhoades/32/114647_2.png) [@philip\_rhoades](https://meta.discourse.org/u/philip_rhoades)
#### Post date: [12월 4, 2022, 10:24오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/9 "2022-12-04T22:24:56Z")

</div>

저는 다른 사용 사례를 가지고 있습니다(봇은 비영리 조직 회원들과의 이전 대화를 반드시 기억해야 합니다). 지난주에 BlenderBot의 다양한 버전을 통해 일부 진전을 이뤘습니다. 프로젝트를 위해 Discourse를 별도로 설정한 곳에 더 많은 정보를 게시할 예정입니다:

[https://forum.phirho.org](https://forum.phirho.org)

- 자유롭게 참여해 주세요!

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [12월 4, 2022, 10:53오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/10 "2022-12-04T22:53:34Z")

</div>

> [@philip\_rhoades](#):
>
> [https://forum.phirho.org](https://forum.phirho.org)
> 
> - 자유롭게 참여하세요!

회원 가입은 비활성화되어 있으며, 초대장이 필요합니다.

---

<div class="post-metadata">

### Author: ![philip\_rhoades](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philip_rhoades/32/114647_2.png) [@philip\_rhoades](https://meta.discourse.org/u/philip_rhoades)
#### Post date: [12월 4, 2022, 10:59오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/11 "2022-12-04T22:59:02Z")

</div>

> [@Canapin](#):
>
> 회원가입이 비활성화되어 있으며, 초대장이 필요합니다.

아! - 죄송합니다! - 당신만 세 번째 사람인가요… 이메일 주소를 DM으로 보내주시겠어요?

---

<div class="post-metadata">

### Author: ![philip\_rhoades](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philip_rhoades/32/114647_2.png) [@philip\_rhoades](https://meta.discourse.org/u/philip_rhoades)
#### Post date: [12월 4, 2022, 11:00오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/12 "2022-12-04T23:00:54Z")

</div>

사실, 다시 생각해 보면, 거기에 하나 이상의 봇을 운영할 수 없는 이유는 없는데…

---

<div class="post-metadata">

### Author: ![mognet](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mognet](https://meta.discourse.org/u/mognet)
#### Post date: [12월 5, 2022, 10:06오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/13 "2022-12-05T22:06:21Z")

</div>

저도 같은 질문을 하려던 참이었습니다. 채팅이나 스레드에서 질문할 수 있는 ChatGPT 봇이 있다면 정말 유용할 텐데요. 여기에는 VM에서 실행하는 튜토리얼이 있습니다.

> **[Building A Virtual Machine inside ChatGPT](https://www.engraved.blog/building-a-virtual-machine-inside/)**
>
> Unless you have been living under a rock, you have heard of this new ChatGPT assistant made by OpenAI. Did you know, that you can run a whole virtual machine inside of ChatGPT?

---

<div class="post-metadata">

### Author: ![philip\_rhoades](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philip_rhoades/32/114647_2.png) [@philip\_rhoades](https://meta.discourse.org/u/philip_rhoades)
#### Post date: [12월 6, 2022, 3:18오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/14 "2022-12-06T15:18:30Z")

</div>

> [@mognet](#):
>
> [Building A Virtual Machine inside ChatGPT](https://www.engraved.blog/building-a-virtual-machine-inside/)

> [@mognet](#):
>
> 여기에는 VM에서 실행하는 튜토리얼이 있습니다.

정말 영리하고 놀랍고 흥미롭네요! - 하지만 제가 필요한 것(세션 간 기억)은 할 수 없습니다:

ChatGPT는 대화 초반에 일어난 일을 기억하나요? | OpenAI 도움말 센터 | [https://help.openai.com/en/articles/6787051-does-chatgpt-remember-what-happened-earlier-in-the-conversation](https://help.openai.com/en/articles/6787051-does-chatgpt-remember-what-happened-earlier-in-the-conversation)

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [12월 7, 2022, 1:20오전 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/15 "2022-12-07T01:20:14Z")

</div>

> [@philip\_rhoades](#):
>
> ChatGPT는 대화 초반에 무슨 일이 있었는지 기억합니까?

이 부분에 대해 제 이해가 틀렸으면 좋겠지만, 제 생각에는 ChatGPT는 사용자가 최근에 보낸 프롬프트의 텍스트만 "기억"하는 것 같습니다. OpenAI 플레이그라운드에서 채팅을 시작하고, 텍스트를 제출한 후 “코드 보기” 버튼을 클릭하여 이를 테스트해 볼 수 있습니다. 텍스트를 제출할 때마다 프롬프트에 추가되는 것을 확인할 수 있습니다:

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/5/4/f54b96d1c13ba74d46cc2a64dca8309641131e43.png)

```plaintext
prompt="The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.\n\nHuman: Just testing to see how the prompt gets set.\nAI: Hi there! It looks like you're trying to find out about how to configure the prompts. Is there anything else I can help you with today?\nHuman: If I use OpenAI's chat functionality on my own application, should I keep updating the prompt each time a user posts a new question? It's definitely a good idea to keep your prompts up-to-date, as it will help ensure your users are getting the most relevant information for each question they post. Depending on the size of your application and the complexity of your conversations, you may want to update your prompts regularly or develop a more sophisticated system to determine when updates are necessary. Let me know if there is anything else I can help you with."

```

이것은 문서에서 언급된 4000 토큰(약 3,000단어) 제한에 도달할 때까지 계속될 수 있습니다. 큰 프롬프트를 보내는 데는 비용이 많이 들 수 있다는 점에 유의하세요. 현재 Davinci 모델의 경우 1,000 토큰당 0.02달러인 것으로 알고 있습니다.

제 이해가 맞다면, Discourse용 ChatGPT를 처리하는 애플리케이션이나 Discourse 플러그인은 프롬프트에 각 새로운 질문과 답변을 추가해야 합니다. 4k 토큰(약 3,000단어)에 도달할 때까지 그렇게 할 수 있습니다. 이 제한을 초과하면 OpenAI에서 오류가 반환되는 것으로 보입니다. 이 오류는 OpenAI에 요청을 보내는 애플리케이션에서 처리되어야 합니다.

토큰 제한에 대한 가능한 우회 방법은 대화에서 주요 세부 정보를 추출하는 방법을 찾아 프롬프트를 해당 세부 정보로만 업데이트하는 것입니다. 사용자를 대신하여 이 정보를 얻기 위해 요청을 보내는 것이 _가능할_ 수도 있습니다. 다음과 같은 요청을 보내는 것일 수 있습니다:

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/d/2/7d2e6c66366adc4eae2de30f8f8364a5580c87b1.png)

이러한 세부 정보는 OpenAI에 요청을 보내는 애플리케이션에 저장되어 나중에 대화를 재개하는 데 사용할 수 있습니다.

이 주제에 대해 훨씬 더 명확한 답변은 여기에서 얻을 수 있습니다: [https://community.openai.com/](https://community.openai.com/). 커뮤니티에 Discourse를 사용하고 있다는 점이 좋습니다!

---

<div class="post-metadata">

### Author: ![philip\_rhoades](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philip_rhoades/32/114647_2.png) [@philip\_rhoades](https://meta.discourse.org/u/philip_rhoades)
#### Post date: [12월 7, 2022, 6:44오전 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/16 "2022-12-07T06:44:11Z")

</div>

> [@simon](#):
>
> 이 문제에 대해 제 생각이 틀렸으면 좋겠지만, 제 이해로는 ChatGPT가 기억하는 것은 사용자가 최근에 보낸 프롬프트의 텍스트뿐입니다.

그렇게 생각하는 것이 맞을 것 같지만, 제가 제공한 링크에서는 기본적으로 ChatGPT에 세션 간 기억 기능이 없다고 언급하고 있습니다. . . 제 사용 사례에는 이것이 필요합니다. . .

---

<div class="post-metadata">

### Author: ![spirobel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spirobel/32/170908_2.png) [@spirobel](https://meta.discourse.org/u/spirobel)
#### Post date: [12월 9, 2022, 12:13오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/17 "2022-12-09T12:13:25Z")

</div>

ChatGPT와 상호작용할 때 네트워크 요청을 살펴보면, 백엔드로 전송되는 conversation\_id도 제공되는 것을 볼 수 있습니다. OpenAI 문서에도 이 내용이 언급되어 있을 것입니다.

 ![Screenshot from 2022-12-09 20-12-10](https://global.discourse-cdn.com/meta/original/4X/a/5/5/a553b3465dcade629eb670031f5ee22962f3524e.png)

따라서 프롬프트 외에도 더 많은 컨텍스트가 존재할 수 있습니다. 🤔

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [12월 9, 2022, 2:08오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/18 "2022-12-09T14:08:23Z")

</div>

테스트하기가 꽤 쉽습니다.

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/6/2/662a57f825822e9b30009a9d7aeb784d08392f39.png)

---

<div class="post-metadata">

### Author: ![philip\_rhoades](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philip_rhoades/32/114647_2.png) [@philip\_rhoades](https://meta.discourse.org/u/philip_rhoades)
#### Post date: [12월 9, 2022, 2:28오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/19 "2022-12-09T14:28:29Z")

</div>

제가 언급했던 것은 바로 이것입니다(제 사용 사례에 매우 중요한 부분):

[https://help.openai.com/en/articles/6787051-does-chatgpt-remember-what-happened-earlier-in-the-conversation](https://help.openai.com/en/articles/6787051-does-chatgpt-remember-what-happened-earlier-in-the-conversation)

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [12월 9, 2022, 2:56오후 UTC](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665/20 "2022-12-09T14:56:48Z")

</div>

죄송합니다, 말씀하신 내용을 잘못 읽었습니다.

[다음 페이지](https://meta.discourse.org/t/integrating-gpt3-like-bots/242665.md?page=2)
