mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-25 13:07:58 +00:00
add alias for model (#4553)
Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
This commit is contained in:
@@ -25,6 +25,14 @@ def test_chat_openai() -> None:
|
||||
assert isinstance(response.content, str)
|
||||
|
||||
|
||||
def test_chat_openai_model() -> None:
|
||||
"""Test ChatOpenAI wrapper handles model_name."""
|
||||
chat = ChatOpenAI(model="foo")
|
||||
assert chat.model_name == "foo"
|
||||
chat = ChatOpenAI(model_name="bar")
|
||||
assert chat.model_name == "bar"
|
||||
|
||||
|
||||
def test_chat_openai_system_message() -> None:
|
||||
"""Test ChatOpenAI wrapper with system message."""
|
||||
chat = ChatOpenAI(max_tokens=10)
|
||||
|
@@ -19,6 +19,13 @@ def test_openai_call() -> None:
|
||||
assert isinstance(output, str)
|
||||
|
||||
|
||||
def test_openai_model_param() -> None:
|
||||
llm = OpenAI(model="foo")
|
||||
assert llm.model_name == "foo"
|
||||
llm = OpenAI(model_name="foo")
|
||||
assert llm.model_name == "foo"
|
||||
|
||||
|
||||
def test_openai_extra_kwargs() -> None:
|
||||
"""Test extra kwargs to openai."""
|
||||
# Check that foo is saved in extra_kwargs.
|
||||
|
Reference in New Issue
Block a user