help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • Blog
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
anthropic-claude-chatbot
RSK World
anthropic-claude-chatbot
Anthropic Claude Chatbot - Python + Flask + Claude API + JavaScript + AI Chatbot + Conversational AI
anthropic-claude-chatbot
  • __pycache__
  • .env578 B
  • .gitignore669 B
  • ADVANCED_FEATURES.md6.6 KB
  • CHECKLIST.md3 KB
  • GITHUB_RELEASE_GUIDE.md4.6 KB
  • LICENSE1.3 KB
  • PROJECT_INFO.md2.2 KB
  • QUICK_START.md2.8 KB
  • README.md8.5 KB
  • RELEASE_NOTES.md6.6 KB
  • SETUP_ENV.md1.9 KB
  • TROUBLESHOOTING.md5.1 KB
  • advanced-features.js24.9 KB
  • app.py9.7 KB
  • config.py2.4 KB
  • env.example550 B
  • index.html11.4 KB
  • requirements.txt440 B
  • run.bat782 B
  • run.sh713 B
  • script.js21.2 KB
  • setup.py2.5 KB
  • start-frontend.bat683 B
  • start.bat1.6 KB
  • styles.css20.2 KB
RELEASE_NOTES.mdrequirements.txtLICENSEsearch.pyREADME.mdconfig.pyCHANGELOG.mdSETUP_ENV.md
RELEASE_NOTES.md
Raw Download

RELEASE_NOTES.md

# Release Notes - Anthropic Claude Chatbot v1.0.0

**Release Date:** January 2026
**Developer:** RSK World
**Website:** https://rskworld.in
**Repository:** https://github.com/rskworld/anthropic-claude-chatbot

---

## 🎉 Version 1.0.0 - Initial Release

### Overview

This is the initial release of the Anthropic Claude Chatbot - a powerful, feature-rich chatbot interface integrated with Anthropic's Claude API. This release includes advanced conversational AI capabilities with a modern, user-friendly interface.

---

## ✨ Features

### Core Features
- ✅ **Claude API Integration** - Seamless integration with Anthropic's Claude API
- ✅ **Multiple Model Support** - Support for Claude 3.5 Sonnet, Opus, Sonnet, and Haiku
- ✅ **Long Context Support** - Handle extended conversations and context
- ✅ **Advanced Reasoning** - Leverage Claude's powerful reasoning capabilities
- ✅ **Safe AI Interactions** - Built-in safety features and content filtering
- ✅ **Multi-modal Support** - Support for text, images, and documents

### Advanced Features

#### 🎤 Voice Features
- **Voice Input** - Speech-to-text input using browser's Web Speech API
- **Voice Output** - Text-to-speech for Claude's responses
- **Multi-language Support** - Support for multiple languages in voice features
- **Auto Voice Output** - Automatic reading of assistant responses

#### 📎 File Handling
- **File Upload** - Upload images and documents for analysis
- **Image Analysis** - Claude's vision capabilities for image understanding
- **File Preview** - Preview files before sending
- **Multiple Formats** - Support for images (PNG, JPG, GIF), PDF, TXT, DOC, DOCX

#### 🎨 UI/UX Enhancements
- **Dark Mode** - Toggle between light and dark themes
- **Multiple Chat Sessions** - Create and manage unlimited chat sessions
- **Code Syntax Highlighting** - Beautiful code rendering with syntax highlighting
- **Markdown Rendering** - Full Markdown support (GitHub Flavored Markdown)
- **Responsive Design** - Works on desktop, tablet, and mobile devices

#### ⚡ Advanced Functionality
- **Streaming Responses** - Real-time token streaming for faster response display
- **Export Chat History** - Export conversations as PDF or TXT files
- **Chat Search** - Search through conversation history
- **Quick Templates** - Pre-built conversation templates for common tasks
- **API Usage Tracking** - Monitor token usage and API statistics
- **Settings Export/Import** - Save and restore your preferences
- **Message Reactions** - Like/unlike assistant responses
- **Copy Messages** - One-click copy for any message

---

## 📦 What's Included

### Frontend Files
- `index.html` - Main HTML interface
- `styles.css` - Complete styling with dark mode
- `script.js` - Frontend JavaScript functionality
- `advanced-features.js` - Advanced features module

### Backend Files
- `app.py` - Flask backend server
- `config.py` - Configuration management
- `setup.py` - Setup helper script

### Configuration
- `requirements.txt` - Python dependencies
- `env.example` - Environment variables template
- `.gitignore` - Git ignore rules

### Documentation
- `README.md` - Complete project documentation
- `PROJECT_INFO.md` - Project information
- `ADVANCED_FEATURES.md` - Feature documentation
- `QUICK_START.md` - Quick start guide
- `TROUBLESHOOTING.md` - Troubleshooting guide
- `SETUP_ENV.md` - Environment setup guide
- `CHECKLIST.md` - Project checklist
- `IMAGE_GENERATION_PROMPTS.md` - Image generation prompts

### Scripts
- `run.bat` / `run.sh` - Start scripts
- `start.bat` / `start-frontend.bat` - Complete startup scripts

---

## 🚀 Getting Started

### Prerequisites
- Python 3.8 or higher
- Anthropic API key ([Get one here](https://console.anthropic.com/))

### Installation

1. **Clone the repository**
```bash
git clone https://github.com/rskworld/anthropic-claude-chatbot.git
cd anthropic-claude-chatbot
```

2. **Install dependencies**
```bash
pip install -r requirements.txt
```

3. **Set up environment**
```bash
# Copy env.example to .env
cp env.example .env

# Edit .env and add your Anthropic API key
ANTHROPIC_API_KEY=your_api_key_here
```

4. **Start the server**
```bash
python app.py
```

5. **Open in browser**
- Use Python HTTP server: `python -m http.server 8000`
- Or use Live Server extension
- Open `http://localhost:8000`

---

## 🔧 Configuration

### Environment Variables
- `ANTHROPIC_API_KEY` - Your Anthropic API key (required)
- `FLASK_ENV` - Flask environment (development/production)
- `PORT` - Server port (default: 5000)
- `HOST` - Server host (default: 0.0.0.0)

### Frontend Configuration
Edit `script.js` to change API base URL if needed:
```javascript
const API_BASE_URL = 'http://localhost:5000/api';
```

---

## 📚 Documentation

Comprehensive documentation is available in the repository:
- **README.md** - Complete project documentation
- **QUICK_START.md** - Quick setup guide
- **TROUBLESHOOTING.md** - Common issues and solutions
- **ADVANCED_FEATURES.md** - Detailed feature documentation

---

## 🐛 Known Issues

None at this time. If you encounter any issues, please check `TROUBLESHOOTING.md` or open an issue on GitHub.

---

## 🔮 Future Enhancements

Potential features for future releases:
- Conversation sharing via URL
- Cloud sync for sessions
- Custom voice model selection
- Advanced file type support
- Integration with external tools
- Plugin system

---

## 📝 Changelog

### v1.0.0 (January 2026)
- Initial release
- All core and advanced features implemented
- Complete documentation
- Full test coverage

---

## 🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

---

## 📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

---

## 👥 Credits

**Developed by:**
- **RSK World** - https://rskworld.in
- **Founder:** Molla Samser
- **Designer & Tester:** Rima Khatun

**Contact:**
- Website: https://rskworld.in
- Email: help@rskworld.in, support@rskworld.in
- Phone: +91 93305 39277

---

## 🙏 Acknowledgments

- **Anthropic** - For providing the Claude API
- **Open Source Community** - For the amazing tools and libraries

---

## 📞 Support

For support, visit:
- **Documentation:** Check the README and other docs in the repository
- **Troubleshooting:** See TROUBLESHOOTING.md
- **Contact:** help@rskworld.in
- **Website:** https://rskworld.in

---

**© 2026 RSK World. All rights reserved.**

requirements.txt
Raw Download
Find: Go to:
# Anthropic Claude Chatbot - Python Dependencies
# Project: Anthropic Claude Chatbot
# Category: OpenAI Integration
# Year: 2026
#
# Developer Details:
# - Website: https://rskworld.in
# - Email: help@rskworld.in, support@rskworld.in
# - Phone: +91 93305 39277
# - Organization: RSK World
# - Founder: Molla Samser
# - Designer & Tester: Rima Khatun

Flask==3.0.0
flask-cors==4.0.0
anthropic==0.34.2
python-dotenv==1.0.0

19 lines•440 B
text
LICENSE
Raw Download
Find: Go to:
MIT License

Copyright (c) 2026 RSK World

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---

Developer Details:
- Website: https://rskworld.in
- Email: help@rskworld.in, support@rskworld.in
- Phone: +91 93305 39277
- Organization: RSK World
- Founder: Molla Samser
- Designer & Tester: Rima Khatun

33 lines•1.3 KB
text
README.md
Raw Download

README.md

# Anthropic Claude Chatbot

**Project:** Anthropic Claude Chatbot
**Category:** OpenAI Integration
**Year:** 2026
**Difficulty:** Intermediate

## Overview

This project integrates Anthropic Claude API to create intelligent chatbots with advanced reasoning capabilities. Features include long context handling, complex reasoning, and safe AI interactions.

### Developer Details
- **Website:** [https://rskworld.in](https://rskworld.in)
- **Email:** help@rskworld.in, support@rskworld.in
- **Phone:** +91 93305 39277
- **Organization:** RSK World
- **Founder:** Molla Samser
- **Designer & Tester:** Rima Khatun

## Features

### Core Features
- ✅ **Claude API Integration** - Seamless integration with Anthropic's Claude API
- ✅ **Long Context Support** - Handle extended conversations and context
- ✅ **Advanced Reasoning** - Leverage Claude's powerful reasoning capabilities
- ✅ **Safe AI Interactions** - Built-in safety features and content filtering
- ✅ **Multi-modal Support** - Support for text, images, and documents
- ✅ **Modern UI** - Beautiful and responsive user interface
- ✅ **Real-time Chat** - Smooth conversation experience
- ✅ **Customizable Settings** - Adjust model, temperature, and tokens

### Advanced & Unique Features
- 🎤 **Voice Input/Output** - Speech recognition and text-to-speech capabilities
- 📎 **File Upload & Analysis** - Upload images and documents for Claude to analyze
- 🌙 **Dark Mode** - Eye-friendly dark theme toggle
- 💾 **Export Chat History** - Export conversations as PDF or TXT files
- 💬 **Multiple Chat Sessions** - Create and manage multiple conversation threads
- 🎨 **Code Syntax Highlighting** - Beautiful code rendering with syntax highlighting
- 📝 **Markdown Rendering** - Rich text formatting support
- ⚡ **Streaming Responses** - Real-time token streaming for faster response display
- 📋 **Copy Messages** - One-click copy for any message
- 👍 **Message Reactions** - Like/unlike assistant responses
- 📊 **API Usage Tracking** - Monitor token usage and API statistics
- 🎯 **Quick Templates** - Pre-built conversation templates for common tasks
- 🔍 **Chat Search** - Search through conversation history
- ⚙️ **Settings Export/Import** - Save and restore your preferences
- 🗣️ **Multi-language Voice Support** - Support for multiple languages in voice features

## Technologies Used

- **Anthropic API** - For Claude AI integration
- **Python** - Backend server (Flask)
- **JavaScript** - Frontend interactivity
- **HTML/CSS** - User interface
- **Claude** - Advanced AI model

## Project Structure

```
anthropic-claude-chatbot/
├── index.html # Main HTML file
├── styles.css # CSS styles
├── script.js # Frontend JavaScript
├── app.py # Flask backend server
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── .gitignore # Git ignore file
└── README.md # Project documentation
```

## Installation

### Prerequisites

- Python 3.8 or higher
- Node.js (optional, for any frontend tooling)
- Anthropic API key ([Get one here](https://console.anthropic.com/))

### Setup Steps

1. **Clone or download the project**

2. **Create a virtual environment (recommended)**
```bash
python -m venv venv

# On Windows
venv\Scripts\activate

# On macOS/Linux
source venv/bin/activate
```

3. **Install Python dependencies**
```bash
pip install -r requirements.txt
```

4. **Set up environment variables**
```bash
# Copy the example file
cp .env.example .env

# Edit .env and add your Anthropic API key
ANTHROPIC_API_KEY=your_actual_api_key_here
```

5. **Start the Flask server**
```bash
python app.py
```

6. **Open the application**
- Open `index.html` in your web browser, or
- Use a local server (e.g., `python -m http.server 8000`) and navigate to `http://localhost:8000`

## Usage

1. **Configure API Key**: Make sure your `.env` file contains a valid Anthropic API key.

2. **Start Backend**: Run `python app.py` to start the Flask server on port 5000.

3. **Open Frontend**: Open `index.html` in your browser or serve it through a local server.

4. **Start Chatting**: Type your message and press Enter or click the send button.

5. **Use Advanced Features**:
- **Voice Input**: Click the microphone icon to speak your message
- **Voice Output**: Click the speaker icon to have Claude's response read aloud
- **File Upload**: Click the paperclip icon to attach images or documents
- **Dark Mode**: Toggle dark theme from the header
- **Multiple Sessions**: Click the chat icon to manage multiple conversations
- **Export Chat**: Download your conversation history as PDF or TXT
- **Quick Templates**: Click the lightbulb icon for pre-built prompts
- **Search**: Use the search box to find specific messages

6. **Adjust Settings**: Click the settings icon to customize:
- Model selection (Claude 3.5 Sonnet, Opus, Sonnet, or Haiku)
- Max tokens (1-4096)
- Temperature (0-1)
- Stream response option
- Auto voice output
- Voice language selection
- Export/Import settings

## API Endpoints

### `GET /api/health`
Health check endpoint to verify API status.

**Response:**
```json
{
"status": "healthy",
"anthropic_configured": true
}
```

### `POST /api/chat`
Main chat endpoint for conversing with Claude.

**Request Body:**
```json
{
"message": "Hello, Claude!",
"model": "claude-3-5-sonnet-20241022",
"max_tokens": 1024,
"temperature": 0.7,
"conversation_history": [],
"stream": false
}
```

**Response:**
```json
{
"response": "Hello! How can I help you today?",
"model": "claude-3-5-sonnet-20241022",
"usage": {
"input_tokens": 10,
"output_tokens": 8
}
}
```

### `GET /api/models`
Get list of available Claude models.

## Configuration

### Environment Variables

- `ANTHROPIC_API_KEY` - Your Anthropic API key (required)
- `FLASK_ENV` - Flask environment (development/production)
- `PORT` - Server port (default: 5000)

### Frontend Configuration

Edit `script.js` to change the API base URL:
```javascript
const API_BASE_URL = 'http://localhost:5000/api';
```

## Available Models

- **Claude 3.5 Sonnet** - Latest and most capable model (recommended)
- **Claude 3 Opus** - Most powerful for complex tasks
- **Claude 3 Sonnet** - Balanced performance and speed
- **Claude 3 Haiku** - Fastest and most cost-effective

## Features in Detail

### Long Context Support
Claude can handle conversations with up to 200K tokens of context, making it perfect for extended discussions and document analysis.

### Advanced Reasoning
Claude excels at complex reasoning tasks, coding, mathematics, and multi-step problem solving.

### Safe AI Interactions
Anthropic's safety measures ensure responsible AI usage with built-in content filtering and safety protocols.

## Troubleshooting

### API Key Issues
- Ensure your `.env` file contains a valid `ANTHROPIC_API_KEY`
- Check that the API key is correctly formatted (starts with `sk-ant-`)
- Verify your API key has sufficient credits

### CORS Issues
- Make sure Flask-CORS is installed: `pip install flask-cors`
- Check that the frontend and backend URLs are correct

### Connection Errors
- Verify the Flask server is running on port 5000
- Check firewall settings
- Ensure no other application is using port 5000

## Security Notes

- Never commit your `.env` file to version control
- Keep your API key secure and private
- Use environment variables for sensitive data
- Consider implementing rate limiting for production use

## Contributing

This project is part of RSK World's free programming resources. For contributions or issues, please contact:

- **Email:** help@rskworld.in
- **Website:** [https://rskworld.in](https://rskworld.in)

## License

This project is provided as-is for educational purposes. Please refer to Anthropic's API terms of service for usage guidelines.

## Acknowledgments

- **Anthropic** - For providing the Claude API
- **RSK World** - Project organization and development
- **Molla Samser** - Project founder
- **Rima Khatun** - Designer & Tester

## Support

For support, visit [https://rskworld.in/contact.php](https://rskworld.in/contact.php) or email help@rskworld.in

---

**© 2026 RSK World. All rights reserved.**

config.py
Raw Download
Find: Go to:
"""
Anthropic Claude Chatbot - Configuration File
Project: Anthropic Claude Chatbot
Category: OpenAI Integration
Year: 2026

Developer Details:
- Website: https://rskworld.in
- Email: help@rskworld.in, support@rskworld.in
- Phone: +91 93305 39277
- Organization: RSK World
- Founder: Molla Samser
- Designer & Tester: Rima Khatun
"""

import os
from dotenv import load_dotenv

# Load environment variables
load_dotenv()


class Config:
    """Application configuration class"""
    
    # Anthropic API Configuration
    ANTHROPIC_API_KEY = os.getenv('ANTHROPIC_API_KEY', '')
    
    # Flask Configuration
    FLASK_ENV = os.getenv('FLASK_ENV', 'development')
    DEBUG = FLASK_ENV == 'development'
    PORT = int(os.getenv('PORT', 5000))
    HOST = os.getenv('HOST', '0.0.0.0')
    
    # CORS Configuration
    CORS_ORIGINS = os.getenv('CORS_ORIGINS', '*').split(',')
    
    # API Configuration
    API_BASE_URL = os.getenv('API_BASE_URL', 'http://localhost:5000')
    
    # Default Model Settings
    DEFAULT_MODEL = 'claude-3-5-sonnet-20241022'
    DEFAULT_MAX_TOKENS = 1024
    DEFAULT_TEMPERATURE = 0.7
    
    # Available Models
    AVAILABLE_MODELS = [
        {
            'id': 'claude-3-5-sonnet-20241022',
            'name': 'Claude 3.5 Sonnet',
            'description': 'Latest and most capable model with advanced reasoning'
        },
        {
            'id': 'claude-3-opus-20240229',
            'name': 'Claude 3 Opus',
            'description': 'Most powerful model for complex tasks'
        },
        {
            'id': 'claude-3-sonnet-20240229',
            'name': 'Claude 3 Sonnet',
            'description': 'Balanced performance and speed'
        },
        {
            'id': 'claude-3-haiku-20240307',
            'name': 'Claude 3 Haiku',
            'description': 'Fastest and most cost-effective model'
        }
    ]
    
    # System Prompt
    SYSTEM_PROMPT = (
        "You are a helpful, harmless, and honest AI assistant. "
        "Provide clear and accurate responses. Be conversational and friendly."
    )


# Validate configuration
def validate_config():
    """Validate that required configuration is present"""
    if not Config.ANTHROPIC_API_KEY:
        raise ValueError(
            "ANTHROPIC_API_KEY is required. Please set it in your .env file. "
            "Get your API key from https://console.anthropic.com/"
        )
    return True

87 lines•2.4 KB
python
SETUP_ENV.md
Raw Download

SETUP_ENV.md

# Setting Up .env File

**Developer Details:**
- Website: https://rskworld.in
- Email: help@rskworld.in, support@rskworld.in
- Phone: +91 93305 39277
- Organization: RSK World

---

## ✅ .env File Created Successfully!

The `.env` file has been created in your project directory.

---

## 🔑 Next Step: Add Your API Key

### Step 1: Get Your Anthropic API Key

1. Visit: https://console.anthropic.com/
2. Sign up or log in
3. Go to API Keys section
4. Click "Create Key"
5. Copy your API key (starts with `sk-ant-`)

### Step 2: Edit .env File

Open the `.env` file in a text editor and replace:

```
ANTHROPIC_API_KEY=your_anthropic_api_key_here
```

With your actual key:

```
ANTHROPIC_API_KEY=sk-ant-api03-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

**⚠️ Important:**
- Don't share your API key
- Don't commit .env to git (it's already in .gitignore)
- Keep it secure

---

## 📋 .env File Contents

Your `.env` file includes:

```env
# Anthropic API Key (REQUIRED)
ANTHROPIC_API_KEY=your_anthropic_api_key_here

# Flask Configuration
FLASK_ENV=development
PORT=5000
HOST=0.0.0.0

# CORS Configuration
CORS_ORIGINS=*

# API Configuration
API_BASE_URL=http://localhost:5000
```

---

## 🚀 After Adding API Key

1. Save the `.env` file
2. Start the server: `python app.py`
3. You should see: ✅ Anthropic API client initialized successfully

---

## ❌ Troubleshooting

### If you see: "ANTHROPIC_API_KEY not configured"

1. Check `.env` file exists in project root
2. Verify API key is on the correct line
3. Make sure there are no extra spaces
4. Restart the Flask server

### If API key doesn't work

1. Verify key starts with `sk-ant-`
2. Check key hasn't expired
3. Ensure you have credits in your Anthropic account
4. Try creating a new API key

---

## 📞 Need Help?

- Email: help@rskworld.in
- Website: https://rskworld.in

---

© 2026 RSK World. All rights reserved.

🚀 Support RSK World

Subscribe to our YouTube channel for latest tutorials & updates!



Click subscribe & support our work ❤️

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer