-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* config manager initial draft * implement basic client for new config manager * implement JL4 unit testing (do not backport) * implement chat settings save * implement client API key deletion * greatly improve error banner handling in settings * implement API key edit and delete in settings UI * ensure API keys are not empty * reduce top and side padding in settings UI * pre-commit * fix integer field type error from rebase * fix api key edit/delete react bugs * improve UI error formatting * implement last_read check on settings form * fix local model ID not showing * remove outdated comment * ensure no empty field dictionaries in config * fix minor typo
- Loading branch information
Showing
28 changed files
with
2,262 additions
and
2,438 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,3 +124,4 @@ dmypy.json | |
|
||
# Coverage reports | ||
coverage/* | ||
junit.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}).+`] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
Oops, something went wrong.