Commit ce7d634
committed
Fix: Explicitly reconstruct map for FunctionCallPartDto mapping
Addresses a persistent compilation type mismatch error in PhotoReasoningMappers.kt when mapping FunctionCallPartDto to the SDK's FunctionCallPart, specifically for the 'args' field. Previous attempts using direct assignment and explicit casting did not resolve the issue where the compiler reported a mismatch despite seemingly identical types (Map<String, String?>?).
This commit modifies the `PartDto.toSdk()` function for the `FunctionCallPartDto` case. Instead of directly passing or casting `this.args`, a new `Map<String, String?>` is explicitly constructed by iterating over the entries of `this.args` (if not null) and populating the new map.
This explicit reconstruction provides a 'fresh' map instance with a clearly defined type to the SDK's `FunctionCallPart` constructor, aiming to resolve any subtle type system incompatibilities that the compiler might have been struggling with.1 parent 8cff988 commit ce7d634
File tree
1 file changed
+12
-1
lines changed- app/src/main/kotlin/com/google/ai/sample/feature/multimodal/dtos
1 file changed
+12
-1
lines changedLines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
59 | 70 | | |
60 | 71 | | |
61 | 72 | | |
| |||
0 commit comments