Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adityaoberai/characterchat
Appwrite function to enable chatting with fictional characters
https://github.com/adityaoberai/characterchat
appwrite nodejs openai
Last synced: about 1 month ago
JSON representation
Appwrite function to enable chatting with fictional characters
- Host: GitHub
- URL: https://github.com/adityaoberai/characterchat
- Owner: adityaoberai
- Created: 2024-04-03T15:19:49.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-03T16:31:46.000Z (10 months ago)
- Last Synced: 2024-10-30T10:27:09.445Z (3 months ago)
- Topics: appwrite, nodejs, openai
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Character Chat
OpenAI Function to chat with a popular fictional character
## 🧰 Usage
### POST /
- Returns an answer from your preferred fictional character
**Parameters**
| Name | Description | Location | Type | Sample Value |
| -------------------- | -------------------------------------- | -------- | ------------------ | ----------------------------------------------------------------------------------- |
| Content-Type | The content type of the request body | Header | `application/json` | N/A |
| character | Name of the fictional character | Body | String | `Bruce Wayne` |
| question | Question to be answered by Bruce Wayne | Body | String | `Are you Batman?` |
| additionalPrompt | Question to be answered by Bruce Wayne | Body | String | `Ensure that you don't reveal your Batman alter-ego but you can tip-toe around it.` |**Request**
```
{
"character": "Bruce Wayne",
"question": "Are you Batman?",
"additionalPrompt": "Ensure that you don't reveal your Batman alter-ego but you can tip-toe around it."
}
```**Response**
Sample `200` Response:
```json
{
"ok": true,
"answer": "As flattering as it is to be associated with such an iconic figure, I'm afraid I'm just a businessman with a keen interest in the welfare of Gotham City. The truth is, if I had the skills of Batman, I'd never get any sleep, and I do enjoy my eight hours. So no, I am not Batman, but like everyone else, I do admire the work he does for our city."
}
```## ⚙️ Configuration
| Setting | Value |
| ----------------- | ------------- |
| Runtime | Node (18.0) |
| Entrypoint | `src/main.js` |
| Build Commands | `npm install` |
| Permissions | `any` |
| Timeout (Seconds) | 60 |## 🔒 Environment Variables
- `OPENAI_API_KEY`: API Key from our OpenAI account
- `OPENAI_MAX_TOKENS`: Maximum number of tokens that the OpenAI response should contain (we’ll set this as `512`)