1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

LINE Messaging APIを使用して、自然言語でGoogleカレンダーに登録

Last updated at Posted at 2024-07-19

LineでGoogleカレンダーに登録

自然言語でGoogleカレンダーに予定を登録できるLine公式アカウントです。

リポジトリ: LineでGoogleカレンダーに登録

メッセージサンプル

テスト株式会社の山田さんと生成AIについて、7/24の13:00から1時間、品川で打ち合わせ


デモ画面

gif-output-Fri19Jul2024091530GMT.gif


技術スタック

言語: TypeScript
フレームワーク: Express
LLM: OpenAI


できること

テキストからGoogleカレンダーに保存
スクショを認識してGoogleカレンダーに保存
音声を解析してGoogleカレンダーに保存


使い方

環境変数登録

.env
OPEN_AI_API_TOKEN=
LINE_CHANNEL_SECRET=
LINE_ACCESS_TOKEN=
GOOGLE_CLIENT_EMAIL=
GOOGLE_PRIVATE_KEY=
GOOGLE_PROJECT_ID=

ドメイン駆動

設計をドメイン駆動で行いました。
リポジトリも公開しておりますので、ご確認ください。


主要ディレクトリとファイルの説明

ディレクトリ構成
├── Makefile
├── database.json
├── migrations
│   ├── 20240507030810-create-table-user.js
│   └── 20240507034654-delete-user-name-table-user.js
├── nodemon.json
├── package-lock.json
├── package.json
├── src
│   ├── application
│   │   └── useCase
│   │       ├── authUseCase
│   │       │   ├── loginUseCase.ts
│   │       │   └── signUpUseCase.ts
│   │       ├── index.d.ts
│   │       ├── line
│   │       │   ├── followUseCase
│   │       │   │   └── followUseCase.ts
│   │       │   ├── imageUseCase
│   │       │   │   └── imageUseCase.ts
│   │       │   ├── messageUseCase
│   │       │   │   └── messageUseCase.ts
│   │       │   └── postBackUseCase
│   │       │       └── postBackUseCase.ts
│   │       └── userUseCase
│   │           └── allUser.ts
│   ├── di
│   │   └── index.ts
│   ├── domain
│   │   ├── interface
│   │   │   ├── externals
│   │   │   │   ├── googleCalenderExternal.ts
│   │   │   │   ├── jwtTokenExternal.ts
│   │   │   │   ├── lineBotExternal.ts
│   │   │   │   └── llmExternal.ts
│   │   │   └── repositories
│   │   │       └── userRepositoryInterface.ts
│   │   ├── models
│   │   │   ├── calenderModel
│   │   │   │   ├── calenderEntity.ts
│   │   │   │   ├── dateTimeEntity.ts
│   │   │   │   ├── description.ts
│   │   │   │   ├── endDateTime.ts
│   │   │   │   ├── location.ts
│   │   │   │   ├── startDateTime.ts
│   │   │   │   ├── summary.ts
│   │   │   │   └── timeZone.ts
│   │   │   └── userModel
│   │   │       ├── email.ts
│   │   │       ├── password.ts
│   │   │       ├── salt.ts
│   │   │       ├── session.ts
│   │   │       └── userEntity.ts
│   │   └── services
│   ├── envs
│   │   └── config.ts
│   ├── index.ts
│   ├── infrastructure
│   │   ├── datastore
│   │   │   ├── db.ts
│   │   │   ├── dto
│   │   │   │   └── user.ts
│   │   │   ├── models
│   │   │   │   └── User.ts
│   │   │   └── repositoryImpl
│   │   │       └── UserRepository.ts
│   │   └── external
│   │       ├── google
│   │       │   └── calender
│   │       │       └── googleCalenderExternal.ts
│   │       ├── jwtTokenExternal
│   │       │   └── jwtToken.ts
│   │       ├── line
│   │       │   ├── lineBotExternal.ts
│   │       │   └── messageBuilder
│   │       │       ├── flexMessageBuilder.ts
│   │       │       └── textMessageBuilder.ts
│   │       └── llm
│   │           ├── gpt
│   │           │   └── chatGptExternal.ts
│   │           └── llmResponse.ts
│   └── presentation
│       └── api
│           └── server
│               ├── controller
│               │   ├── lineWebHookController.ts
│               │   └── userController.ts
│               ├── middleware
│               │   └── index.ts
│               └── router
│                   ├── implument.ts
│                   └── index.ts
└── tsconfig.json

41 directories, 53 files

migrations/

データベースマイグレーションファイル

src/

メインのソースコード

application/

アプリケーションのビジネスロジック

domain/

ドメインモデルと関連インターフェース

infrastructure/

外部サービスとの連携、データストア

presentation/

APIエンドポイントとコントローラー

Makefile

プロジェクトのビルドと管理用コマンド

package.json

プロジェクトの依存関係と設定

tsconfig.json

TypeScriptの設定ファイル

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?