Jupyter AI模块,提供ChatGPT模型引擎。
项目描述
jupyter_ai_ChatGPT
此扩展由名为 jupyter_ai_ChatGPT
的Python包组成,该包将模型引擎公开给Jupyter AI服务器扩展,以及名为 @jupyter-ai/ChatGPT
的NPM包,该包提供注册插入器的客户端实验室扩展。
需求
- JupyterLab >= 3.0
安装
要安装此扩展,请执行
pip install jupyter_ai_chatgpt
卸载
要删除此扩展,请执行
pip uninstall jupyter_ai_chatgpt
贡献
开发安装
注意:您需要NodeJS来构建扩展包。
jlpm
命令是JupyterLab的固定版本 yarn,它是与JupyterLab一起安装的。您可以在下面的 jlpm
位置使用 yarn
或 npm
。
# Clone the repo to your local environment
# Change directory to the jupyter_ai_chatgpt directory
# Install package in development mode
pip install -e ".[test]"
# 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 jupyter_ai_chatgpt
在开发模式下,您还需要删除由 jupyter labextension develop
命令创建的符号链接。要找到其位置,您可以运行 jupyter labextension list
来确定 labextensions
文件夹的位置。然后您可以删除该文件夹内名为 @jupyter-ai/ChatGPT
的符号链接。
测试扩展
后端测试
此 AI 模块使用 Pytest 进行 Python 代码测试。
安装测试依赖项(只需安装一次)
pip install -e ".[test]"
# Each time you install the Python package, you need to restore the front-end extension link
jupyter labextension develop . --overwrite
要执行它们,请运行
pytest -vv -r ap --cov jupyter_ai_chatgpt
前端测试
此扩展使用 Jest 进行 JavaScript 代码测试。
要执行它们,请执行
jlpm
jlpm test
集成测试
此扩展使用 Playwright 进行集成测试(也称为用户级测试)。更确切地说,JupyterLab 辅助程序 Galata 用于处理在 JupyterLab 中的扩展测试。
更多详细信息请参阅 ui-tests 的 README 文件。
打包扩展
查看 RELEASE
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。
源分布
构建分布
jupyter_ai_ChatGPT-0.5.0.tar.gz 的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | ec3ff9d3b2a06610406b312a2fd2b42284fb727915c827dbcba5370d8f0bedbb |
|
MD5 | 45dbab9bd3fcf4aff8a1680c6d8a5d8c |
|
BLAKE2b-256 | 5e46f2c7ad281071c74c9c8009e8ec7ea61175736f07c704d1713227bdbb2637 |
jupyter_ai_ChatGPT-0.5.0-py3-none-any.whl 的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | 3e4bb2cc171dd3fa777e7b2a2bdf6cbe83ca354b45b5447cce48be96108ebdf6 |
|
MD5 | e5e87bb9b1021a7517bcc6670904a6e5 |
|
BLAKE2b-256 | 3bc184d4a902944a1920e5af951f7f443a84d912cff3d5bed0723d92eab3c0fa |