File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
spec-grpc/src/main/java/io/a2a/grpc/utils Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -267,6 +267,9 @@ private static io.a2a.grpc.FilePart filePart(FilePart filePart) {
267267 } else if (fileContent instanceof FileWithUri ) {
268268 builder .setFileWithUri (((FileWithUri ) fileContent ).uri ());
269269 }
270+ if (fileContent .name () != null ) {
271+ builder .setName (fileContent .name ());
272+ }
270273 return builder .build ();
271274 }
272275
@@ -936,9 +939,13 @@ private static TextPart textPart(String text) {
936939
937940 private static FilePart filePart (io .a2a .grpc .FilePartOrBuilder filePart ) {
938941 if (filePart .hasFileWithBytes ()) {
939- return new FilePart (new FileWithBytes (filePart .getMimeType (), null , filePart .getFileWithBytes ().toStringUtf8 ()));
942+ return new FilePart (new FileWithBytes (filePart .getMimeType (),
943+ ! filePart .getName ().isEmpty () ? filePart .getName () : null ,
944+ filePart .getFileWithBytes ().toStringUtf8 ()));
940945 } else if (filePart .hasFileWithUri ()) {
941- return new FilePart (new FileWithUri (filePart .getMimeType (), null , filePart .getFileWithUri ()));
946+ return new FilePart (new FileWithUri (filePart .getMimeType (),
947+ ! filePart .getName ().isEmpty () ? filePart .getName () : null ,
948+ filePart .getFileWithUri ()));
942949 }
943950 throw new InvalidRequestError ();
944951 }
You can’t perform that action at this time.
0 commit comments