File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -694,3 +694,28 @@ def test_evaluation_row_extra_fields():
694694 assert "eval" in dictionary
695695 assert "accuracy" in dictionary ["eval_details" ]["metrics" ]
696696 assert "test" in dictionary ["extra_fields" ]
697+
698+ def test_message_with_weight_dump ():
699+ example = {
700+ "role" : "user" ,
701+ "content" : "Hello, how are you?" ,
702+ "weight" : 0 ,
703+ }
704+
705+ message = Message (** example )
706+ dictionary = message .model_dump ()
707+ assert "weight" in dictionary
708+ assert dictionary ["weight" ] == 0
709+
710+ def test_message_dump_for_chat_completion_request ():
711+ example = {
712+ "role" : "user" ,
713+ "content" : "Hello, how are you?" ,
714+ "weight" : 0 ,
715+ "reasoning_content" : "I am thinking about the user's question" ,
716+ }
717+ message = Message (** example )
718+ dictionary = message .dump_mdoel_for_chat_completion_request ()
719+ assert "weight" not in dictionary
720+ assert "reasoning_content" not in dictionary
721+ assert dictionary ["content" ] == "Hello, how are you?"
You can’t perform that action at this time.
0 commit comments