forked from jupyterlab/jupyter-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add precommit config * add pre-commit to Python dev dependency groups * precommit initial pass * fix precommit
- Loading branch information
Showing
59 changed files
with
1,140 additions
and
863 deletions.
There are no files selected for viewing
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,58 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: check-case-conflict | ||
- id: check-executables-have-shebangs | ||
- id: requirements-txt-fixer | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-toml | ||
exclude: ^packages/jupyter-ai-module-cookiecutter | ||
- id: check-yaml | ||
exclude: ^packages/jupyter-ai-module-cookiecutter | ||
- id: debug-statements | ||
- id: forbid-new-submodules | ||
- id: check-builtin-literals | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.3.0 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black"] | ||
files: \.py$ | ||
|
||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.4.0 | ||
hooks: | ||
- id: pyupgrade | ||
args: [--py37-plus] | ||
|
||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
[ | ||
"flake8-bugbear==20.1.4", | ||
"flake8-logging-format==0.6.0", | ||
"flake8-implicit-str-concat==0.2.0", | ||
] | ||
stages: [manual] | ||
|
||
- repo: https://github.com/sirosen/check-jsonschema | ||
rev: 0.23.1 | ||
hooks: | ||
- id: check-jsonschema | ||
name: "Check GitHub Workflows" | ||
files: ^\.github/workflows/ | ||
types: [yaml] | ||
args: ["--schemafile", "https://json.schemastore.org/github-workflow"] | ||
stages: [manual] |
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
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
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,29 +1,32 @@ | ||
from ._version import __version__ | ||
|
||
# expose embedding model providers on the package root | ||
from .embedding_providers import ( | ||
CohereEmbeddingsProvider, | ||
HfHubEmbeddingsProvider, | ||
OpenAIEmbeddingsProvider, | ||
) | ||
from .exception import store_exception | ||
from .magics import AiMagics | ||
|
||
# expose model providers on the package root | ||
from .providers import ( | ||
AI21Provider, | ||
AnthropicProvider, | ||
BaseProvider, | ||
ChatOpenAINewProvider, | ||
ChatOpenAIProvider, | ||
CohereProvider, | ||
HfHubProvider, | ||
OpenAIProvider, | ||
ChatOpenAIProvider, | ||
ChatOpenAINewProvider, | ||
SmEndpointProvider | ||
) | ||
# expose embedding model providers on the package root | ||
from .embedding_providers import ( | ||
OpenAIEmbeddingsProvider, | ||
CohereEmbeddingsProvider, | ||
HfHubEmbeddingsProvider | ||
SmEndpointProvider, | ||
) | ||
from .providers import BaseProvider | ||
|
||
|
||
def load_ipython_extension(ipython): | ||
ipython.register_magics(AiMagics) | ||
ipython.set_custom_exc((BaseException,), store_exception) | ||
|
||
|
||
def unload_ipython_extension(ipython): | ||
ipython.set_custom_exc((BaseException,), ipython.CustomTB) |
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
"gpt3": "openai:text-davinci-003", | ||
"chatgpt": "openai-chat:gpt-3.5-turbo", | ||
"gpt4": "openai-chat:gpt-4", | ||
} | ||
} |
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
Oops, something went wrong.