Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Wzixiao committed Sep 9, 2023
2 parents 1f2ad83 + 640f36c commit d290932
Show file tree
Hide file tree
Showing 35 changed files with 2,619 additions and 3,258 deletions.
34 changes: 32 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@

<!-- <START NEW CHANGELOG ENTRY> -->

## 2.2.0

([Full Changelog](https://github.com/jupyterlab/jupyter-ai/compare/@jupyter-ai/[email protected]))

### Enhancements made

- Loads vector store index lazily [#374](https://github.com/jupyterlab/jupyter-ai/pull/374) ([@3coins](https://github.com/3coins))
- Added alias for bedrock titan model [#368](https://github.com/jupyterlab/jupyter-ai/pull/368) ([@3coins](https://github.com/3coins))
- Update README, docs [#347](https://github.com/jupyterlab/jupyter-ai/pull/347) ([@JasonWeill](https://github.com/JasonWeill))

### Bugs fixed

- fix newline typo in improve_code [#364](https://github.com/jupyterlab/jupyter-ai/pull/364) ([@michaelchia](https://github.com/michaelchia))

### Maintenance and upkeep improvements

- Upgrades LangChain to 0.0.277 [#375](https://github.com/jupyterlab/jupyter-ai/pull/375) ([@3coins](https://github.com/3coins))
- relax pinning on importlib_metadata, typing_extensions [#363](https://github.com/jupyterlab/jupyter-ai/pull/363) ([@minrk](https://github.com/minrk))

### Documentation improvements

- Remove front end unit tests from code and README.md [#371](https://github.com/jupyterlab/jupyter-ai/pull/371) ([@andrii-i](https://github.com/andrii-i))
- Update README, docs [#347](https://github.com/jupyterlab/jupyter-ai/pull/347) ([@JasonWeill](https://github.com/JasonWeill))

### Contributors to this release

([GitHub contributors page for this release](https://github.com/jupyterlab/jupyter-ai/graphs/contributors?from=2023-08-15&to=2023-09-05&type=c))

[@3coins](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3A3coins+updated%3A2023-08-15..2023-09-05&type=Issues) | [@andrii-i](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3Aandrii-i+updated%3A2023-08-15..2023-09-05&type=Issues) | [@JasonWeill](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3AJasonWeill+updated%3A2023-08-15..2023-09-05&type=Issues) | [@krassowski](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3Akrassowski+updated%3A2023-08-15..2023-09-05&type=Issues) | [@michaelchia](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3Amichaelchia+updated%3A2023-08-15..2023-09-05&type=Issues) | [@minrk](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3Aminrk+updated%3A2023-08-15..2023-09-05&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3Awelcome+updated%3A2023-08-15..2023-09-05&type=Issues)

<!-- <END NEW CHANGELOG ENTRY> -->

## 2.1.0

([Full Changelog](https://github.com/jupyterlab/jupyter-ai/compare/@jupyter-ai/[email protected]))
Expand All @@ -24,8 +56,6 @@

[@3coins](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3A3coins+updated%3A2023-08-08..2023-08-15&type=Issues) | [@anammari](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3Aanammari+updated%3A2023-08-08..2023-08-15&type=Issues) | [@bjornjorgensen](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3Abjornjorgensen+updated%3A2023-08-08..2023-08-15&type=Issues) | [@dlqqq](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3Adlqqq+updated%3A2023-08-08..2023-08-15&type=Issues) | [@JasonWeill](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3AJasonWeill+updated%3A2023-08-08..2023-08-15&type=Issues) | [@krassowski](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3Akrassowski+updated%3A2023-08-08..2023-08-15&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-ai+involves%3Awelcome+updated%3A2023-08-08..2023-08-15&type=Issues)

<!-- <END NEW CHANGELOG ENTRY> -->

## 2.0.1

([Full Changelog](https://github.com/jupyterlab/jupyter-ai/compare/@jupyter-ai/[email protected]))
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions docs/source/users/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ conda install jupyterlab~=4.0
The `jupyter_ai_magics` package, which provides exclusively the IPython magics,
does not depend on JupyterLab or `jupyter_ai`. You can install
`jupyter_ai_magics` without installing `jupyterlab` or `jupyter_ai`.
If you have both `jupyter_ai_magics` and `jupyter_ai` installed, you should
have the same version of each, to avoid errors.

## Installation

Expand Down
108 changes: 85 additions & 23 deletions examples/commands.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "2.1.0",
"version": "2.2.0",
"npmClient": "yarn",
"useNx": true
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jupyter-ai/monorepo",
"version": "2.1.0",
"version": "2.2.0",
"description": "A generative AI extension for JupyterLab",
"private": true,
"keywords": [
Expand Down Expand Up @@ -33,7 +33,8 @@
"dev-uninstall": "lerna run dev-uninstall --stream",
"lint": "jlpm && lerna run prettier && lerna run eslint",
"lint:check": "lerna run prettier:check && lerna run eslint:check",
"watch": "lerna run watch --parallel --stream"
"watch": "lerna run watch --parallel --stream",
"test": "lerna run test"
},
"devDependencies": {
"@jupyterlab/builder": "^4",
Expand Down
4 changes: 2 additions & 2 deletions packages/jupyter-ai-magics/jupyter_ai_magics/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class HfHubProvider(BaseProvider, HuggingFaceHub):
models = ["*"]
model_id_key = "repo_id"
help = (
"See https://huggingface.co/models for a list of models. "
"See [https://huggingface.co/models](https://huggingface.co/models) for a list of models. "
"Pass a model's repository ID as the model ID; for example, `huggingface_hub:ExampleOwner/example-model`."
)
# ipywidgets needed to suppress tqdm warning
Expand Down Expand Up @@ -542,7 +542,7 @@ class SmEndpointProvider(BaseProvider, SagemakerEndpoint):
# This all needs to be on one line of markdown, for use in a table
help = (
"Specify an endpoint name as the model ID. "
"In addition, you must include the `--region_name`, `--request_schema`, and the `--response_path` arguments. "
"In addition, you must specify a region name, request schema, and response path. "
"For more information, see the documentation about [SageMaker endpoints deployment](https://docs.aws.amazon.com/sagemaker/latest/dg/realtime-endpoints-deployment.html) "
"and about [using magic commands with SageMaker endpoints](https://jupyter-ai.readthedocs.io/en/latest/users/index.html#using-magic-commands-with-sagemaker-endpoints)."
)
Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai-magics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jupyter-ai/magics",
"version": "2.1.0",
"version": "2.2.0",
"description": "Jupyter AI magics Python package. Not published on NPM.",
"private": true,
"homepage": "https://github.com/jupyterlab/jupyter-ai",
Expand Down
1 change: 1 addition & 0 deletions packages/jupyter-ai/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,4 @@ dmypy.json

# Coverage reports
coverage/*
junit.xml
41 changes: 12 additions & 29 deletions packages/jupyter-ai/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,29 @@
const jestJupyterLab = require('@jupyterlab/testutils/lib/jest-config');

const esModules = [
'@codemirror',
'@jupyter/ydoc',
'@jupyterlab/',
'lib0',
'y\\-protocols',
'y\\-websocket',
'nanoid',
'vscode-ws-jsonrpc',
'y-protocols',
'y-websocket',
'yjs'
].join('|');

const jlabConfig = jestJupyterLab(__dirname);

const {
moduleFileExtensions,
moduleNameMapper,
preset,
setupFilesAfterEnv,
setupFiles,
testPathIgnorePatterns,
transform
} = jlabConfig;
const baseConfig = jestJupyterLab(__dirname);

module.exports = {
moduleFileExtensions,
moduleNameMapper,
preset,
setupFilesAfterEnv,
setupFiles,
testPathIgnorePatterns,
transform,
...baseConfig,
automock: false,
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/**/.ipynb_checkpoints/*'
// TODO: re-enable coverage reports when we have more comprehensive testing
// 'src/**/*.{ts,tsx}',
// '!src/**/*.d.ts',
// '!src/**/.ipynb_checkpoints/*'
],
coverageDirectory: 'coverage',
coverageReporters: ['lcov', 'text'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json'
}
},
testRegex: 'src/.*/.*.spec.ts[x]?$',
transformIgnorePatterns: [`/node_modules/(?!${esModules}).+`]
};
4 changes: 2 additions & 2 deletions packages/jupyter-ai/jupyter_ai/chat_handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def reply(self, response, human_msg: Optional[HumanChatMessage] = None):
break

def get_llm_chain(self):
lm_provider = self.config_manager.get_lm_provider()
lm_provider_params = self.config_manager.get_lm_provider_params()
lm_provider = self.config_manager.lm_provider
lm_provider_params = self.config_manager.lm_provider_params

curr_lm_id = (
f'{self.llm.id}:{lm_provider_params["model_id"]}' if self.llm else None
Expand Down
5 changes: 1 addition & 4 deletions packages/jupyter-ai/jupyter_ai/chat_handlers/learn.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,7 @@ async def aget_relevant_documents(
return docs

def get_embedding_provider(self):
em_provider_cls = self.config_manager.get_em_provider()
em_provider_args = self.config_manager.get_em_provider_params()

return em_provider_cls, em_provider_args
return self.config_manager.em_provider, self.config_manager.em_provider_params

def get_embedding_model(self):
em_provider_cls, em_provider_args = self.get_embedding_provider()
Expand Down
42 changes: 42 additions & 0 deletions packages/jupyter-ai/jupyter_ai/config/config_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"title": "Jupyter AI configuration",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$comment": "Default values are sourced from `config_manager.py`.",
"type": "object",
"properties": {
"model_provider_id": {
"$comment": "Language model global ID.",
"type": ["string", "null"],
"default": null,
"readOnly": false
},
"embeddings_provider_id": {
"$comment": "Embedding model global ID.",
"type": ["string", "null"],
"default": null,
"readOnly": false
},
"api_keys": {
"$comment": "Dictionary of API keys, mapping key names to key values.",
"type": "object",
"default": {}
},
"send_with_shift_enter": {
"$comment": "Whether to send a message via Shift-Enter instead of Enter.",
"type": "boolean",
"default": false,
"readOnly": false
},
"fields": {
"$comment": "Dictionary of model-specific fields, mapping LM GIDs to sub-dictionaries of field key-value pairs.",
"type": "object",
"default": {},
"patternProperties": {
"^.*$": {
"anyOf": [{ "type": "object" }]
}
},
"additionalProperties": false
}
}
}
Loading

0 comments on commit d290932

Please sign in to comment.