Skip to content

Commit

Permalink
Use multiline strings instead of mixing '' and ""
Browse files Browse the repository at this point in the history
  • Loading branch information
stellasia committed Dec 12, 2024
1 parent 74ec90b commit f72b79a
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/embeddings/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class CohereEmbeddings(Embedder):
def __init__(self, model: str = "", **kwargs: Any) -> None:
if cohere is None:
raise ImportError(
"Could not import cohere python client. "
'Please install it with `pip install "neo4j-graphrag[cohere]"`.'
"""Could not import cohere python client.
Please install it with `pip install "neo4j-graphrag[cohere]"`."""
)
self.model = model
self.client = cohere.Client(**kwargs)
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/embeddings/mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class MistralAIEmbeddings(Embedder):
def __init__(self, model: str = "mistral-embed", **kwargs: Any) -> None:
if Mistral is None:
raise ImportError(
"Could not import mistralai. "
'Please install it with `pip install "neo4j-graphrag[mistralai]"`.'
"""Could not import mistralai.
Please install it with `pip install "neo4j-graphrag[mistralai]"`."""
)
api_key = kwargs.pop("api_key", None)
if api_key is None:
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/embeddings/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def __init__(self, model: str = "text-embedding-ada-002", **kwargs: Any) -> None
import openai
except ImportError:
raise ImportError(
"Could not import openai python client. "
'Please install it with `pip install "neo4j-graphrag[openai]"`.'
"""Could not import openai python client.
Please install it with `pip install "neo4j-graphrag[openai]"`."""
)
self.openai = openai
self.model = model
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/embeddings/sentence_transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def __init__(
import torch
except ImportError:
raise ImportError(
"Could not import sentence_transformers python package. "
'Please install it with `pip install "neo4j-graphrag[sentence-transformers]"`.'
"""Could not import sentence_transformers python package.
Please install it with `pip install "neo4j-graphrag[sentence-transformers]"`."""
)
self.torch = torch
self.np = np
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/embeddings/vertexai.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class VertexAIEmbeddings(Embedder):
def __init__(self, model: str = "text-embedding-004") -> None:
if vertexai is None:
raise ImportError(
"Could not import Vertex AI Python client. "
'Please install it with `pip install "neo4j-graphrag[google]"`.'
"""Could not import Vertex AI Python client.
Please install it with `pip install "neo4j-graphrag[google]"`."""
)
self.vertexai_model = (
vertexai.language_models.TextEmbeddingModel.from_pretrained(model)
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/llm/anthropic_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def __init__(
import anthropic
except ImportError:
raise ImportError(
"Could not import Anthropic Python client. "
'Please install it with `pip install "neo4j-graphrag[anthropic]"`.'
"""Could not import Anthropic Python client.
Please install it with `pip install "neo4j-graphrag[anthropic]"`."""
)
super().__init__(model_name, model_params)
self.anthropic = anthropic
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/llm/cohere_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def __init__(
import cohere
except ImportError:
raise ImportError(
"Could not import cohere python client. "
'Please install it with `pip install "neo4j-graphrag[cohere]"`.'
"""Could not import cohere python client.
Please install it with `pip install "neo4j-graphrag[cohere]"`."""
)

self.cohere = cohere
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/llm/mistralai_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def __init__(
"""
if Mistral is None:
raise ImportError(
"Could not import Mistral Python client. "
'Please install it with `pip install "neo4j-graphrag[mistralai]"`.'
"""Could not import Mistral Python client.
Please install it with `pip install "neo4j-graphrag[mistralai]"`."""
)
super().__init__(model_name, model_params)
api_key = kwargs.pop("api_key", None)
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/llm/openai_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def __init__(
import openai
except ImportError:
raise ImportError(
"Could not import openai Python client. "
'Please install it with `pip install "neo4j-graphrag[openai]"`.'
"""Could not import openai Python client.
Please install it with `pip install "neo4j-graphrag[openai]"`."""
)
self.openai = openai
super().__init__(model_name, model_params)
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 @@ -59,8 +59,8 @@ def __init__(
):
if GenerativeModel is None or ResponseValidationError is None:
raise ImportError(
"Could not import Vertex AI Python client. "
'Please install it with `pip install "neo4j-graphrag[google]"`.'
"""Could not import Vertex AI Python client.
Please install it with `pip install "neo4j-graphrag[google]"`."""
)
super().__init__(model_name, model_params)
self.model = GenerativeModel(model_name=model_name, **kwargs)
Expand Down

0 comments on commit f72b79a

Please sign in to comment.