Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adityaoberai/gemini-chatbot-appwrite
Appwrite Function that accepts a text prompt and returns a generation from Gemini 1.5 Flash
https://github.com/adityaoberai/gemini-chatbot-appwrite
appwrite appwrite-function gemini-15-flash google-generative-ai nodejs
Last synced: 3 months ago
JSON representation
Appwrite Function that accepts a text prompt and returns a generation from Gemini 1.5 Flash
- Host: GitHub
- URL: https://github.com/adityaoberai/gemini-chatbot-appwrite
- Owner: adityaoberai
- Created: 2024-07-27T07:19:48.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-28T10:40:08.000Z (5 months ago)
- Last Synced: 2024-10-03T13:31:28.435Z (3 months ago)
- Topics: appwrite, appwrite-function, gemini-15-flash, google-generative-ai, nodejs
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🤖 Node Prompt Gemini Function
Ask question, and let Google Gemini 1.5 Flash answer.
## 🧰 Usage
### POST /
Query the model for a completion.
**Parameters**
| Name | Description | Location | Type | Sample Value |
| ------------ | ------------------------------------ | -------- | ------------------ | ----------------------------- |
| Content-Type | The content type of the request body | Header | `application/json` | N/A |
| prompt | Text to prompt the model | Body | String | `Write a haiku about Mondays` |Sample `200` Response:
Response from the model.
```json
{
"ok": true,
"generation": "Monday's heavy weight, Dawning with a sigh of grey, Hopeful hearts await."
}
```Sample `400` Response:
Response when the request body is missing.
```json
{
"ok": false,
"error": "Missing prompt"
}
```Sample `500` Response:
Response when the model fails to respond.
```json
{
"ok": false,
"error": "Failed to query model."
}
```## ⚙️ Configuration
| Setting | Value |
| ----------------- | ------------- |
| Runtime | Node (18.0) |
| Entrypoint | `src/main.js` |
| Build Commands | `npm install` |
| Permissions | `any` |
| Timeout (Seconds) | 15 |## 🔒 Environment Variables
### GEMINI_API_KEY
A unique key used to authenticate with the Gemini API. Please note that this is a paid service and you will be charged for each request made to the API. For more information, see the [billing docs](https://ai.google.dev/gemini-api/docs/billing).
| Question | Answer |
| ------------- | ------------------------------------------------------------ |
| Required | Yes |
| Sample Value | `AIz...7CQ` |
| Documentation | [Google Docs](https://ai.google.dev/gemini-api/docs/api-key) |