{"id":13615715,"url":"https://github.com/ctjoy/chatgpt-line-bot-serverless","last_synced_at":"2025-04-13T21:31:28.167Z","repository":{"id":215835016,"uuid":"619053991","full_name":"ctjoy/chatgpt-line-bot-serverless","owner":"ctjoy","description":"Build a ChatGPT LINE Bot in 10 minutes running on AWS Lambda powered by Serverless Framework","archived":false,"fork":false,"pushed_at":"2023-03-26T07:09:52.000Z","size":19889,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-07T23:40:02.491Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ctjoy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-03-26T05:50:49.000Z","updated_at":"2023-10-02T13:23:47.000Z","dependencies_parsed_at":"2024-01-12T23:52:02.197Z","dependency_job_id":null,"html_url":"https://github.com/ctjoy/chatgpt-line-bot-serverless","commit_stats":null,"previous_names":["ctjoy/chatgpt-line-bot-serverless"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctjoy%2Fchatgpt-line-bot-serverless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctjoy%2Fchatgpt-line-bot-serverless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctjoy%2Fchatgpt-line-bot-serverless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctjoy%2Fchatgpt-line-bot-serverless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctjoy","download_url":"https://codeload.github.com/ctjoy/chatgpt-line-bot-serverless/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248786301,"owners_count":21161429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T20:01:16.968Z","updated_at":"2025-04-13T21:31:23.149Z","avatar_url":"https://github.com/ctjoy.png","language":"Python","funding_links":[],"categories":["Integrations","UIs"],"sub_categories":["LINE","Messenger bots"],"readme":"# ChatGPT LINE bot with Serverless Framework\n\nYou can talk to ChatGPT in LINE. The bot is deployed and running on AWS Lambda using the Serverless Framework. You can find the tutorial [here](https://joychen.me/posts/chatgpt-line-bot-serverless/).\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./assets/ChatGPT_LINE_bot.gif\" width=\"800\"/\u003e\n\u003c/p\u003e\n\n## Credentials\n\n1. Create an [OpenAI account](https://platform.openai.com/) and [API Key](https://platform.openai.com/account/api-keys)\n2. Create a [LINE Developer account](https://developers.line.biz/en/) and set up a channel with [Message API](https://developers.line.biz/en/services/messaging-api/)\n3. Create an [AWS account](https://aws.amazon.com/) and create an [IAM role](https://www.serverless.com/framework/docs/providers/aws/guide/credentials)\n\nCreate a file called `.env.yml`, and put the keys in the file.\n\n```yaml\nopenaiKey: \u003cOPENAI_API_KEY\u003e\nlineChannelSecret: \u003cLINE_CHANNEL_SECRET\u003e\nlineChannelAccessToken: \u003cLINE_CHANNEL_ACCESS_TOKEN\u003e\n```\n\n## Installation\n\n```bash\npython3.8 -m venv ./venv\nsource ./venv/bin/activate\npip install -r requirements.txt\n```\n\n## Deployment\n\ninstall dependencies with:\n\n```\nnpm install\n```\n\nconfigure AWS credentials:\n\n```\nexport AWS_ACCESS_KEY_ID=\u003cyour-key-here\u003e\nexport AWS_SECRET_ACCESS_KEY=\u003cyour-secret-key-here\u003e\n```\n\nand then perform deployment with:\n\n```\nserverless deploy\n```\n\nAfter running deploy, you should see output similar to:\n\n```bash\nDeploying chatgpt-line-bot-serverless to stage dev (us-east-1)\n\n✔ Service deployed to stack chatgpt-line-bot-serverless-dev (182s)\n\nendpoint: ANY - https://xxxxxxxx.execute-api.us-east-1.amazonaws.com\nfunctions:\n  api: chatgpt-line-bot-serverless-dev-api (1.5 MB)\n```\n\n_Note_: In current form, after deployment, your API is public and can be invoked by anyone. For production deployments, you might want to configure an authorizer. For details on how to do that, refer to [httpApi event docs](https://www.serverless.com/framework/docs/providers/aws/events/http-api/).\n\n## Invocation\n\nAfter successful deployment, put this URL into `Webhook URL` on LINE Developers Platform.\n\n```bash\nhttps://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/\n```\n\nAdd the channel in your LINE account, then you can start chatting with ChatGPT!\n\n## Todo\n\n- [ ] Separate conversation history for different user\n- [ ] Support voice message\n\nWelcome to contribute!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctjoy%2Fchatgpt-line-bot-serverless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctjoy%2Fchatgpt-line-bot-serverless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctjoy%2Fchatgpt-line-bot-serverless/lists"}