Skip to content
Closed
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
27 changes: 27 additions & 0 deletions src/agentscope_runtime/engine/schemas/agent_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class ContentType:
AUDIO = "audio"
FILE = "file"
REFUSAL = "refusal"
VIDEO = "video"


class Role:
Expand Down Expand Up @@ -231,6 +232,24 @@ class McpApprovalRequest(BaseModel):
"""The label of the mcp server making the request."""


class McpApprovalResponse(BaseModel):
"""
mcp approval response
"""

approval_request_id: str
"""The unique ID of the approval request."""

approve: bool
"""A json string of arguments for the tool."""
Comment on lines +236 to +244
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The docstrings for this class and its approve field could be improved for clarity and correctness. The class docstring should be capitalized, and the docstring for approve is incorrect for a boolean field, likely a copy-paste error.

Suggested change
"""
mcp approval response
"""
approval_request_id: str
"""The unique ID of the approval request."""
approve: bool
"""A json string of arguments for the tool."""
"""
Mcp approval response
"""
approval_request_id: str
"""The unique ID of the approval request."""
approve: bool
"""Whether the approval request is approved."""


id: Optional[str] = None
"""The unique ID of the approval response."""

reason: Optional[str] = None
"""Optional reason for the decision."""


class Error(BaseModel):
code: str
"""The error code of the message."""
Expand Down Expand Up @@ -383,6 +402,14 @@ class AudioContent(Content):
"""


class VideoContent(Content):
type: Literal[ContentType.VIDEO] = ContentType.VIDEO
"""The type of the content part."""

video_url: Optional[str] = None
"""The video URL details."""


Comment on lines +405 to +412
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The new VideoContent type is not included in the AgentContent Union type alias (defined on lines 464-474). This will prevent VideoContent from being used within a Message's content list and will likely cause validation errors at runtime. Please add VideoContent to the AgentContent union type to complete the video support feature.

class FileContent(Content):
type: Literal[ContentType.FILE] = ContentType.FILE
"""The type of the content part."""
Expand Down