Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akhiljw46/kathyhere-backend
A dating AI Chat Bot API
https://github.com/akhiljw46/kathyhere-backend
ai api chatbot expressjs gemini google-gemini javascript nodejs
Last synced: 13 days ago
JSON representation
A dating AI Chat Bot API
- Host: GitHub
- URL: https://github.com/akhiljw46/kathyhere-backend
- Owner: akhiljw46
- License: mit
- Created: 2023-12-16T10:01:41.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2023-12-30T16:42:05.000Z (11 months ago)
- Last Synced: 2024-04-19T01:54:07.678Z (7 months ago)
- Topics: ai, api, chatbot, expressjs, gemini, google-gemini, javascript, nodejs
- Language: JavaScript
- Homepage: https://kathyhere.cyclic.app
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kathy Here Backend
An AI powered dating chatbot backend powered by [Google Gemini](https://ai.google.dev/)
Created using Express JS
Hosted on : https://kathyhere.cyclic.app
Frontend repository : https://github.com/akhiljw46/kathyhere-frontend
## How to run
### Step 1
Create a `config.env` file in the project folder with the following variables :
`API_KEY` : Google Gemini API key. You can get it [here](https://makersuite.google.com/app/apikey).
`PORT` : The port to run the server. Default port is 3000.
`ENVIRONMENT` : Either `development` or `production`.
`LOG_URL` : The database to save the logs in case of development.
### Step 2
Run the following commands:
```
npm install
npm start
```## API documentation
Send `POST` request to `{API_URL}/v1/message/{USER_MODEL}`
Where `{API_URL}` is the url of the server and `{USER_MODEL}` is the model to be used, either `kathy` or `tom`.
With payload in the forllowing format:
```
{
"messages": [
{
"id": 1703609459098,
"isUser": false,
"messageText": "Message by AI"
},
{
"id": 1703609459099,
"isUser": true,
"messageText": "Message by User"
}
]
}
```Where the `messages` array contains objects with the following properties:
`id` is the unique message id.
`isUser` is a boolean `true` if the message is by the user and `false` if the message is by the AI model.
`messageText` is the message content.
Response will be in the following format:
```
{
"status": "success",
"message": "Reply message"
}
```Where, `status` is either `success` or `failed`
and `message` is the reply message in case of `success` or error message in case of `failed` statuses.