mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-24 20:09:01 +00:00
multiple: standard chat model tests (#20359)
This commit is contained in:
@@ -38,7 +38,10 @@ class ChatModelUnitTests(ABC):
|
||||
def chat_model_has_structured_output(
|
||||
self, chat_model_class: Type[BaseChatModel]
|
||||
) -> bool:
|
||||
return hasattr(chat_model_class, "with_structured_output")
|
||||
return (
|
||||
chat_model_class.with_structured_output
|
||||
is not BaseChatModel.with_structured_output
|
||||
)
|
||||
|
||||
def test_chat_model_init(
|
||||
self, chat_model_class: Type[BaseChatModel], chat_model_params: dict
|
||||
@@ -49,7 +52,8 @@ class ChatModelUnitTests(ABC):
|
||||
def test_chat_model_init_api_key(
|
||||
self, chat_model_class: Type[BaseChatModel], chat_model_params: dict
|
||||
) -> None:
|
||||
model = chat_model_class(api_key="test", **chat_model_params) # type: ignore
|
||||
params = {**chat_model_params, "api_key": "test"}
|
||||
model = chat_model_class(**params) # type: ignore
|
||||
assert model is not None
|
||||
|
||||
def test_chat_model_init_streaming(
|
||||
|
Reference in New Issue
Block a user