Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions eval_protocol/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from openai.types.chat.chat_completion_message_tool_call import (
ChatCompletionMessageToolCall,
)
from openai.types.chat import ChatCompletionContentPartImageParam
from pydantic import BaseModel, ConfigDict, Field

from eval_protocol.get_pep440_version import get_pep440_version
Expand Down Expand Up @@ -462,9 +463,9 @@ class Message(BaseModel):
"""Chat message model with trajectory evaluation support."""

role: str # assistant, user, system, tool
content: Optional[Union[str, List[ChatCompletionContentPartTextParam]]] = Field(
default="", description="The content of the message."
)
content: Optional[
Union[str, List[Union[ChatCompletionContentPartTextParam, ChatCompletionContentPartImageParam]]]
] = Field(default="", description="The content of the message.")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Image content silently dropped by text extraction

The content field now accepts ChatCompletionContentPartImageParam, but existing code throughout the codebase (like _coerce_content_to_str functions in benchmark tests) only handles ChatCompletionContentPartTextParam by accessing the text attribute. When image parts are present, they're silently skipped since they have image_url instead of text, causing data loss without any error indication.

Fix in Cursor Fix in Web

reasoning_content: Optional[str] = Field(
default=None, description="Optional hidden chain-of-thought or reasoning content."
)
Expand Down
Loading