Skip to content

Commit

Permalink
Ruff (why on so many files?)
Browse files Browse the repository at this point in the history
  • Loading branch information
stellasia committed Dec 30, 2024
1 parent 4f1f7fd commit 0b06bdb
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/neo4j_graphrag/llm/anthropic_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
from __future__ import annotations

from typing import Any, Iterable, Optional, TYPE_CHECKING, cast
from typing import TYPE_CHECKING, Any, Iterable, Optional, cast

from pydantic import ValidationError

Expand Down
1 change: 1 addition & 0 deletions src/neo4j_graphrag/llm/cohere_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Any, Iterable, Optional, cast

from pydantic import ValidationError

from neo4j_graphrag.exceptions import LLMGenerationError
Expand Down
3 changes: 2 additions & 1 deletion src/neo4j_graphrag/llm/mistralai_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import os
from typing import Any, Iterable, Optional, cast

from pydantic import ValidationError

from neo4j_graphrag.exceptions import LLMGenerationError
Expand All @@ -30,7 +31,7 @@
)

try:
from mistralai import Mistral, Messages
from mistralai import Messages, Mistral
from mistralai.models.sdkerror import SDKError
except ImportError:
Mistral = None # type: ignore
Expand Down
5 changes: 3 additions & 2 deletions src/neo4j_graphrag/llm/ollama_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations
from typing import Any, Iterable, Optional, Sequence, TYPE_CHECKING, cast

from typing import TYPE_CHECKING, Any, Iterable, Optional, Sequence, cast

from pydantic import ValidationError

Expand All @@ -24,9 +25,9 @@
BaseMessage,
LLMMessage,
LLMResponse,
MessageList,
SystemMessage,
UserMessage,
MessageList,
)

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion src/neo4j_graphrag/llm/openai_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
BaseMessage,
LLMMessage,
LLMResponse,
MessageList,
SystemMessage,
UserMessage,
MessageList,
)

if TYPE_CHECKING:
Expand Down
3 changes: 2 additions & 1 deletion src/neo4j_graphrag/llm/types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pydantic import BaseModel
from typing import Literal, TypedDict

from pydantic import BaseModel


class LLMResponse(BaseModel):
content: str
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/llm/vertexai_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

try:
from vertexai.generative_models import (
Content,
GenerativeModel,
ResponseValidationError,
Part,
Content,
ResponseValidationError,
)
except ImportError:
GenerativeModel = None
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/test_simplekgpipeline_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ async def test_pipeline_builder_happy_path(
await kg_builder_text.run_async(text=harry_potter_text)



@pytest.mark.asyncio
@pytest.mark.usefixtures("setup_neo4j_for_kg_construction")
async def test_pipeline_builder_two_documents(
Expand Down
1 change: 0 additions & 1 deletion tests/unit/llm/test_anthropic_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from unittest.mock import AsyncMock, MagicMock, Mock, patch

import anthropic

import pytest
from neo4j_graphrag.exceptions import LLMGenerationError
from neo4j_graphrag.llm.anthropic_llm import AnthropicLLM
Expand Down

0 comments on commit 0b06bdb

Please sign in to comment.