Skip to content

everMitta/vertexai-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vertex AI Chatbot API

A FastAPI-based chatbot application that integrates with Google's Vertex AI to provide conversational AI capabilities.

Overview

This project provides a RESTful API for interacting with Google's Gemini AI model through Vertex AI. It's built with FastAPI and designed to be containerized using Docker for easy deployment.

Features

  • FastAPI Framework: Modern, fast web framework for building APIs
  • Google Vertex AI Integration: Leverages Gemini 2.5 Flash model for AI responses
  • Docker Support: Containerized application for consistent deployment
  • Conversation Management: Supports message history for contextual conversations
  • RESTful API: Clean API structure with versioned endpoints

Prerequisites

  • Python 3.14+
  • Google Cloud Project with Vertex AI API enabled
  • Service Account credentials with appropriate permissions
  • Docker (optional, for containerized deployment)

Installation

Local Setup

  1. Clone the repository:
git clone <repository-url>
cd vertexai-chatbot
  1. Install dependencies:
pip install -r requirements.txt
  1. Configure Google Cloud credentials:

    • Place your service account JSON file in app/credentials/credential.json
    • Ensure the service account has Vertex AI permissions
  2. Test the application:

fastapi dev main.py
  1. Run the application:
uvicorn app.main:app --host 0.0.0.0 --port 8000

Docker Setup

  1. Build the Docker image:
docker build -t vertexai-chatbot .
  1. Run the container:
docker run -p 8000:8000 vertexai-chatbot

API Usage

Send Message

Endpoint: POST /api/v1/chatbot/message

Request Body:

{
  "message": "Hello, how can you help me?",
  "history": [
        {
            "author_id": 0,
            "content": "AI-generated response"
        },
        {
            "author_id": 1,
            "content": "Hello, My name is Ever"
        }
  ]
}

Response:

{
  "message": "AI-generated response here",
  "status": true
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors