Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 14, 2025
1 parent a70967e commit 90a37a9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
Field,
MultiEnvAuthStrategy,
)
from pydantic import BaseModel, ConfigDict
from langchain_community.embeddings import (
GPT4AllEmbeddings,
HuggingFaceHubEmbeddings,
QianfanEmbeddingsEndpoint,
)
from pydantic import BaseModel, ConfigDict


class BaseEmbeddingsProvider(BaseModel):
Expand Down
3 changes: 1 addition & 2 deletions packages/jupyter-ai-magics/jupyter_ai_magics/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@
PromptTemplate,
SystemMessagePromptTemplate,
)
from pydantic import BaseModel, ConfigDict
from langchain.schema import LLMResult
from langchain.schema.output_parser import StrOutputParser
from langchain.schema.runnable import Runnable
from langchain_community.chat_models import QianfanChatEndpoint
from langchain_community.llms import AI21, GPT4All, HuggingFaceEndpoint, Together
from langchain_core.language_models.chat_models import BaseChatModel
from langchain_core.language_models.llms import BaseLLM

from pydantic import BaseModel, ConfigDict

from . import completion_utils as completion
from .models.completion import (
Expand Down
2 changes: 1 addition & 1 deletion packages/jupyter-ai/jupyter_ai/chat_handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
)
from jupyter_ai_magics import Persona
from jupyter_ai_magics.providers import BaseProvider
from pydantic import BaseModel
from langchain_core.messages import AIMessageChunk
from langchain_core.runnables import Runnable
from langchain_core.runnables.config import RunnableConfig
from langchain_core.runnables.config import merge_configs as merge_runnable_configs
from langchain_core.runnables.utils import Input
from pydantic import BaseModel

if TYPE_CHECKING:
from jupyter_ai.context_providers import BaseCommandContextProvider
Expand Down
4 changes: 3 additions & 1 deletion packages/jupyter-ai/jupyter_ai/tests/test_config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ def configure_with_fields(cm: ConfigManager, completions: bool = False):

def test_snapshot_default_config(cm: ConfigManager, snapshot):
config_from_cm: DescribeConfigResponse = cm.get_config()
assert config_from_cm.model_dump() == snapshot(exclude=lambda prop, path: prop == "last_read")
assert config_from_cm.model_dump() == snapshot(
exclude=lambda prop, path: prop == "last_read"
)


def test_init_with_existing_config(cm: ConfigManager, common_cm_kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
@pytest.fixture
def human_chat_message() -> HumanChatMessage:
chat_client = ChatClient(
id="test-client-uuid", username="test", initials="test", name="test", display_name="test"
id="test-client-uuid",
username="test",
initials="test",
name="test",
display_name="test",
)
prompt = (
"@file:test1.py @file @file:dir/test2.md test test\n"
Expand Down
6 changes: 5 additions & 1 deletion packages/jupyter-ai/jupyter_ai/tests/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ class TestException(Exception):
@pytest.fixture
def chat_client():
return ChatClient(
id="test-client-uuid", username="test", initials="test", name="test", display_name="test"
id="test-client-uuid",
username="test",
initials="test",
name="test",
display_name="test",
)


Expand Down

0 comments on commit 90a37a9

Please sign in to comment.