wenjin272 commented on code in PR #1060: URL: https://github.com/apache/flink-agents/pull/1060#discussion_r3976088828
########## api/src/main/java/org/apache/flink/agents/api/chat/messages/MediaBlock.java: ########## @@ -0,0 +1,155 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.agents.api.chat.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +import javax.annotation.Nullable; + +import java.util.Objects; + +/** + * Shared shape for binary media blocks: modality is the concrete type, encoding is the MIME type. + * + * <p>The payload is carried by exactly one of base64 {@code data} or an externally managed {@code + * url} (enforced by the argument constructor and the per-type factories; the no-arg bean path is + * lenient for deserialization). URL-backed content is externally managed: URLs may expire, may not + * be reachable by the model provider, and may be invalid after recovery from a checkpoint. The + * optional {@code name}/{@code sizeBytes}/{@code sha256} metadata also serves the Event Log, which + * records media metadata instead of payload bytes. + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public abstract class MediaBlock extends ContentBlock { + + @JsonProperty("mime_type") + private String mimeType; Review Comment: Would mediaType be a better name than mimeType here? Media Type is the terminology used by the current standards, while MIME type is more of a commonly used historical name. Since this field is part of the public multimodal ContentBlock API rather than a MIME-specific protocol implementation, mediaType may better describe its semantics and also reads naturally alongside MediaBlock. This is mostly an API naming suggestion, but since these block types are being introduced in this PR, it may be worth settling the terminology before the API becomes public. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
