@@ -43,6 +43,46 @@ public void toGenaiPart_withTextPart_returnsGenaiTextPart() {
4343 assertThat (result .text ()).hasValue ("Hello" );
4444 }
4545
46+ @ Test
47+ public void toGenaiPart_withTextPartThought_returnsGenaiTextPartWithThought () {
48+ TextPart textPart = new TextPart ("Thinking process" , ImmutableMap .of ("thought" , true ));
49+
50+ Part result = PartConverter .toGenaiPart (textPart );
51+
52+ assertThat (result .text ()).hasValue ("Thinking process" );
53+ assertThat (result .thought ()).hasValue (true );
54+ }
55+
56+ @ Test
57+ public void toGenaiPart_withTextPartMetadataWithoutThought_returnsGenaiTextPartWithoutThought () {
58+ TextPart textPart = new TextPart ("Thinking process" , ImmutableMap .of ("otherKey" , "value" ));
59+
60+ Part result = PartConverter .toGenaiPart (textPart );
61+
62+ assertThat (result .text ()).hasValue ("Thinking process" );
63+ assertThat (result .thought ()).isEmpty ();
64+ }
65+
66+ @ Test
67+ public void toGenaiPart_withTextPartThoughtFalse_returnsGenaiTextPartWithoutThought () {
68+ TextPart textPart = new TextPart ("Thinking process" , ImmutableMap .of ("thought" , false ));
69+
70+ Part result = PartConverter .toGenaiPart (textPart );
71+
72+ assertThat (result .text ()).hasValue ("Thinking process" );
73+ assertThat (result .thought ()).isEmpty ();
74+ }
75+
76+ @ Test
77+ public void toGenaiPart_withTextPartNonBooleanThought_returnsGenaiTextPartWithoutThought () {
78+ TextPart textPart = new TextPart ("Thinking process" , ImmutableMap .of ("thought" , "true" ));
79+
80+ Part result = PartConverter .toGenaiPart (textPart );
81+
82+ assertThat (result .text ()).hasValue ("Thinking process" );
83+ assertThat (result .thought ()).isEmpty ();
84+ }
85+
4686 @ Test
4787 public void toGenaiPart_withFilePartUri_returnsGenaiFilePart () {
4888 FilePart filePart = new FilePart (new FileWithUri ("text/plain" , "file.txt" , "http://file.txt" ));
0 commit comments