jupyter-whisper


Namejupyter-whisper JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/MaximeRivest/jupyter_whisper
SummaryAI-Powered Chat Interface for Jupyter Notebooks
upload_time2024-11-25 12:33:01
maintainerNone
docs_urlNone
authorMaxime Rivest
requires_python>=3.7
licenseNone
keywords jupyter chat claude ai notebook assistant
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```bash
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:
```bash
pip install jupyterlab>=4.0.0
```

2. Install Jupyter Whisper:
```bash
pip install jupyter_whisper
```

3. Start JupyterLab:
```bash
jupyter lab
```

### Important Note About Server Management

Jupyter Whisper runs a local FastAPI server (on port 5000) to handle features like audio transcription and text processing. The server is shared between notebooks for efficiency.

**Important Notes:**
- The server persists between notebook sessions
- Configuration changes (like API keys) only take effect when the server restarts
- You'll be notified if you're using an older server version

To manually refresh the server and apply new configurations:

```python
from jupyter_whisper import refresh_jupyter_whisper
refresh_jupyter_whisper()  # Warning: affects all active notebooks
```

**When to refresh:**
- After updating API keys
- After upgrading the package
- If you encounter configuration issues

Note: Refreshing the server will impact all notebooks currently using it. You may need to restart kernels in affected notebooks.

### 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
- Port 5000 must be available for the local server

## 🔧 Configuration

### Interactive Setup

The easiest way to configure Jupyter Whisper is through the interactive setup interface:

```python
import jupyter_whisper
```

This will open an interactive UI with tabs for:
- API Keys configuration
- Model selection
- System prompt customization

### Manual Configuration

You can also configure settings programmatically:

```python
from jupyter_whisper.config import get_config_manager
config = get_config_manager()

# Set API keys
config.set_api_key('ANTHROPIC_API_KEY', 'your-key-here')
config.set_api_key('OPENAI_API_KEY', 'your-key-here')      # Optional for voice
config.set_api_key('PERPLEXITY_API_KEY', 'your-key-here')  # For search

# Change the model
config.set_model('claude-3-5-sonnet-20241022')

# Update system prompt
config.set_system_prompt("Your custom system prompt here")

# Set other preferences
config.set_config_value('SKIP_SETUP_POPUP', True)
```

Available models:
- claude-3-5-sonnet-20241022
- claude-3-5-haiku-20241022
- claude-3-opus-20240229
- claude-3-sonnet-20240229
- claude-3-haiku-20240307

## 💡 Usage

### Basic Chat

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

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

### Online Search

Access web information directly within your notebook:

```python
from jupyter_whisper import search_online
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

## 🛠️ Advanced Features

### Magic Commands

- `%%user [index]` - Initiate a user message
- `%%user [index]:set` - Replace user message at given index
- `%%assistant [index]` - Include assistant response
- `%%assistant [index]:set` - Replace assistant message at given index
- `%%assistant [index]:add` - Concatenate content to existing assistant message

Example usage:
```python
%%user 3:set
How do I read a CSV file?

%%assistant 3:set
Here's how to read a CSV file using pandas:
import pandas as pd
df = pd.read_csv('file.csv')

%%assistant 3:add
You can also specify additional parameters:
df = pd.read_csv('file.csv', encoding='utf-8')
```

## 🔧 Development

### Setup Development Environment

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

## 🤝 Contributing

We welcome contributions! Please submit your Pull Requests.

## 📄 License

MIT License - see [LICENSE](LICENSE) for details

## 🙏 Credits

Powered by:
- [Claude](https://anthropic.com/claude) by Anthropic
- [OpenAI Whisper](https://openai.com/research/whisper)
- [Perplexity AI](https://perplexity.ai)

---

Made with ❤️ by Maxime

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MaximeRivest/jupyter_whisper",
    "name": "jupyter-whisper",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "jupyter, chat, claude, ai, notebook, assistant",
    "author": "Maxime Rivest",
    "author_email": "mrive052@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/93/71/03c9a9a0185bc623491c3b5d4db0b452dc9a62c7eb9384a59713c5a14ece/jupyter_whisper-0.2.0.tar.gz",
    "platform": null,
    "description": "# JupyterWhisper - AI-Powered Chat Interface for Jupyter Notebooks\n\nJupyterWhisper 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.\n\n## \u2728 Key Features\n\n- \ud83e\udd16 Native integration with Claude 3.5 Sonnet\n- \ud83c\udfaf Intelligent code execution and cell management \n- \ud83d\udd0d Advanced search capabilities powered by Perplexity AI\n- \ud83c\udf99\ufe0f Voice command support using OpenAI Whisper\n- \ud83d\udcdd Context-aware text processing and formatting\n- \ud83d\udcac Comprehensive chat history management\n- \u26a1 Real-time streaming responses\n\n## \ud83d\ude80 Installation\n\n```bash\npip install jupyter_whisper\n```\n## \ud83d\udccb Requirements\n\n- Python 3.7+\n- JupyterLab 4.0+ (important: this extension is designed for JupyterLab, not classic Notebook)\n- Jupyter Notebook 7.0+ (if using Notebook instead of Lab)\n- Required API keys:\n  - Anthropic API key (for Claude integration)\n  - OpenAI API key (optional, for voice features) \n  - Perplexity API key (for advanced search capabilities)\n\n### Installation Steps\n\n1. Install JupyterLab if you haven't already:\n```bash\npip install jupyterlab>=4.0.0\n```\n\n2. Install Jupyter Whisper:\n```bash\npip install jupyter_whisper\n```\n\n3. Start JupyterLab:\n```bash\njupyter lab\n```\n\n### Important Note About Server Management\n\nJupyter Whisper runs a local FastAPI server (on port 5000) to handle features like audio transcription and text processing. The server is shared between notebooks for efficiency.\n\n**Important Notes:**\n- The server persists between notebook sessions\n- Configuration changes (like API keys) only take effect when the server restarts\n- You'll be notified if you're using an older server version\n\nTo manually refresh the server and apply new configurations:\n\n```python\nfrom jupyter_whisper import refresh_jupyter_whisper\nrefresh_jupyter_whisper()  # Warning: affects all active notebooks\n```\n\n**When to refresh:**\n- After updating API keys\n- After upgrading the package\n- If you encounter configuration issues\n\nNote: Refreshing the server will impact all notebooks currently using it. You may need to restart kernels in affected notebooks.\n\n### JupyterLab Compatibility\n\nJupyterWhisper 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.\n\nKey compatibility notes:\n- Voice features require a modern browser\n- WebSocket support is required for real-time streaming\n- Some features may require JupyterLab extensions to be enabled\n- Port 5000 must be available for the local server\n\n## \ud83d\udd27 Configuration\n\n### Interactive Setup\n\nThe easiest way to configure Jupyter Whisper is through the interactive setup interface:\n\n```python\nimport jupyter_whisper\n```\n\nThis will open an interactive UI with tabs for:\n- API Keys configuration\n- Model selection\n- System prompt customization\n\n### Manual Configuration\n\nYou can also configure settings programmatically:\n\n```python\nfrom jupyter_whisper.config import get_config_manager\nconfig = get_config_manager()\n\n# Set API keys\nconfig.set_api_key('ANTHROPIC_API_KEY', 'your-key-here')\nconfig.set_api_key('OPENAI_API_KEY', 'your-key-here')      # Optional for voice\nconfig.set_api_key('PERPLEXITY_API_KEY', 'your-key-here')  # For search\n\n# Change the model\nconfig.set_model('claude-3-5-sonnet-20241022')\n\n# Update system prompt\nconfig.set_system_prompt(\"Your custom system prompt here\")\n\n# Set other preferences\nconfig.set_config_value('SKIP_SETUP_POPUP', True)\n```\n\nAvailable models:\n- claude-3-5-sonnet-20241022\n- claude-3-5-haiku-20241022\n- claude-3-opus-20240229\n- claude-3-sonnet-20240229\n- claude-3-haiku-20240307\n\n## \ud83d\udca1 Usage\n\n### Basic Chat\n\nInteract with the AI using the `%%user` magic command:\n\n```python\n%%user\nHow do I read a CSV file using pandas?\n```\n\n### Online Search\n\nAccess web information directly within your notebook:\n\n```python\nfrom jupyter_whisper import search_online\nstyle = \"Be precise and concise\"\nquestion = \"What's new in Python 3.12?\"\nsearch_online(style, question)\n```\n\n### Voice Commands\n\nLeverage voice input capabilities:\n- Control recording with keyboard shortcuts\n- Automatic speech-to-text conversion\n- Seamless chat interface integration\n\n## \ud83d\udee0\ufe0f Advanced Features\n\n### Magic Commands\n\n- `%%user [index]` - Initiate a user message\n- `%%user [index]:set` - Replace user message at given index\n- `%%assistant [index]` - Include assistant response\n- `%%assistant [index]:set` - Replace assistant message at given index\n- `%%assistant [index]:add` - Concatenate content to existing assistant message\n\nExample usage:\n```python\n%%user 3:set\nHow do I read a CSV file?\n\n%%assistant 3:set\nHere's how to read a CSV file using pandas:\nimport pandas as pd\ndf = pd.read_csv('file.csv')\n\n%%assistant 3:add\nYou can also specify additional parameters:\ndf = pd.read_csv('file.csv', encoding='utf-8')\n```\n\n## \ud83d\udd27 Development\n\n### Setup Development Environment\n\n```bash\ngit clone https://github.com/yourusername/jupyter_whisper.git\ncd jupyter_whisper\npip install -e \".[dev]\"\n```\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions! Please submit your Pull Requests.\n\n## \ud83d\udcc4 License\n\nMIT License - see [LICENSE](LICENSE) for details\n\n## \ud83d\ude4f Credits\n\nPowered by:\n- [Claude](https://anthropic.com/claude) by Anthropic\n- [OpenAI Whisper](https://openai.com/research/whisper)\n- [Perplexity AI](https://perplexity.ai)\n\n---\n\nMade with \u2764\ufe0f by Maxime\n\n*Note: This project is independent and not affiliated with Anthropic, OpenAI, or Perplexity AI.*\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "AI-Powered Chat Interface for Jupyter Notebooks",
    "version": "0.2.0",
    "project_urls": {
        "Bug Reports": "https://github.com/MaximeRivest/jupyter_whisper/issues",
        "Homepage": "https://github.com/MaximeRivest/jupyter_whisper",
        "Source": "https://github.com/MaximeRivest/jupyter_whisper"
    },
    "split_keywords": [
        "jupyter",
        " chat",
        " claude",
        " ai",
        " notebook",
        " assistant"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e264cc9f96625009f4890e7727c92b64db209c78b5bb401069518cc12d687f29",
                "md5": "f43a493b8f9032274df607fd5c8b7f51",
                "sha256": "0283a8a2cfa5460eec7a709cf4bf056487638c6606100e5a647cd9c77cab2310"
            },
            "downloads": -1,
            "filename": "jupyter_whisper-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f43a493b8f9032274df607fd5c8b7f51",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 42273,
            "upload_time": "2024-11-25T12:33:00",
            "upload_time_iso_8601": "2024-11-25T12:33:00.874915Z",
            "url": "https://files.pythonhosted.org/packages/e2/64/cc9f96625009f4890e7727c92b64db209c78b5bb401069518cc12d687f29/jupyter_whisper-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "937103c9a9a0185bc623491c3b5d4db0b452dc9a62c7eb9384a59713c5a14ece",
                "md5": "72485c9c6e5c48400070fd4c7ef7fc7b",
                "sha256": "60b845a8924f7a3c2f166643f69f0fa3528798321794bc5f96e56f6fab45e135"
            },
            "downloads": -1,
            "filename": "jupyter_whisper-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "72485c9c6e5c48400070fd4c7ef7fc7b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 41137,
            "upload_time": "2024-11-25T12:33:01",
            "upload_time_iso_8601": "2024-11-25T12:33:01.989573Z",
            "url": "https://files.pythonhosted.org/packages/93/71/03c9a9a0185bc623491c3b5d4db0b452dc9a62c7eb9384a59713c5a14ece/jupyter_whisper-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-25 12:33:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MaximeRivest",
    "github_project": "jupyter_whisper",
    "github_not_found": true,
    "lcname": "jupyter-whisper"
}
        
Elapsed time: 0.61172s