Skip to content

codewithalihamza/NestJS-AI-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Nest Logo

πŸš€ 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

$ yarn install

Running the app

# 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:

{
  "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:

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:

{
  "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:

JavaScript React Next JS Bootstrap NodeJS NestJS Express.js CSS3 HTML5 TypeScript MongoDB Postgres MySQL GraphQL TailwindCSS

Stay in touch

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors