Skip to content

Commit a9c3a56

Browse files
committed
make standard_chat_model_params public
1 parent ab513bf commit a9c3a56

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

libs/standard-tests/langchain_tests/integration_tests/chat_models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ def chat_model_params(self) -> dict:
111111
"""
112112

113113
@property
114-
def _standard_chat_model_params(self) -> dict:
114+
def standard_chat_model_params(self) -> dict:
115+
""":meta private:"""
115116
return {}
116117

117118
def test_invoke(self, model: BaseChatModel) -> None:

libs/standard-tests/langchain_tests/unit_tests/chat_models.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ def chat_model_params(self) -> dict:
289289
return {}
290290

291291
@property
292-
def _standard_chat_model_params(self) -> dict:
292+
def standard_chat_model_params(self) -> dict:
293+
""":meta private:"""
293294
return {
294295
"temperature": 0,
295296
"max_tokens": 100,
@@ -303,7 +304,7 @@ def model(self) -> BaseChatModel:
303304
"""Fixture that returns an instance of the chat model. Should not be
304305
overridden."""
305306
return self.chat_model_class(
306-
**{**self._standard_chat_model_params, **self.chat_model_params}
307+
**{**self.standard_chat_model_params, **self.chat_model_params}
307308
)
308309

309310
@property
@@ -448,8 +449,9 @@ def init_from_env_params(self) -> Tuple[dict, dict, dict]:
448449
""" # noqa: E501
449450

450451
@property
451-
def _standard_chat_model_params(self) -> dict:
452-
params = super()._standard_chat_model_params
452+
def standard_chat_model_params(self) -> dict:
453+
""":meta private:"""
454+
params = super().standard_chat_model_params
453455
params["api_key"] = "test"
454456
return params
455457

@@ -472,7 +474,7 @@ def test_init(self) -> None:
472474
2. The model accommodates standard parameters: https://python.langchain.com/docs/concepts/chat_models/#standard-parameters
473475
""" # noqa: E501
474476
model = self.chat_model_class(
475-
**{**self._standard_chat_model_params, **self.chat_model_params}
477+
**{**self.standard_chat_model_params, **self.chat_model_params}
476478
)
477479
assert model is not None
478480

@@ -512,7 +514,7 @@ def test_init_streaming(
512514
"""
513515
model = self.chat_model_class(
514516
**{
515-
**self._standard_chat_model_params,
517+
**self.standard_chat_model_params,
516518
**self.chat_model_params,
517519
"streaming": True,
518520
}

0 commit comments

Comments
 (0)