mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-21 14:18:52 +00:00
check passing message names
This commit is contained in:
parent
25ce1e211a
commit
90a245b979
@ -419,6 +419,13 @@ class ChatModelIntegrationTests(ChatModelTests):
|
|||||||
assert isinstance(result.content, str)
|
assert isinstance(result.content, str)
|
||||||
assert len(result.content) > 0
|
assert len(result.content) > 0
|
||||||
|
|
||||||
|
def test_invoke_messages_with_names(self, model: BaseChatModel) -> None:
|
||||||
|
result = model.invoke([HumanMessage("Hello", name="Bob"), AIMessage("How are you?", name="Alice"), HumanMessage("I'm fine, thank you! Tell me a joke.", name="Bob")])
|
||||||
|
assert result is not None
|
||||||
|
assert isinstance(result, AIMessage)
|
||||||
|
assert isinstance(result.content, str)
|
||||||
|
assert len(result.content) > 0
|
||||||
|
|
||||||
async def test_ainvoke(self, model: BaseChatModel) -> None:
|
async def test_ainvoke(self, model: BaseChatModel) -> None:
|
||||||
"""Test to verify that `await model.ainvoke(simple_message)` works.
|
"""Test to verify that `await model.ainvoke(simple_message)` works.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user