mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-18 16:16:33 +00:00
community[patch]: standardized sparkllm init args (#21633)
Related to #20085 @baskaryan Thank you for contributing to LangChain! community:sparkllm[patch]: standardized init args updated `spark_api_key` so that aliased to `api_key`. Added integration test for `sparkllm` to test that it continues to set the same underlying attribute. updated temperature with Pydantic Field, added to the integration test. Ran `make format`,`make test`, `make lint`, `make spell_check`
This commit is contained in:
@@ -5,11 +5,21 @@ from langchain_community.chat_models.sparkllm import ChatSparkLLM
|
||||
|
||||
def test_initialization() -> None:
|
||||
"""Test chat model initialization."""
|
||||
|
||||
for model in [
|
||||
ChatSparkLLM(timeout=30),
|
||||
ChatSparkLLM(request_timeout=30), # type: ignore[call-arg]
|
||||
ChatSparkLLM(
|
||||
api_key="secret",
|
||||
temperature=0.5,
|
||||
timeout=30,
|
||||
),
|
||||
ChatSparkLLM(
|
||||
spark_api_key="secret",
|
||||
request_timeout=30,
|
||||
), # type: ignore[call-arg]
|
||||
]:
|
||||
assert model.request_timeout == 30
|
||||
assert model.spark_api_key == "secret"
|
||||
assert model.temperature == 0.5
|
||||
|
||||
|
||||
def test_chat_spark_llm() -> None:
|
||||
|
Reference in New Issue
Block a user