Giter VIP home page Giter VIP logo

lark-ai-bot's Introduction

Lark OpenAI chat bot

Built with:

Conversation Branching

By default, user messages are a reply to the last message in the chat (unless the !new command is used).

If the user replies to a previous message in the chat history, a new conversation branch will be created starting from the replied message.

Bot Commands

  • !new (!reset) - starts a new conversation
    • Note: You can still resume previous conversations by replying to them.
  • !system - manages system prompt setting (for current chat)
    • !system - shows the current system prompt
    • !system default - restores the system prompt to default settings
    • !system One line answers by default. - overrides system prompt to "One line answers by default."

Run

Run without clone

  1. Create config.js (See config.example.js).
  2. Run deno run -A https://raw.github.com/lideming/lark-ai-bot/master/src/app.ts
    • or (for permission control)
      deno run --allow-net --allow-read --allow-write=data --allow-env https://raw.github.com/lideming/lark-ai-bot/master/src/app.ts

Clone and run from local source

  1. Clone this repo
  2. cp config.example.js config.js and edit config.js
  3. Run run.sh (Deno 1.28+ is required)

Configure on Lark/Feishu Open Platform

Event and Webhooks

Event and webhooks should be enabled and configured in Lark/Feishu Developer Console.

In Event Subscriptions, set Request URL to <API_HOST>/<APP_PATH>/events, and enable the im.message.receive_v1 event.

In Features - Bot, set Message Card Request URL to <API_HOST>/<APP_PATH>/interactive-events.

(<APP_PATH> is the key of apps config object.)

Permissions

Required permissions:

  • im:message.group_at_msg
  • im:message.p2p_msg
  • im:message:send_as_bot
  • im:message.groups

lark-ai-bot's People

Contributors

lideming avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.