This repository contains a LINE Bot application built using FastAPI, Firebase, and the Gemini Pro API. The bot can handle text and image messages, parse namecard information from images, and store/retrieve namecard data from Firebase.
- Parse namecard information from images using the Gemini Pro API.
- Store and retrieve namecard data from Firebase Realtime Database.
- Handle various text commands to list, add, and remove namecard data.
- Python 3.7+
- LINE Developer Account
- Firebase Account
- Gemini Pro API Key
-
Clone the repository:
git clone https://github.com/yourusername/linebot-namecard-manager.git cd linebot-namecard-manager
-
Install the required packages:
pip install -r requirements.txt
-
Set up environment variables:
export ChannelSecret='YOUR_CHANNEL_SECRET' export ChannelAccessToken='YOUR_CHANNEL_ACCESS_TOKEN' export GEMINI_API_KEY='YOUR_GEMINI_API_KEY' export FIREBASE_URL='YOUR_FIREBASE_URL'
-
Run the FastAPI application:
uvicorn main:app --reload
-
Set up your LINE webhook URL to point to your FastAPI server.
-
Interact with the bot using the following commands:
test
: Generate a sample namecard.list
: List all namecards in the database.remove
: Remove redundant namecard data.- Send an image of a namecard to parse and store its information.
- FastAPI: The web framework used to handle incoming requests from LINE.
- Firebase: Used to store and retrieve namecard data.
- Gemini Pro API: Used to parse namecard information from images.
Feel free to submit issues or pull requests if you have any improvements or bug fixes.
This project is licensed under the MIT License.