跳转到主要内容

Codestral AI代码补全和聊天工具,适用于JupyterLab

项目描述

jupyterlab-codestral

Github Actions Status lite-badge

AI代码补全和聊天工具,适用于JupyterLab,Notebook 7和JupyterLite,由MistralAI提供✨

一个显示Codestral扩展在JupyterLite中的屏幕录制

需求

[!NOTE] 此扩展旨在在JupyterLite中使用,以在浏览器中启用特定的AI代码补全和聊天功能。要启用JupyterLab和Jupyter Notebook中的更多AI提供商,我们建议直接使用Jupyter AI扩展。目前Jupyter AI与JupyterLite不兼容,但将来可能在某种程度上兼容。

  • JupyterLab >= 4.1.0或Notebook >= 7.1.0

[!WARNING] 此扩展仍处于非常实验性的阶段。它不是官方的MistralAI扩展。它正在探索将MistralAI API与JupyterLab集成,该API还可以在JupyterLite中使用。有关JupyterLab的更完整的AI扩展,请参阅Jupyter AI

✨ 在您的浏览器中尝试它 ✨

您可以使用JupyterLite在您的浏览器中尝试此扩展

lite-badge

有关如何提供API密钥的更多信息,请参阅下面的使用部分。

安装

要安装此扩展,请执行以下操作

pip install jupyterlab-codestral

使用

  1. 前往 https://console.mistral.ai/api-keys/ 创建API密钥。

Screenshot showing how to create an API key

  1. 打开JupyterLab设置,进入Codestral部分输入API密钥

Screenshot showing how to add the API key to the settings

  1. 打开聊天窗口,或使用内联补全功能

Screenshot showing how to use the chat

卸载

要删除扩展,请执行以下命令

pip uninstall jupyterlab-codestral

贡献

开发安装

注意:您需要NodeJS来构建扩展包。

jlpm 命令是JupyterLab安装的yarn的固定版本。您可以在以下示例中用yarnnpm代替jlpm

# Clone the repo to your local environment
# Change directory to the jupyterlab_codestral directory
# Install package in development mode
pip install -e "."
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm build

您可以在不同的终端中同时监视源目录并运行JupyterLab,以监视扩展源代码的变化并自动重新构建扩展。

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab

在监视命令运行时,每次保存的更改都将立即本地构建并可供正在运行的JupyterLab使用。刷新JupyterLab以在浏览器中加载更改(您可能需要等待几秒钟以重新构建扩展)。

默认情况下,jlpm build 命令为此扩展生成源映射,以便更容易使用浏览器开发者工具进行调试。要为JupyterLab核心扩展也生成源映射,可以运行以下命令

jupyter lab build --minimize=False

开发卸载

pip uninstall jupyterlab-codestral

在开发模式下,您还需要删除由jupyter labextension develop命令创建的符号链接。要找到其位置,可以运行jupyter labextension list以确定labextensions文件夹的位置。然后您可以删除该文件夹中的名为jupyterlab-codestral的符号链接。

打包扩展

RELEASE

项目详情


下载文件

下载您平台上的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

jupyterlab_codestral-0.1.0.tar.gz (465.6 kB 查看哈希值)

上传时间

构建分布

jupyterlab_codestral-0.1.0-py3-none-any.whl (93.5 kB 查看哈希值)

上传时间 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面