(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=40857009

Pretzel 是一个基于 Jupyter Lab 的开源项目,提供增强的 AI 代码生成功能。 它添加了原生人工智能功能,无需额外的工具。 三个主要功能包括: 1. 内联选项卡自动完成:利用 Mistral Codestral 或 GPT-4o 等模型,用户可以在笔记本中打字时生成建议。 通过设置自定义首选项。 2. 单元级代码生成:通过单击“Ask AI”或在活动 Jupyter 单元中按指定快捷键来生成代码片段。 笔记本中的相关上下文可以告知人工智能的反应。 使用“@variable”引用现有记事本变量,例如数据框列。 3. 侧边栏聊天交互:通过单击右侧边栏中的 Pretzel 图标,用户可以利用相关性分析器 (RAG) 技术参与对话,跟踪与当前单元格或所选文本相关的上下文。 与 Jupyter 有限的 AI 集成相比,Pretzel 引入了可选的“AI 服务器”。 用户可以选择自己的 OpenAPI 密钥。 Pretzel 的未来计划包括无摩擦协作、全面的 SQL 支持、可视化分析构建器、类似 VS Code 的界面以及直接从笔记本共享一键式仪表板。 尝试一下 Pretzel 并分享建设性的反馈。 如有疑问或问题,请通过我的个人资料联系或在 https://github.com/pretzelai/pretzelai/issues 上提交。

相关文章

原文
Hey HN! We’ve forked Jupyter Lab and added AI code generation features that feel native and have all the context about your notebook. You can see a demo video (2 min) here: https://www.tella.tv/video/clxt7ei4v00rr09i5gt1laop6/view

Try a hosted version here: https://pretzelai.app

Jupyter is by far the most used Data Science tool. Despite its popularity, it still lacks good code-generation extensions. The flagship AI extension jupyter-ai lags far behind in features and UX compared to modern AI code generation and understanding tools (like https://www.continue.dev and https://www.cursor.com). Also, GitHub Copilot still isn’t supported in Jupyter, more than 2 years after its launch. We’re solving this with Pretzel.

Pretzel is a free and open-source fork of Jupyter. You can install it locally with “pip install pretzelai” and launch it with “pretzel lab”. We recommend creating a new python environment if you already have jupyter lab installed. Our GitHub README has more information: https://github.com/pretzelai/pretzelai

For our first iteration, we’ve shipped 3 features:

1. Inline Tab autocomplete: This works similar to GitHub Copilot. You can choose between Mistral Codestral or GPT-4o in the settings

2. Cell level code generation: Click Ask AI or press Cmd+K / Ctrl+K to instruct AI to generate code in the active Jupyter Cell. We provide relevant context from the current notebook to the LLM with RAG. You can refer to existing variables in the notebook using the @variable syntax (for dataframes, it will pass the column names to the LLM)

3. Sidebar chat: Clicking the blue Pretzel Icon on the right sidebar opens this chat (Ctrl+Cmd+B / Ctrl+Alt+B). This chat always has context of your current cell or any selected text. Here too, we use RAG to send any relevant context from the current notebook to the LLM

All of these features work out-of-the-box via our “AI Server” but you have the option of using your own OpenAI API Key. This can be configured in the settings (Menu Bar > Settings > Settings Editor > Search for Pretzel). If you use your own OpenAI API Key but don’t have a Mistral API key, be sure to select OpenAI as the inline code completion model in the settings.

These features are just a start. We're building a modern version of Jupyter. Our roadmap includes frictionless, realtime collaboration (think pair-programming, comments, version history), full-fledged SQL support (both in code cells and as a standalone SQL IDE), a visual analysis builder, a VSCode-like coding experience powered by Monaco, and 1-click dashboard creation and sharing straight from your notebooks.

We’d love for you to try Pretzel and send us any feedback, no matter how minor (see my bio for contact info, or file a GitHub issue here: https://github.com/pretzelai/pretzelai/issues)

联系我们 contact @ memedata.com