File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -685,6 +685,23 @@ export const GoogleChatCompleteStreamChunkTransform: (
685685 }
686686 } ) ,
687687 } ;
688+ } else if ( generation . content ?. parts [ 0 ] ?. inlineData ) {
689+ const part = generation . content . parts [ 0 ] ;
690+ const contentBlocks = [
691+ {
692+ index : streamState . containsChainOfThoughtMessage ? 1 : 0 ,
693+ delta : {
694+ type : 'image_url' ,
695+ image_url : {
696+ url : `data:${ part . inlineData ?. mimeType } ;base64,${ part . inlineData ?. data } ` ,
697+ } ,
698+ } ,
699+ } ,
700+ ] ;
701+ message = {
702+ role : 'assistant' ,
703+ content_blocks : contentBlocks ,
704+ } ;
688705 }
689706 return {
690707 delta : message ,
Original file line number Diff line number Diff line change @@ -726,6 +726,23 @@ export const GoogleChatCompleteStreamChunkTransform: (
726726 }
727727 } ) ,
728728 } ;
729+ } else if ( generation . content ?. parts [ 0 ] ?. inlineData ) {
730+ const part = generation . content . parts [ 0 ] ;
731+ const contentBlocks = [
732+ {
733+ index : streamState . containsChainOfThoughtMessage ? 1 : 0 ,
734+ delta : {
735+ type : 'image_url' ,
736+ image_url : {
737+ url : `data:${ part . inlineData ?. mimeType } ;base64,${ part . inlineData ?. data } ` ,
738+ } ,
739+ } ,
740+ } ,
741+ ] ;
742+ message = {
743+ role : 'assistant' ,
744+ content_blocks : contentBlocks ,
745+ } ;
729746 }
730747 return {
731748 delta : message ,
You can’t perform that action at this time.
0 commit comments