Skip to content

Commit 821f644

Browse files
misc: fixing pylint issues
1 parent 26ce90c commit 821f644

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

graphgen/models/llm/api/openai_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def __init__(
5959
self.rpm = rpm or RPM()
6060
self.tpm = tpm or TPM()
6161

62-
assert backend in ["openai_api", "azure_openai_api"], f"Unsupported backend {backend}. Use 'openai_api' or 'azure_openai_api'."
62+
assert (
63+
backend in ("openai_api", "azure_openai_api")
64+
), f"Unsupported backend '{backend}'. Use 'openai_api' or 'azure_openai_api'."
6365
self.backend = backend
6466

6567
self.__post_init__()
@@ -68,7 +70,6 @@ def __post_init__(self):
6870

6971
api_name = self.backend.replace("_", " ")
7072
assert self.api_key is not None, f"Please provide api key to access {api_name}."
71-
7273
if self.backend == "openai_api":
7374
self.client = AsyncOpenAI(
7475
api_key=self.api_key or "dummy", base_url=self.base_url

graphgen/operators/init/init_llm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ def create_llm_wrapper(backend: str, config: Dict[str, Any]) -> BaseLLMWrapper:
2727
from graphgen.models.llm.api.http_client import HTTPClient
2828

2929
return HTTPClient(**config)
30-
if backend == "openai_api" or backend == "azure_openai_api":
30+
if backend in ("openai_api", "azure_openai_api"):
3131
from graphgen.models.llm.api.openai_client import OpenAIClient
32-
33-
# pass in concrete backend to the OpenAIClient so that internally we can distinguish between OpenAI and Azure OpenAI
32+
# pass in concrete backend to the OpenAIClient so that internally we can distinguish
33+
# between OpenAI and Azure OpenAI
3434
return OpenAIClient(**config, backend=backend)
3535
if backend == "ollama_api":
3636
from graphgen.models.llm.api.ollama_client import OllamaClient

0 commit comments

Comments
 (0)