Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Memo Chou
Memo Chou

Posted on • Edited on

     

GPT AI Assistant: Chat with AI using LINE App

About

GPT AI Assistant is a lightweight and extensible application that is implemented using the OpenAI API and LINE Messaging API.

Through the installation process, you can start to chat with your own AI assistant using the LINE mobile app.

Demo

GPT AI Assistant

Repository

https://github.com/memochou1993/gpt-ai-assistant

Installation

  • Log in to theOpenAI website.
  • Log in to theLINE website.
    • Add a provider (e.g. "My Provider").
    • Create a channel (e.g. "My AI Assistant") of type Messaging API.
    • Click the "Messaging API" tab and generate achannel access token.
  • Log in to theGitHub website.
    • Go to thegpt-ai-assistant project.
    • Click the "Star" button to support this project and the developer.
    • Click the "Fork" button to copy the source code to your own repository.
  • Log in to theVercel website.
    • Click the "Create a New Project" button to create a new project.
    • Click the "Import" button to import thegpt-ai-assistant project.
    • Click the "Environment Variables" tab and add the following environment variables with their corresponding values:
    • OPENAI_API_KEY with the OpenAIAPI key.
    • LINE_CHANNEL_ACCESS_TOKEN with the LINEchannel access token.
    • LINE_CHANNEL_SECRET with the LINEchannel secret.
    • APP_LANG withen.
    • Click the "Deploy" button and wait for the deployment to complete.
    • Go to the dashboard, copy the application URL, e.g. "https://gpt-ai-assistant.vercel.app/".
  • Go back to theLINE website.
    • Go to the page of "My AI Assistant", click the "Messaging API" tab, set the "Webhook URL" to application URL with "/webhook" path, e.g. "https://gpt-ai-assistant.vercel.app/webhook" and click the "Update" button.
    • Click the "Verify" button to verify the webhook call is successful.
    • Enable the "Use webhook" feature.
    • Disable the "Auto-reply messages" feature.
    • Disable the "Greeting messages" feature.
    • Scan the QR code using the LINE mobile app to add as a friend.
  • Start chatting with your own AI assistant!

Upgrade

On your owngpt-ai-assistant project page, you can click on the "Sync fork" menu and then click on either the "Update branch" or "Discard commit" button to synchronize the latest code to your repository.

When the Vercel bot detects a change in the code, it will automatically redeploy.

Commands

Send commands using the LINE mobile app to perform specific functions.

General Commands

NameAliasDescription
Talk/talkTalk with AI Assistant.
Draw/drawAsk AI Assistant to draw a picture.
Continue/continueAsk AI Assistant to continue the conversation.
Activate/activateActivate auto-reply. TheVERCEL_ACCESS_TOKEN environment variable is required.
Deactivate/deactivateDeactivate auto-reply. TheVERCEL_ACCESS_TOKEN environment variable is required.

System Commands

NameAliasDescription
Command/commandShow the application commands.
Version/versionShow the application version.
Documentation/docShow the documentation.
Report/reportReport issues.
Restart/restartDeploy the application. TheVERCEL_DEPLOY_HOOK_URL environment variable is required.

Sum Commands

NameAliasDescription
Sum/sumAsk AI Assistant to give a "summarize" response
Advise/adviseAsk AI Assistant to give a "advise" response
Apologize/apologizeAsk AI Assistant to give a "apologize" response
Blame/blameAsk AI Assistant to give a "blame" response
Comfort/comfortAsk AI Assistant to give a "comfort" response
Complain/complainAsk AI Assistant to give a "complain" response
Laugh/laughAsk AI Assistant to give a "laugh" response
Encourage/encourageAsk AI Assistant to give a "encourage" response

Analyze Commands

NameAliasDescription
Analyze/analyzeAsk AI Assistant to analyze
Analyze literarily/analyze-literarilyAsk AI Assistant to analyze literarily
Analyze mathematically/analyze-mathematicallyAsk AI Assistant to analyze mathematically
Analyze numerologically/analyze-numerologicallyAsk AI Assistant to analyze numerologically
Analyze philosophically/analyze-philosophicallyAsk AI Assistant to analyze philosophically
Analyze psychologically/analyze-psychologicallyAsk AI Assistant to analyze psychologically

Translate Commands

NameAliasDescription
Translate to English/translate-to-enAsk AI Assistant to translate text to English
Translate to Japanese/translate-to-jaAsk AI Assistant to translate text to Japanese

Environment Variables

Set environment variables to change program settings.

NameDefault ValueDescription
APP_DEBUGfalsePrint prompt to console. The value must betrue offalse.
APP_WEBHOOK_PATH/webhookCustom webhook URL path of application.
APP_LANGzhApplication language. The value must be one ofzh,en orja.
APP_MAX_GROUPS1Maximum groups. TheVERCEL_ACCESS_TOKEN environment variable is required.
APP_MAX_USERS5Maximum users. TheVERCEL_ACCESS_TOKEN environment variable is required.
BOT_NAMEAIName of AI Assistant. This is used to call AI Assistant when auto-reply is deactivated.
VERCEL_PROJECT_NAMEgpt-ai-assistantCustom Vercel project name. You can use this environment variable when the Vercel project name differs from the GitHub project name.
VERCEL_ACCESS_TOKENnullVercelaccess token
VERCEL_DEPLOY_HOOK_URLnullVerceldeploy hook URL
OPENAI_API_KEYnullOpenAIAPI key
OPENAI_COMPLETION_MODELtext-davinci-003Refer tomodel parameter for details.
OPENAI_COMPLETION_TEMPERATURE0.9Refer totemperature parameter for details.
OPENAI_COMPLETION_MAX_TOKENS160Refer tomax_tokens parameter for details.
OPENAI_COMPLETION_FREQUENCY_PENALTY0Refer tofrequency_penalty parameter for details.
OPENAI_COMPLETION_PRESENCE_PENALTY0.6Refer topresence_penalty parameter for details.
OPENAI_IMAGE_GENERATION_SIZE256x256Refer tosize parameter for details.
LINE_CHANNEL_ACCESS_TOKENnullLINEchannel access token
LINE_CHANNEL_SECRETnullLINEchannel secret

Click the "Redeploy" button to redeploy if there are any changes.

Debug

  1. Check if the environment variables of the project are filled out correctly in the Vercel.
  2. Click the "Redeploy" button to redeploy if there are any changes.
  3. If there is still a problem, please go toIssues page, describe your problem and attach a screenshot.

Related Projects

Top comments(1)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
jhunlimited_llc profile image
J H Unlimited L.L.C.
Senior System Architect with DoD Army USA
  • Joined

Well done mate. I have deployed to customers in Taiwan. Looking forward to collaboration in the future.

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Hi there 🙋I'm Memo Chou, a creative developer passionate about Go, PHP, Rust and JavaScript.Any questions, or want to get involved, please get in touch. Thanks for visiting!
  • Joined

More fromMemo Chou

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp