Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from JupyterAI v2_28_3 #4

Merged
merged 119 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
27af2c7
Fix plugin ID format (#872)
krassowski Jul 8, 2024
9e1b4fd
Remove unused toolbars/menus from schema (#873)
krassowski Jul 8, 2024
43a0e8f
Do not redefine `refreshCompleterState` on each render (#875)
krassowski Jul 8, 2024
fdb8456
Limit chat input height to 20 lines (#877)
krassowski Jul 8, 2024
4664a0b
Address error on `/learn` after change of embedding model (#870)
srdas Jul 8, 2024
ab38fe7
Fix prefix removal when streaming inline completions (#879)
krassowski Jul 8, 2024
2019571
Add keyboard shortcut command to focus chat input (#876)
krassowski Jul 8, 2024
0d86ee8
Make preferred-dir the default read/write directory for slash command…
andrewfulton9 Jul 9, 2024
bc082b5
Ensure all slash commands support `-h/--help` (#878)
krassowski Jul 9, 2024
6b21c03
Ensuring restricted access to the `/learn` index directory (#887)
krassowski Jul 10, 2024
9f70ea7
Add Ollama (#646)
jtpio Jul 10, 2024
0a60807
Updated integration tests workflow (#890)
krassowski Jul 11, 2024
1786772
Update to `actions/checkout@v4` (#893)
jtpio Jul 12, 2024
8b6c82d
Upload `jupyter-releaser` built distributions (#892)
jtpio Jul 12, 2024
8ca4854
Fix removal of pending messages on error (#888)
krassowski Jul 12, 2024
837789e
Fix streaming in `HuggingFaceHub` provider (#894)
krassowski Jul 12, 2024
fb75ef0
Rework selection replacement (#895)
dlqqq Jul 12, 2024
d6bc48b
Upgrade to `langchain~=0.2.0` and `langchain_community~=0.2.0` (#897)
dlqqq Jul 15, 2024
c118276
Publish 2.19.0
dlqqq Jul 15, 2024
9f95949
[pre-commit.ci] pre-commit autoupdate (#416)
pre-commit-ci[bot] Jul 15, 2024
f0d525b
update docs to reflect Python 3.12 support (#898)
dlqqq Jul 16, 2024
83c0cf8
Fix python<3.10 compatibility (#899)
michaelchia Jul 16, 2024
12d069e
Trim leading whitespace when processing (#900)
krassowski Jul 17, 2024
c047e5c
Make magic aliases user-customizable (#901)
krassowski Jul 18, 2024
69f1d5d
Allow overriding the Ollama base URL (#904)
jtpio Jul 22, 2024
cfcb3c6
Add notebooks to the documentation (#906)
andrewfulton9 Jul 22, 2024
8ae2491
Publish 2.19.1
dlqqq Jul 22, 2024
28d5009
Added new models (#908)
srdas Jul 24, 2024
19c7b6b
Migrate to `langchain-aws` for AWS providers (#909)
dlqqq Jul 25, 2024
fb88723
Respect selected persona in chat input placeholder (#916)
dlqqq Jul 29, 2024
79d66da
Rework selection inclusion; new Send button UX (#905)
dlqqq Jul 29, 2024
b677c83
Publish 2.20.0
dlqqq Jul 29, 2024
73d72e9
Add latest Bedrock models (Titan, Llama 3.1 405b, Mistral Large 2, Ja…
gabrielkoo Jul 31, 2024
b953568
Add support for custom/provisioned models in Bedrock (#922)
dlqqq Jul 31, 2024
8efe46b
Update copyright template (#925)
srdas Jul 31, 2024
4d69962
Settings section improvement (#918)
andrewfulton9 Aug 5, 2024
7531f42
Fix saving chat settings (#935)
dlqqq Aug 6, 2024
4351ad9
Add documentation on how to use Amazon Bedrock (#936)
srdas Aug 10, 2024
2c9523f
prevent send on empty input (#946)
michaelchia Aug 12, 2024
512d642
Add optional configurable message footer (#942)
dlqqq Aug 12, 2024
271877b
Add support for Azure Open AI Embeddings to Jupyter AI (#940)
gsrikant7 Aug 14, 2024
be92fec
Bind reject method to promise, improve typing (#949)
krassowski Aug 15, 2024
83e368b
Make help message template configurable (#938)
dlqqq Aug 17, 2024
bed78bd
Publish 2.21.0
andrii-i Aug 19, 2024
79bebd9
Update documentation to cover installation of all dependencies (#961)
srdas Aug 19, 2024
920a656
[pre-commit.ci] pre-commit autoupdate (#917)
pre-commit-ci[bot] Aug 20, 2024
e45eff5
Allow configuring a default model for cell magics (and line error mag…
krassowski Aug 23, 2024
a55db38
[pre-commit.ci] pre-commit autoupdate (#966)
pre-commit-ci[bot] Aug 26, 2024
41ccd10
Make chat memory size traitlet configurable + /clear to reset memory …
michaelchia Aug 27, 2024
29e2a47
Add Gemini 1.5 to the list of chat options (#964)
trducng Aug 27, 2024
79158ab
add 'Generative AI' submenu (#971)
dlqqq Aug 29, 2024
4b45ec2
Publish 2.22.0
dlqqq Aug 29, 2024
df67eb8
Add ability to delete messages + start new chat session (#951)
michaelchia Sep 9, 2024
5a1a60a
Fix sort messages (#975)
michaelchia Sep 9, 2024
ad6f3a3
Fix `RunnableWithMessageHistory` import (#980)
krassowski Sep 9, 2024
43e6acc
Allow to disable automatic inline completions (#981)
krassowski Sep 9, 2024
83cbd8e
Allow unlimited LLM memory through traitlets configuration (#986)
krassowski Sep 10, 2024
db53228
Publish 2.23.0
dlqqq Sep 11, 2024
cdee73d
upgrade to actions/upload-artifact v4 (#992)
dlqqq Sep 12, 2024
7b4a708
Run mypy on CI, fix or ignore typing issues (#987)
krassowski Sep 12, 2024
bf44c2a
Adds unix shell-style wildcard matching to `/learn` (#989)
andrewfulton9 Sep 16, 2024
fcb2d71
Add OpenRouter support (#996)
akaihola Sep 16, 2024
6e426ab
Framework for adding context to LLM prompt (#993)
michaelchia Sep 25, 2024
0884211
Add `metadata` field to agent messages (#1013)
dlqqq Sep 25, 2024
e6ec9e9
Migrate to `ChatOllama` base class in Ollama provider (#1015)
srdas Sep 26, 2024
278dede
Publish 2.24.0
dlqqq Sep 26, 2024
3a6b0f0
Make path argument required on /learn (#1012)
andrewfulton9 Oct 3, 2024
f3692d9
Export tokens from `lib/index.js` (#1019)
dlqqq Oct 4, 2024
1ec0936
Publish 2.24.1
dlqqq Oct 4, 2024
b15ebb5
Add back history and reset subcommand in magics (#997)
akaihola Oct 7, 2024
70c7755
Export context hooks from NPM package entry point (#1020)
dlqqq Oct 7, 2024
636d5e9
[pre-commit.ci] pre-commit autoupdate (#1016)
pre-commit-ci[bot] Oct 7, 2024
097dbe4
Add support for optional telemetry plugin (#1018)
dlqqq Oct 7, 2024
7c3d3a9
Publish 2.25.0
dlqqq Oct 7, 2024
41bccfe
Test Python 3.9 and 3.12 on CI, test minimum dependencies (#1029)
krassowski Oct 15, 2024
21b0bdb
[pre-commit.ci] pre-commit autoupdate (#1021)
pre-commit-ci[bot] Oct 15, 2024
6fdbecf
Always use `username` from `IdentityProvider` (#1034)
krassowski Oct 16, 2024
bf52423
Support `jupyter-collaboration` v3 (#1035)
krassowski Oct 16, 2024
1eb3b55
Allow users to stop message streaming (#1022)
krassowski Oct 16, 2024
6c59429
Allow `/learn` on JSON files (#1024)
jlsajfj Oct 16, 2024
b3a5f8c
Unify message clearing & broadcast logic (#1038)
dlqqq Oct 18, 2024
9630742
Remove `cleared_message_ids` (#1042)
michaelchia Oct 21, 2024
2545fd1
Migrate streaming logic to `BaseChatHandler` (#1039)
dlqqq Oct 21, 2024
ca3f2c9
Update contributors doc (#1045)
JasonWeill Oct 21, 2024
838dfa9
support Quarto Markdown in `/learn` (#1047)
dlqqq Oct 21, 2024
c2333d9
Publish 2.26.0
dlqqq Oct 21, 2024
25a5bd0
Add new Anthropic Sonnet3.5 v2 models (#1049)
srdas Oct 23, 2024
cd6bd92
Added Developer documentation for streaming responses (#1051)
srdas Oct 28, 2024
dba7e4b
Implement streaming for `/fix` (#1048)
srdas Oct 28, 2024
b621aa4
[pre-commit.ci] pre-commit autoupdate (#1057)
pre-commit-ci[bot] Oct 29, 2024
d82d3c3
Publish 2.27.0
dlqqq Oct 29, 2024
ec34146
Added Ollama to user docs (#1064)
srdas Oct 30, 2024
bafccef
Add examples of using Fields and EnvAuthStrategy to developer documen…
alanmeeson Oct 31, 2024
167a47d
Merge Anthropic language model providers (#1069)
srdas Oct 31, 2024
e1d99cc
Allow `$` to literally denote quantities of USD in chat (#1068)
dlqqq Oct 31, 2024
da1f5f6
Fix magic commands when using non-chat providers w/ history (#1075)
alanmeeson Nov 1, 2024
f8944b1
Fix `/export` by including streamed agent messages (#1077)
mcavdar Nov 1, 2024
49709dc
Reduced padding in cell around code icons in code toolbar (#1072)
srdas Nov 4, 2024
71be3ce
Improve installation documentation and clarify provider dependencies …
srdas Nov 6, 2024
55ca34e
Remove retired models and add new `Haiku-3.5` model in Anthropic (#1092)
srdas Nov 6, 2024
6eb6a62
Continue to allow `$` symbols to delimit inline math in human message…
dlqqq Nov 7, 2024
39decdd
Publish 2.28.0
dlqqq Nov 7, 2024
d5d604d
Update `faiss-cpu` version range (#1097)
dlqqq Nov 11, 2024
461bd06
Publish 2.28.1
dlqqq Nov 11, 2024
c62abb8
Fix rendering of code blocks in JupyterLab 4.3.0+ (#1104)
dlqqq Nov 12, 2024
adaa3b2
Catch error on non plaintext files in `@file` and reply gracefully in…
srdas Nov 15, 2024
cbfed31
bump LangChain version floors (#1109)
dlqqq Nov 18, 2024
e607e34
Publish 2.28.2
dlqqq Nov 18, 2024
f8dc779
Downgrade spurious 'error' logs (#1119)
ctcjab Nov 27, 2024
009a1c0
Removes outdated OpenAI models and adds new ones (#1127)
srdas Dec 2, 2024
922712c
[pre-commit.ci] pre-commit autoupdate (#1131)
pre-commit-ci[bot] Dec 2, 2024
342bb7b
Update model fields immediately on save (#1125)
dlqqq Dec 2, 2024
2c196d9
Fix install step in CI (#1139)
dlqqq Dec 5, 2024
3a8016a
Fix JSON serialization error in Ollama models (#1129)
JanusChoi Dec 5, 2024
37558cd
Update completion model fields immediately on save (#1137)
dlqqq Dec 5, 2024
f7dabb3
Publish 2.28.3
dlqqq Dec 5, 2024
5ffe481
Improve user messaging and documentation for Cross-Region Inference o…
srdas Dec 6, 2024
1cbd853
Add base API URL field for Ollama and OpenAI embedding models (#1136)
srdas Dec 9, 2024
a111db2
Merge with JupyterAi v2.28.3
cl-gavan Dec 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: E2E Tests

# suppress warning raised by https://github.com/jupyter/jupyter_core/pull/292
env:
JUPYTER_PLATFORM_DIRS: '1'
JUPYTER_PLATFORM_DIRS: "1"

on:
push:
branches: main
pull_request:
branches: '*'
branches: "*"

jobs:
e2e-tests:
Expand Down Expand Up @@ -41,17 +41,17 @@ jobs:
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('packages/jupyter-ai/ui-tests/yarn.lock') }}

- name: Install browser
- name: Install Chromium
working-directory: packages/jupyter-ai/ui-tests
run: jlpm install-chromium

- name: Execute e2e tests
- name: Run E2E tests
working-directory: packages/jupyter-ai/ui-tests
run: jlpm test

- name: Upload Playwright Test report
- name: Upload Playwright test report
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: jupyter-ai-playwright-tests-linux
path: |
Expand Down
37 changes: 35 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python Unit Tests
name: Python Tests

# suppress warning raised by https://github.com/jupyter/jupyter_core/pull/292
env:
Expand All @@ -12,19 +12,52 @@ on:

jobs:
unit-tests:
name: Linux
name: Unit tests (Python ${{ matrix.python-version }}, ${{ matrix.dependency-type }} dependencies)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- dependency-type: minimum
python-version: "3.9"
- dependency-type: standard
python-version: "3.12"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
python_version: ${{ matrix.python-version }}
dependency_type: ${{ matrix.dependency-type }}

- name: Install extension dependencies and build the extension
run: ./scripts/install.sh

- name: List installed versions
run: pip list

- name: Execute unit tests
run: |
set -eux
pytest -vv -r ap --cov jupyter_ai

typing-tests:
name: Typing test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install extension dependencies and build the extension
run: ./scripts/install.sh

- name: Run mypy
run: |
set -eux
mypy --version
mypy packages/jupyter-ai
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: check-case-conflict
Expand All @@ -18,7 +18,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.10.0
hooks:
- id: black

Expand All @@ -30,13 +30,13 @@ repos:
files: \.py$

- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/pycqa/flake8
rev: 7.1.0
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -48,7 +48,7 @@ repos:
stages: [manual]

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.29.0
rev: 0.30.0
hooks:
- id: check-jsonschema
name: "Check GitHub Workflows"
Expand Down
307 changes: 303 additions & 4 deletions CHANGELOG.md

Large diffs are not rendered by default.

68 changes: 61 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,80 @@ Below is a simplified overview of the installation and usage process.
See [our official documentation](https://jupyter-ai.readthedocs.io/en/latest/users/index.html)
for details on installing and using Jupyter AI.

### With pip
We offer 3 different ways to install Jupyter AI. You can read through each
section to pick the installation method that works best for you.

1. Quick installation via `pip` (recommended)
2. Minimal installation via `pip`
3. Minimal installation via `conda`

### Quick installation via `pip` (recommended)

If you want to install both the `%%ai` magic and the JupyterLab extension, you can run:

$ pip install jupyter-ai
$ pip install jupyter-ai[all]

Then, restart JupyterLab. This will install every optional dependency, which
provides access to all models currently supported by `jupyter-ai`.

If you are not using JupyterLab and you only want to install the Jupyter AI `%%ai` magic, you can run:
If you are not using JupyterLab and you only want to install the Jupyter AI
`%%ai` magic, you can run:

$ pip install jupyter-ai-magics
$ pip install jupyter-ai-magics[all]

`jupyter-ai` depends on `jupyter-ai-magics`, so installing `jupyter-ai`
automatically installs `jupyter-ai-magics`.

### With conda
### Minimal installation via `pip`

Most model providers in Jupyter AI require a specific dependency to be installed
before they are available for use. These are called _provider dependencies_.
Provider dependencies are optional to Jupyter AI, meaning that Jupyter AI can be
installed with or without any provider dependencies installed. If a provider
requires a dependency that is not installed, its models are not listed in the
user interface which allows you to select a language model.

To perform a minimal installation via `pip` without any provider dependencies,
omit the `[all]` optional dependency group from the package name:

```
pip install jupyter-ai
```

By selectively installing provider dependencies, you can control which models
are available in your Jupyter AI environment.

For example, to install Jupyter AI with only added support for Anthropic models, run:

```
pip install jupyter-ai langchain-anthropic
```

For more information on model providers and which dependencies they require, see
[the model provider table](https://jupyter-ai.readthedocs.io/en/latest/users/index.html#model-providers).

### Minimal installation via `conda`

As an alternative to using `pip`, you can install `jupyter-ai` using
[Conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html)
from the `conda-forge` channel, using one of the following two commands:
from the `conda-forge` channel:

$ conda install -c conda-forge jupyter-ai # or,
$ conda install conda-forge::jupyter-ai

Most model providers in Jupyter AI require a specific _provider dependency_ to
be installed before they are available for use. Provider dependencies are
not installed when installing `jupyter-ai` from Conda Forge, and should be
installed separately as needed.

For example, to install Jupyter AI with only added support for OpenAI models, run:

```
conda install conda-forge::jupyter-ai conda-forge::langchain-openai
```

For more information on model providers and which dependencies they require, see
[the model provider table](https://jupyter-ai.readthedocs.io/en/latest/users/index.html#model-providers).

## The `%%ai` magic command

The `%%ai` magic works anywhere the IPython kernel runs, including JupyterLab, Jupyter Notebook, Google Colab, and Visual Studio Code.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/chat-icon-left-tab-bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/source/contributors/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Issues and pull requests that violate the above principles may be declined. If y

You can develop Jupyter AI on any system that can run a supported Python version up to and including 3.12, including recent Windows, macOS, and Linux versions.

Each Jupyter AI major version works with only one major version of JupyterLab. Jupyter AI 1.x supports JupyterLab 3.x, and Jupyter AI 2.x supports JupyterLab 4.x.
You should have the newest supported version of JupyterLab installed.

We highly recommend that you install [conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html) to start developing on Jupyter AI, especially if you are developing on macOS on an Apple Silicon-based Mac (M1, M1 Pro, M2, etc.).
We highly recommend that you install [conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html) to start contributing to Jupyter AI, especially if you are developing on macOS on an Apple Silicon-based Mac (M1, M1 Pro, M2, etc.).

You will need Node.js 18 to use Jupyter AI. Node.js 18.16.0 is known to work.
You will need [a supported version of node.js](https://github.com/nodejs/release#release-schedule) to use Jupyter AI.

:::{warning}
:name: node-18-15
Expand Down
Loading
Loading