mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-06 21:43:44 +00:00
change behavior for converting a string to openai messages (#29446)
This commit is contained in:
@@ -666,6 +666,12 @@ def create_base64_image(format: str = "jpeg") -> str:
|
||||
return f"data:image/{format};base64,{data}"
|
||||
|
||||
|
||||
def test_convert_to_openai_messages_string() -> None:
|
||||
message = "Hello"
|
||||
result = convert_to_openai_messages(message)
|
||||
assert result == {"role": "user", "content": "Hello"}
|
||||
|
||||
|
||||
def test_convert_to_openai_messages_single_message() -> None:
|
||||
message = HumanMessage(content="Hello")
|
||||
result = convert_to_openai_messages(message)
|
||||
|
Reference in New Issue
Block a user