Skip to content

Commit da14fc5

Browse files
committed
Apply Gemini suggestions
1 parent 3cd35fa commit da14fc5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/a2a/utils/proto_utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,16 +508,18 @@ def data(cls, data: a2a_pb2.DataPart) -> dict[str, Any]:
508508
def file(
509509
cls, file: a2a_pb2.FilePart
510510
) -> types.FileWithUri | types.FileWithBytes:
511+
common_args = {
512+
'mime_type': file.mime_type or None,
513+
'name': file.name or None,
514+
}
511515
if file.HasField('file_with_uri'):
512516
return types.FileWithUri(
513517
uri=file.file_with_uri,
514-
mime_type=file.mime_type,
515-
name=file.name,
518+
**common_args,
516519
)
517520
return types.FileWithBytes(
518521
bytes=file.file_with_bytes.decode('utf-8'),
519-
mime_type=file.mime_type,
520-
name=file.name,
522+
**common_args,
521523
)
522524

523525
@classmethod

0 commit comments

Comments
 (0)