Skip to content

Commit 043a756

Browse files
authored
test: use .get() for safe ls_params access (#33034)
1 parent 5b418d3 commit 043a756

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libs/partners/openai/tests/unit_tests/chat_models/test_azure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def test_initialize_more() -> None:
4040
assert llm.temperature == 0
4141

4242
ls_params = llm._get_ls_params()
43-
assert ls_params["ls_provider"] == "azure"
44-
assert ls_params["ls_model_name"] == "gpt-35-turbo-0125"
43+
assert ls_params.get("ls_provider") == "azure"
44+
assert ls_params.get("ls_model_name") == "gpt-35-turbo-0125"
4545

4646

4747
def test_initialize_azure_openai_with_openai_api_base_set() -> None:

libs/partners/xai/tests/unit_tests/test_chat_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_xai_model_param() -> None:
3434
llm = ChatXAI(model_name="foo") # type: ignore[call-arg]
3535
assert llm.model_name == "foo"
3636
ls_params = llm._get_ls_params()
37-
assert ls_params["ls_provider"] == "xai"
37+
assert ls_params.get("ls_provider") == "xai"
3838

3939

4040
def test_chat_xai_invalid_streaming_params() -> None:

0 commit comments

Comments
 (0)