Skip to main content

AI-Powered Chat Interface for Jupyter Notebooks

Project description

JupyterWhisper - AI-Powered Chat Interface for Jupyter Notebooks

JupyterWhisper transforms your Jupyter notebook environment by seamlessly integrating Claude AI capabilities. This extension enables natural chat interactions, intelligent code execution, and voice command features to enhance your notebook workflow.

✨ Key Features

  • 🤖 Native integration with Claude 3.5 Sonnet
  • 🎯 Intelligent code execution and cell management
  • 🔍 Advanced search capabilities powered by Perplexity AI
  • 🎙️ Voice command support using OpenAI Whisper
  • 📝 Context-aware text processing and formatting
  • 💬 Comprehensive chat history management
  • ⚡ Real-time streaming responses

🚀 Installation

pip install jupyter_whisper

📋 Requirements

  • Python 3.7+
  • JupyterLab 4.0+ (important: this extension is designed for JupyterLab, not classic Notebook)
  • Jupyter Notebook 7.0+ (if using Notebook instead of Lab)
  • Required API keys:
    • Anthropic API key (for Claude integration)
    • OpenAI API key (optional, for voice features)
    • Perplexity API key (for advanced search capabilities)

Installation Steps

  1. Install JupyterLab if you haven't already:
pip install jupyterlab>=4.0.0
  1. Install Jupyter Whisper:
pip install jupyter_whisper
  1. Start JupyterLab:
jupyter lab

JupyterLab Compatibility

JupyterWhisper is specifically designed and tested for JupyterLab 4.0+. While it may work in classic Jupyter Notebook (7.0+), we recommend using JupyterLab for the best experience and full feature support.

Key compatibility notes:

  • Voice features require a modern browser
  • WebSocket support is required for real-time streaming
  • Some features may require JupyterLab extensions to be enabled

🏁 Quick Start

1. Configure API Keys

The easiest way to set up your API keys is using the built-in configuration tool:

from jupyter_whisper import setup_jupyter_whisper
setup_jupyter_whisper()

This will:

  • Guide you through entering your API keys
  • Securely store them in ~/.jupyter_whisper/config.json
  • Make them available for all future sessions

Alternative configuration methods:

Environment Variables (Linux/MacOS)
# Add to ~/.bashrc or ~/.zshrc
echo 'export ANTHROPIC_API_KEY="your-key-here"' >> ~/.bashrc
echo 'export OPENAI_API_KEY="your-key-here"' >> ~/.bashrc  # Optional for voice features
echo 'export PERPLEXITY_API_KEY="your-key-here"' >> ~/.bashrc  # For search features
source ~/.bashrc
Environment Variables (Windows)
# Run in PowerShell as administrator
[Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", "your-key-here", "User")
[Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "your-key-here", "User")
[Environment]::SetEnvironmentVariable("PERPLEXITY_API_KEY", "your-key-here", "User")
Direct Python Configuration
import os

# Set environment variables programmatically
os.environ["ANTHROPIC_API_KEY"] = "your-key-here"
os.environ["OPENAI_API_KEY"] = "your-key-here"      # Optional for voice
os.environ["PERPLEXITY_API_KEY"] = "your-key-here"  # For search

2. Import and Use

import jupyter_whisper as jw

💡 Usage

Basic Chat

Interact with the AI using the %%user magic command:

%%user
How do I read a CSV file using pandas?

Online Search

Access web information directly within your notebook:

style = "Be precise and concise"
question = "What's new in Python 3.12?"
search_online(style, question)

Voice Commands

Leverage voice input capabilities:

  • Control recording with keyboard shortcuts
  • Automatic speech-to-text conversion
  • Seamless chat interface integration

History Management

Access your conversation history:

hist()  # Display formatted chat history

🛠️ Advanced Features

Magic Commands

  • %%user [index] - Initiate a user message
  • %%assistant [index] - Include assistant response
  • Multi-language support (Python, R, SQL, etc.)

Smart Processing

  • Automatic code detection and execution
  • Dynamic cell type conversion
  • Live markdown rendering
  • Syntax highlighting support

🔧 Development

Setup Development Environment

git clone https://github.com/yourusername/jupyter_whisper.git
cd jupyter_whisper
pip install -e ".[dev]"

Running Tests

python -m pytest tests/

🤝 Contributing

We welcome contributions! Please submit your Pull Requests.

📄 License

MIT License - see LICENSE for details

🙏 Credits

Powered by:


Made with ❤️ by Maxime

Note: This project is independent and not affiliated with Anthropic, OpenAI, or Perplexity AI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyter_whisper-0.1.0b2.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

jupyter_whisper-0.1.0b2-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_whisper-0.1.0b2.tar.gz.

File metadata

  • Download URL: jupyter_whisper-0.1.0b2.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for jupyter_whisper-0.1.0b2.tar.gz
Algorithm Hash digest
SHA256 63c76e58e4102befab92c68a04a26996d8f34f3b2ac3e365a179b8fc15fc27ef
MD5 76d0377e1b94d678e2eb932acc6d06ef
BLAKE2b-256 800e71a3197334cda248d7f155b94b6295f437a2b06f6ad158bc52760d641bc3

See more details on using hashes here.

File details

Details for the file jupyter_whisper-0.1.0b2-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_whisper-0.1.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 c25e8d931cc88586ae2bfdd85cebc673e24a8b5cb32a209d5f0439f86400ee0b
MD5 f3bc0d75483345d191d5ca5fe584b58a
BLAKE2b-256 c0ac434f0af2f855e73d94d2382e6c83b1ab23f94a58c646b987f0d696e26e4e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page