mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-17 07:26:16 +00:00
community:yuan2[patch]: standardize init args (#21462)
updated stop and request_timeout so they aliased to stop_sequences, and timeout respectively. Added test that both continue to set the same underlying attributes. Related to [20085](https://github.com/langchain-ai/langchain/issues/20085) Co-authored-by: ccurme <chester.curme@gmail.com>
This commit is contained in:
@@ -22,6 +22,22 @@ def test_yuan2_model_param() -> None:
|
||||
assert chat.model_name == "foo"
|
||||
|
||||
|
||||
@pytest.mark.requires("openai")
|
||||
def test_yuan2_timeout_param() -> None:
|
||||
chat = ChatYuan2(request_timeout=5) # type: ignore[call-arg]
|
||||
assert chat.request_timeout == 5
|
||||
chat = ChatYuan2(timeout=10) # type: ignore[call-arg]
|
||||
assert chat.request_timeout == 10
|
||||
|
||||
|
||||
@pytest.mark.requires("openai")
|
||||
def test_yuan2_stop_sequences_param() -> None:
|
||||
chat = ChatYuan2(stop=["<eod>"]) # type: ignore[call-arg]
|
||||
assert chat.stop == ["<eod>"]
|
||||
chat = ChatYuan2(stop_sequences=["<eod>"]) # type: ignore[call-arg]
|
||||
assert chat.stop == ["<eod>"]
|
||||
|
||||
|
||||
def test__convert_message_to_dict_human() -> None:
|
||||
message = HumanMessage(content="foo")
|
||||
result = _convert_message_to_dict(message)
|
||||
|
Reference in New Issue
Block a user