Skip to content
/ AI Public

A Transformer-powered AI chatbot using the Gemini API and Qwen2.5 API with textual and image input support, prompt-based conversational context handling, sentence embeddings, and cosine similarity analysis.

License

Notifications You must be signed in to change notification settings

muskanas78/AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Chatbot using Gemini API and Transformers

Problem Statement

Conventional chatbots are often stateless and lack conversational continuity, resulting in responses that ignore prior dialogue context. Additionally, many systems do not incorporate semantic similarity techniques to understand how closely related different sentences are in meaning. This limits contextual awareness, continuity, and deeper semantic understanding in human–computer interaction.

Solution

This project implements a Python-based AI chatbot using Google's Gemini API and Transformer-based sentence embeddings (via Sentence-Transformers) to demonstrate:

  • Contextual awareness through conversation history injection
  • Semantic similarity analysis using cosine similarity
  • Transformer-based natural language understanding

Conversational context is maintained by explicitly storing and resending prior user and model messages with each API call. Sentence embeddings and cosine similarity are implemented as a foundational semantic analysis component, illustrating how meaning-based comparison between sentences can be performed.

Features

  • Integration with Google Gemini (Flash) API for AI-generated responses
  • Contextual conversation handling via in-memory message history
  • Transformer-powered sentence embeddings using all-MiniLM-L6-v2
  • Cosine similarity computation for semantic sentence comparison
  • Persistent conversation logging to chat_history.txt
  • Secure API key management using .env
  • Virtual environment compatibility
  • .gitignore configuration to protect sensitive files

Requirements

  • Python 3.8+
  • requests
  • python-dotenv
  • sentence-transformers
  • torch

You can install dependencies using:

pip install -r requirements.txt

About

A Transformer-powered AI chatbot using the Gemini API and Qwen2.5 API with textual and image input support, prompt-based conversational context handling, sentence embeddings, and cosine similarity analysis.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages