mirror of
https://github.com/hwchase17/langchain.git
synced 2026-01-24 05:50:18 +00:00
test: use .get() for safe ls_params access (#33034)
This commit is contained in:
@@ -40,8 +40,8 @@ def test_initialize_more() -> None:
|
||||
assert llm.temperature == 0
|
||||
|
||||
ls_params = llm._get_ls_params()
|
||||
assert ls_params["ls_provider"] == "azure"
|
||||
assert ls_params["ls_model_name"] == "gpt-35-turbo-0125"
|
||||
assert ls_params.get("ls_provider") == "azure"
|
||||
assert ls_params.get("ls_model_name") == "gpt-35-turbo-0125"
|
||||
|
||||
|
||||
def test_initialize_azure_openai_with_openai_api_base_set() -> None:
|
||||
|
||||
@@ -34,7 +34,7 @@ def test_xai_model_param() -> None:
|
||||
llm = ChatXAI(model_name="foo") # type: ignore[call-arg]
|
||||
assert llm.model_name == "foo"
|
||||
ls_params = llm._get_ls_params()
|
||||
assert ls_params["ls_provider"] == "xai"
|
||||
assert ls_params.get("ls_provider") == "xai"
|
||||
|
||||
|
||||
def test_chat_xai_invalid_streaming_params() -> None:
|
||||
|
||||
Reference in New Issue
Block a user