Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zjx20/hcfy-gemini
https://github.com/zjx20/hcfy-gemini
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zjx20/hcfy-gemini
- Owner: zjx20
- Created: 2024-01-01T14:00:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-21T05:47:24.000Z (8 months ago)
- Last Synced: 2024-10-28T13:32:13.301Z (2 months ago)
- Language: Go
- Homepage: https://hcfy-gemini.vercel.app
- Size: 431 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## hfcy-gemini
### Usage
1. Compile `go build .`
2. Edit `config.json` to fill the gemini APIKey from https://makersuite.google.com/app/apikey.
3. Start the server `./hcfy-gemini`
4. Fill `http://localhost:7458/api/hcfy` to the hcfy setting.![hcfy setting](doc/hcfy.png)
### Deploy to Vercel
1. Create a new [Vercel](https://vercel.com) project by importing this repo.
1. Set "Framework Preset" to `Other`.
2. Set "Root Directory" to `vercel`.
3. Add environment variables:
* `GEMINI_API_KEY`: your gemini APIKey.
* `PASSWORD`: an arbitrary string that used to protect your Vercel API endpoint.![new vercel project](doc/new_vercel_project.png)
4. Fill `https://.vercel.app/api/hcfy?pass=` to the hcfy setting.
![hcfy setting](doc/hcfy_vercel.png)
### Deploy with Docker
1. Build image.
```bash
docker build -t hcfy-gemini:latest .
```2. Run.
```bash
docker run -d \
--name hcfy-gemini \
-e GEMINI_API_KEY="" \
-e MODEL_NAME="gemini-1.5-flash-latest" \
-e PASSWORD="" \
-p 7458:7458 \
--restart unless-stopped \
hcfy-gemini:latest
```3. Fill `http://:7458/api/hcfy?pass=` to the hcfy setting.
### For Immersive Translate
1. The `APIKEY` and `model` fields will not be used by `hcfy-gemini`, so you can fill in any values for them.
2. You can increase the value of `Maximum Requests Per Second` appropriately.
3. Fill `http://:/api/cjsfy` to the `Custom API Endpoint` field.
4. For the `Prompt`, fill in the following:```plaintext
{{to}}
-----splitter-----
{{text}}
```![cjsfy setting](doc/cjsfy.png)