File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
packages/vertexai/src/requests Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,11 @@ export function formatNewContent(
50
50
if ( typeof request === 'string' ) {
51
51
newParts = [ { text : request } ] ;
52
52
} else {
53
- for ( const elem of request ) {
54
- if ( typeof elem === 'string' ) {
55
- newParts . push ( { text : elem } ) ;
53
+ for ( const partOrString of request ) {
54
+ if ( typeof partOrString === 'string' ) {
55
+ newParts . push ( { text : partOrString } ) ;
56
56
} else {
57
- newParts . push ( elem ) ;
57
+ newParts . push ( partOrString ) ;
58
58
}
59
59
}
60
60
}
@@ -114,6 +114,7 @@ export function formatGenerateContentInput(
114
114
if ( ( params as GenerateContentRequest ) . contents ) {
115
115
formattedRequest = params as GenerateContentRequest ;
116
116
} else {
117
+ // Array or string
117
118
const content = formatNewContent ( params as string | Array < string | Part > ) ;
118
119
formattedRequest = { contents : [ content ] } ;
119
120
}
Original file line number Diff line number Diff line change @@ -207,7 +207,6 @@ export function formatBlockErrorMessage(
207
207
*
208
208
* @internal
209
209
*/
210
-
211
210
export async function handlePredictResponse <
212
211
T extends ImagenInlineImage | ImagenGCSImage
213
212
> ( response : Response ) : Promise < { images : T [ ] ; filteredReason ?: string } > {
You can’t perform that action at this time.
0 commit comments