feat: 优化 Agent 运行时与聊天设置体验
This commit is contained in:
@@ -48,3 +48,26 @@ def test_convert_message_to_history_uses_ui_schema_key_for_assistant_message() -
|
||||
assert "ui_schema" in result
|
||||
assert "uiSchema" not in result
|
||||
assert result["ui_schema"] == {"version": "2.0", "root": {"type": "stack"}}
|
||||
|
||||
|
||||
def test_convert_message_to_history_returns_multiple_user_attachments() -> None:
|
||||
message = _FakeMessage(
|
||||
role="user",
|
||||
metadata={
|
||||
"user_message_attachments": [
|
||||
{"bucket": "bucket-a", "path": "path/a.png", "mime_type": "image/png"},
|
||||
{"bucket": "bucket-a", "path": "path/b.jpg", "mime_type": "image/jpeg"},
|
||||
]
|
||||
},
|
||||
)
|
||||
|
||||
def _signed(payload: dict[str, str]) -> str:
|
||||
return f"https://signed.example/{payload['bucket']}/{payload['path']}"
|
||||
|
||||
result = convert_message_to_history(message, _signed) # type: ignore[arg-type]
|
||||
|
||||
attachments = result.get("attachments")
|
||||
assert isinstance(attachments, list)
|
||||
assert len(attachments) == 2
|
||||
assert attachments[0]["mimeType"] == "image/png"
|
||||
assert attachments[1]["mimeType"] == "image/jpeg"
|
||||
|
||||
Reference in New Issue
Block a user