{"id":27222247,"url":"https://github.com/up2code/demo-line-gpt","last_synced_at":"2025-04-10T08:57:48.550Z","repository":{"id":271428149,"uuid":"913426717","full_name":"up2code/demo-line-gpt","owner":"up2code","description":"Demonstrate how to integrate OpenAI into LINE OA","archived":false,"fork":false,"pushed_at":"2025-01-07T17:00:38.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-07T18:18:14.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/up2code.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-07T16:57:55.000Z","updated_at":"2025-01-07T17:00:42.000Z","dependencies_parsed_at":"2025-01-07T18:18:16.890Z","dependency_job_id":"02f87f6b-fdaf-4002-9e7e-49cc8bf01d61","html_url":"https://github.com/up2code/demo-line-gpt","commit_stats":null,"previous_names":["up2code/demo-line-gpt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up2code%2Fdemo-line-gpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up2code%2Fdemo-line-gpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up2code%2Fdemo-line-gpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/up2code%2Fdemo-line-gpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/up2code","download_url":"https://codeload.github.com/up2code/demo-line-gpt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248190448,"owners_count":21062278,"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":"2025-04-10T08:57:47.986Z","updated_at":"2025-04-10T08:57:48.541Z","avatar_url":"https://github.com/up2code.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Demo LINE OA GPT\n\nDemonstrate how to integrate LINE OA with OpenAI\n\n## Prerequisite\n\n- [Python](https://www.python.org/)\n- [LINE Official Account](https://manager.line.biz/)\n- [LINE Developer](https://developers.line.biz/)\n- [GCP Account](https://console.cloud.google.com/) (Enable Cloud Functions API)\n- [gcloud CLI](https://cloud.google.com/sdk/docs/install)\n- [OpenAPI Account](https://platform.openai.com/) for get OpenAPI API Key\n\n## Environment Variables\n\nCreate file `.env` look like this and replace `YOUR_VALUE` to your own data.\n\n```sh\nOPENAI_API_KEY=YOUR_VALUE\nLINE_CHANNEL_ACCESS_TOKEN=YOUR_VALUE\nLINE_CHANNEL_SECRET=YOUR_VALUE\n```\n\n- `OPENAI_API_KEY`: OpenAI API Key. Required from https://platform.openai.com/\n- `LINE_CHANNEL_ACCESS_TOKEN`: Channel access token. Accquired from [LINE Developers console](https://developers.line.biz/console/) under your OA Channel.\n- `LINE_CHANNEL_SECRET`: Channel secret. Accquired from LINE OA Settings \u003e Messaging API\n\n## Deploy into GCP via gcloud CLI\n\nRun `deploy-gcp.sh`\n\n```sh\nsh deploy-gcp.sh\n```\n\nOr run it manually\n\n```sh\ngcloud functions deploy demo-line-gpt \\\n  --runtime python311 \\\n  --trigger-http \\\n  --region asia-southeast1 \\\n  --source . \\\n  --entry-point ask_gpt \\\n  --set-env-vars OPENAI_API_KEY=$OPENAI_API_KEY,LINE_CHANNEL_ACCESS_TOKEN=$LINE_CHANNEL_ACCESS_TOKEN,LINE_CHANNEL_SECRET=$LINE_CHANNEL_SECRET \\\n  --allow-unauthenticated\n```\n\n- You can change `demo-line-gpt` to your own cloud function name.\n- Change `asia-southeast1` to your closest region\n\nAfter deploy successfully. Copy result URL and set it into Webhook of your LINE OA. (This task do only once when deploy first time)\n\n## References\n\n- [LINE Python SDK](https://github.com/line/line-bot-sdk-python)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fup2code%2Fdemo-line-gpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fup2code%2Fdemo-line-gpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fup2code%2Fdemo-line-gpt/lists"}