Skip to content

Latest commit

 

History

History
87 lines (50 loc) · 3.87 KB

TextGuide.md

File metadata and controls

87 lines (50 loc) · 3.87 KB

How to deploy LarkGPT

1. Create a new Bot in Lark OpenPlatform, and save appid & app secret in a text editor

Go to Lark Open Platform, create a new Custom App, then go to Credentials && Basic Info tab, copy the appid and app secret.

image

2. Open Robot Feature in "Open Features" Tab

Go to "Open Features" Tab, and add Robot Features. image

3. Create a new App in Aircode.io

Sign Up Aircode and create a new App.

  • AppName: your favorite bot name
  • Runtime: Node.js 16
  • Deployment region: US
  • Typescript: NO
image

4. Copy code in main.js, and paste in aircode's hello.js file.

Copy code from main.js image

Then, go to aircode, remove all default code, and paste code from [main.js][main.js]

remove old, default code is required.

image

5. set Environments

Add 3 new Environment in Environments tab in page right top.

  • APPID: value is your larksuite appid(you paste in text editor before), start with cli_
  • SECRET: value is your larksuite secret(you paste in text editor before)
  • KEY: value is your openai key,you can find it at OpenAI Platform, start with sk-
image

6. add requirements package

Install required package at Dependencies tab in page left bottom.

you need install two package @larksuiteoapi/node-sdk for invoke larksuite api, axios for invoke openai api.

install gif

7. Deploy

If you done Code/Environments/requiredments pacakges, then you can click deploy to done your first deploy.

image

And you will get a invoke url, copy it into your text editor.

image

8. Add required Scopes & events

Return to your Larksuite OpenPlatform Page, switch to Permissions & Scopes Page, add 3 Scopes.

  • im:message Read and send messages in private and group chats
  • im:message.group_at_msg Read group chat messages mentioning the bot
  • im:message.p2p_msg Read private messages sent to the bot
image

Then switch to Event Subscriptions Tab, and set aircode's invoke url as Request URL

image

After set Request URL, Add Event

  • im.message.receive_v1 Message received v2.0

9. create a new version and release it

Go to Version Management & Release Tab, and create a new version, and submit it to release.

image

10. Search Bot name in Larksuite App, and say Hi to it

image