Skip to content

Commit b4da39d

Browse files
committed
add
1 parent 8b5c3c1 commit b4da39d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

eval_protocol/models.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ def __iter__(self):
256256

257257
class Message(BaseModel):
258258
"""Chat message model with trajectory evaluation support."""
259-
260259
role: str # assistant, user, system, tool
261260
content: Optional[Union[str, List[ChatCompletionContentPartTextParam]]] = Field(
262261
default="", description="The content of the message."
@@ -269,7 +268,12 @@ class Message(BaseModel):
269268
tool_calls: Optional[List[ChatCompletionMessageToolCall]] = None
270269
function_call: Optional[FunctionCall] = None
271270
control_plane_step: Optional[Dict[str, Any]] = None
271+
weight: Optional[int] = None
272272

273+
def dump_mdoel_for_chat_completion_request(self):
274+
"""Only keep chat completion accepted fields"""
275+
return self.model_dump(exclude_none=True, exclude={"control_plane_step", "weight", "reasoning_content"})
276+
273277
@classmethod
274278
def model_validate(cls, obj, *args, **kwargs):
275279
if isinstance(obj, dict):

0 commit comments

Comments
 (0)