Skip to content

Commit 4921dff

Browse files
Fix: Correct nullability for FunctionCallPartDto.args
Resolves a compilation type mismatch error in PhotoReasoningMappers.kt related to the 'args' field of FunctionCallPart and FunctionCallPartDto. The `args` field in `FunctionCallPartDto` has been changed from `Map<String, String>?` to `Map<String, String?>?`. This allows the values within the map to be null, aligning with the inferred type from the SDK's `FunctionCallPart.args` and the type expected by its constructor. This change ensures that the direct assignment `args = this.args` in both `toDto` and `toSdk` mapping functions for `FunctionCallPart` is now type-correct, fixing the build failure.
1 parent 2862a2c commit 4921dff

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/src/main/kotlin/com/google/ai/sample/feature/multimodal/dtos/PhotoReasoningDtos.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ data class BlobPartDto(
5151
@SerialName("functionCall")
5252
data class FunctionCallPartDto(
5353
val name: String,
54-
val args: Map<String, String>? // Map<String, String> is serializable by default
54+
val args: Map<String, String?>? // Changed to allow nullable String values in the map
5555
) : PartDto
5656

5757
@Serializable

0 commit comments

Comments
 (0)