-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
ChatMessage
not considered as stringable in query pipeline (#14378
- Loading branch information
Showing
2 changed files
with
10 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from llama_index.core.base.llms.types import ChatMessage, MessageRole | ||
from llama_index.core.base.query_pipeline.query import validate_and_convert_stringable | ||
|
||
|
||
def test_validate_and_convert_stringable() -> None: | ||
"""Test conversion of stringable object into string.""" | ||
message = ChatMessage(role=MessageRole.USER, content="hello") | ||
assert validate_and_convert_stringable(message) == "user: hello" |