Skip to content

The agent engineering platform.

openai[patch]: add test for message.name (#29651)

ccurme29a0c38cc35a
diff --git a/libs/partners/openai/tests/integration_tests/chat_models/test_base.py b/libs/partners/openai/tests/integration_tests/chat_models/test_base.py
index 69cc3f5d0f..ff7352b2bc 100644
--- a/libs/partners/openai/tests/integration_tests/chat_models/test_base.py
+++ b/libs/partners/openai/tests/integration_tests/chat_models/test_base.py
@@ -1202,3 +1202,14 @@ def test_o1_doesnt_stream() -> None:
def test_o1_stream_default_works() -> None:
result = list(ChatOpenAI(model="o1").stream("say 'hi'"))
assert len(result) > 0
+
+
+def test_multi_party_conversation() -> None:
+ llm = ChatOpenAI(model="gpt-4o")
+ messages = [
+ HumanMessage("Hi, I have black hair.", name="Alice"),
+ HumanMessage("Hi, I have brown hair.", name="Bob"),
+ HumanMessage("Who just spoke?", name="Charlie"),
+ ]
+ response = llm.invoke(messages)
+ assert "Bob" in response.content