Skip to content

Commit 1ed6fce

Browse files
formatting
1 parent 85b7e1d commit 1ed6fce

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/agentlab/llm/chat_api.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ def make_model(self):
110110
class AzureModelArgs(BaseModelArgs):
111111
"""Serializable object for instantiating a generic chat model with an Azure model."""
112112

113-
deployment_name: str = None # NOTE: deployment_name is deprecated for Azure OpenAI and won't be used.
113+
deployment_name: str = (
114+
None # NOTE: deployment_name is deprecated for Azure OpenAI and won't be used.
115+
)
114116

115117
def make_model(self):
116118
return AzureChatModel(
@@ -405,9 +407,13 @@ def __init__(
405407
log_probs=False,
406408
):
407409
api_key = api_key or os.getenv("AZURE_OPENAI_API_KEY")
408-
assert api_key, "AZURE_OPENAI_API_KEY has to be defined in the environment when using AzureChatModel"
410+
assert (
411+
api_key
412+
), "AZURE_OPENAI_API_KEY has to be defined in the environment when using AzureChatModel"
409413
endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
410-
assert endpoint, "AZURE_OPENAI_ENDPOINT has to be defined in the environment when using AzureChatModel"
414+
assert (
415+
endpoint
416+
), "AZURE_OPENAI_ENDPOINT has to be defined in the environment when using AzureChatModel"
411417

412418
if deployment_name is not None:
413419
logging.info(

tests/llm/test_chat_api.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121

2222
@pytest.mark.pricy
2323
@pytest.mark.skipif(skip_tests, reason="Skipping on remote as Azure is pricy")
24-
@pytest.mark.skipif(not os.getenv("AZURE_OPENAI_API_KEY"), reason="Skipping as Azure API key not set")
24+
@pytest.mark.skipif(
25+
not os.getenv("AZURE_OPENAI_API_KEY"), reason="Skipping as Azure API key not set"
26+
)
2527
def test_api_model_args_azure():
2628
model_args = AzureModelArgs(
2729
model_name="gpt-4.1-nano",
@@ -66,7 +68,9 @@ def test_api_model_args_openai():
6668

6769
@pytest.mark.pricy
6870
@pytest.mark.skipif(skip_tests, reason="Skipping on remote as Anthropic is pricy")
69-
@pytest.mark.skipif(not os.getenv("ANTHROPIC_API_KEY"), reason="Skipping as Anthropic API key not set")
71+
@pytest.mark.skipif(
72+
not os.getenv("ANTHROPIC_API_KEY"), reason="Skipping as Anthropic API key not set"
73+
)
7074
def test_api_model_args_anthropic():
7175
model_args = AnthropicModelArgs(
7276
model_name="claude-3-haiku-20240307",

0 commit comments

Comments
 (0)