Skip to content

Commit 5e7df2f

Browse files
committed
Cleanup
1 parent 0900f82 commit 5e7df2f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/vertexai/src/requests/request-helpers.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ export function formatNewContent(
5050
if (typeof request === 'string') {
5151
newParts = [{ text: request }];
5252
} 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 });
5656
} else {
57-
newParts.push(elem);
57+
newParts.push(partOrString);
5858
}
5959
}
6060
}
@@ -114,6 +114,7 @@ export function formatGenerateContentInput(
114114
if ((params as GenerateContentRequest).contents) {
115115
formattedRequest = params as GenerateContentRequest;
116116
} else {
117+
// Array or string
117118
const content = formatNewContent(params as string | Array<string | Part>);
118119
formattedRequest = { contents: [content] };
119120
}

packages/vertexai/src/requests/response-helpers.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ export function formatBlockErrorMessage(
207207
*
208208
* @internal
209209
*/
210-
211210
export async function handlePredictResponse<
212211
T extends ImagenInlineImage | ImagenGCSImage
213212
>(response: Response): Promise<{ images: T[]; filteredReason?: string }> {

0 commit comments

Comments
 (0)