https://github.com/codewithalihamza/nestjs-ai-assistant
NestJS AI Assistant is a powerful chatbot API built with NestJS and Google Gemini AI to provide intelligent, real-time conversations. It supports multi-session chat history, ensuring context-aware interactions.
https://github.com/codewithalihamza/nestjs-ai-assistant
Last synced: about 1 year ago
JSON representation
NestJS AI Assistant is a powerful chatbot API built with NestJS and Google Gemini AI to provide intelligent, real-time conversations. It supports multi-session chat history, ensuring context-aware interactions.
- Host: GitHub
- URL: https://github.com/codewithalihamza/nestjs-ai-assistant
- Owner: codewithalihamza
- Created: 2025-03-01T07:22:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-01T11:59:52.000Z (over 1 year ago)
- Last Synced: 2025-03-01T12:28:14.078Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 99.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#
🚀 NestJS AI Assistant – Conversational AI
## Description
NestJS AI Assistant is a powerful chatbot API built with NestJS and Google Gemini AI to provide intelligent, real-time conversations. It supports multi-session chat history, ensuring context-aware interactions.
Features:
- 🌟 Google Gemini AI Integration
- 💬 Multi-session Chat History
- 🚀 Built with NestJS for Scalability
- 🔐 Secure API with Configurable Keys
- 🔄 Easily Extendable for Custom Use Cases
## Installation
```bash
$ yarn install
```
## Running the app
```bash
# development
$ yarn run start
# watch mode
$ yarn run start:dev
# production mode
$ yarn run start:prod
```
## API Documentation
### **Chat with AI Assistant**
#### **Endpoint:**
```
POST /ai_assistant/chat
```
#### **Request Headers:**
```json
{
"Content-Type": "application/json"
}
```
#### **Request Body:**
| Parameter | Type | Required | Description |
|------------|--------|----------|-------------|
| `prompt` | string | ✅ Yes | The text input for the AI model. |
| `sessionId` | string | ❌ No | A unique identifier to maintain chat history (optional). |
#### **Example Request:**
```bash
curl -X POST http://localhost:5000/ai_assistant/chat \
-H "Content-Type: application/json" \
-d '{
"prompt": "What is the capital of Pakistan?",
"sessionId": "uuid"
}'
```
#### **Example Response:**
```json
{
"response": "The capital of Pakistan is Islamabad.",
"sessionId": "uuid"
}
```
#### **Response Details:**
| Parameter | Type | Description |
|-------------|--------|-------------|
| `response` | string | The AI-generated reply. |
| `sessionId` | string | The same session ID (if provided) for tracking conversation history. |
---
## Notes
- The `sessionId` is **optional** but useful for maintaining chat context.
- If `sessionId` is provided, the AI will remember previous prompts and responses.
## 💫 About Me:
I'm Ali Hamza from Pakistan 🇵🇰, an experienced Full Stack Developer. With a comprehensive understanding of both front-end and back-end technologies, I am dedicated to creating strong and reliable software applications that perform well and meet the needs of the users effectively. 💻🚀
## 💻 Tech Stack:
              
## Stay in touch
- Linkedin - [@syedalihamzaofficial](https://www.linkedin.com/in/syedalihamzaofficial/)
- Website - [Ali Hamza](https://syedalihamzaofficial.blogspot.com/)
- Medium - [@syedalihamzaofficial](https://medium.com/@syedalihamzaofficial)
- YouTube - [@TechnicalHamzaOfficial1](https://www.youtube.com/@TechnicalHamzaOfficial1)